From bcb1198ebce18e20abc94adcc16bb31c613dc293 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Wed, 29 Mar 2023 14:53:22 +0200 Subject: [PATCH 01/33] [ITT-398] Final Changes to prepare for Model/Service Automation (#457) * Automate services, Update Client/Service class * add target folder to gitignore * missed the CurlClient * Remove changes from old branch * ran codesniffer * moved baseurl creation to service.php class to reduce duplicate code * forgot the codesniffer.. * Added typing and replaced php8> operator * minor fixes * CurlClient method needs to be public * modified createBaseURL to be more descriptive and readable * Change layout to be more explicit and add Unit Tests * codestyle * change name of single services * fix unused var in test * fix codestatic errors * Match regular expression.. * TIL that const don't need $ * codestyling --- .gitignore | 3 + Makefile | 64 ++++++++++---- src/Adyen/Client.php | 1 + src/Adyen/HttpClient/CurlClient.php | 127 +++++++++++++++++++++++++++- src/Adyen/Service.php | 74 ++++++++++++++++ templates/api-single.mustache | 54 ++++++++++++ templates/api.mustache | 11 ++- templates/api_parameters.mustache | 2 +- templates/config.yaml | 7 +- templates/model_enum.mustache | 28 ------ tests/Unit/ServiceTest.php | 60 +++++++++++++ 11 files changed, 378 insertions(+), 53 deletions(-) create mode 100644 templates/api-single.mustache delete mode 100644 templates/model_enum.mustache create mode 100644 tests/Unit/ServiceTest.php diff --git a/.gitignore b/.gitignore index 313f6a0b8..6f394b85d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ composer.lock /build/ .php_cs.cache .phpunit.result.cache + +# Automation +/target/ \ No newline at end of file diff --git a/Makefile b/Makefile index 112d7e19f..b59df11dd 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,30 @@ -openapi-generator-version:=6.3.0 +openapi-generator-version:=6.4.0 openapi-generator-url:=https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$(openapi-generator-version)/openapi-generator-cli-$(openapi-generator-version).jar openapi-generator-jar:=target/openapi-generator-cli.jar openapi-generator-cli:=java -jar $(openapi-generator-jar) generator:=php -services:=Checkout +modelGen:=BalancePlatform Checkout StoredValue Payments Payout Management LegalEntityManagement Transfers BalanceControl BinLookup DataProtection StoredValue POSTerminalManagement Recurring models:=src/Adyen/Model output:=target/out # Generate models (for each service) -models: $(services) +models: $(modelGen) -Binlookup: spec=BinLookupService-v52 +BalanceControl: spec=BalanceControlService-v1 +BalancePlatform: spec=BalancePlatformService-v2 +BinLookup: spec=BinLookupService-v54 Checkout: spec=CheckoutService-v70 -storedValue: spec=StoredValueService-v46 -posterminalmanagement: spec=TfmAPIService-v1 -payments: spec=PaymentService-v68 -recurring: spec=RecurringService-v68 -payout: spec=PayoutService-v68 -management: spec=ManagementService-v1 -management: resourceClass=Management -balanceplatform: spec=BalancePlatformService-v2 +DataProtection: spec=DataProtectionService-v1 +StoredValue: spec=StoredValueService-v46 +POSTerminalManagement: spec=TfmAPIService-v1 +Payments: spec=PaymentService-v68 +Recurring: spec=RecurringService-v68 +Payout: spec=PayoutService-v68 +Management: spec=ManagementService-v1 +LegalEntityManagement: spec=LegalEntityService-v3 Transfers: spec=TransferService-v3 -Transfers: service=transfers -legalentitymanagement: spec=LegalEntityService-v2 + # Classic Platforms marketpay/account: spec=AccountService-v6 marketpay/fund: spec=FundService-v6 @@ -31,13 +32,13 @@ marketpay/configuration: spec=NotificationConfigurationService-v6 marketpay/webhooks: spec=MarketPayNotificationService-v6 hop: spec=HopService-v6 -$(services): target/spec $(openapi-generator-jar) +$(modelGen): target/spec $(openapi-generator-jar) rm -rf $(models)/$@ $(output) $(openapi-generator-cli) generate \ -i target/spec/json/$(spec).json \ -g $(generator) \ -o $(output) \ - -c ./templates/config.yaml \ + -t ./templates \ --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ @@ -49,13 +50,20 @@ $(services): target/spec $(openapi-generator-jar) mv $(output)/lib/Model/$@ $(models)/$@ mv $(output)/lib//ObjectSerializer.php $(models)/$@ -Checkout: target/spec $(openapi-generator-jar) +# Service Generation; split up in to templates based on the size of the service. That is, some services have no subgroups and are thus generated in one single file, others are grouped in a directory. + +Services:=BalancePlatform Checkout StoredValue Payments Payout Management LegalEntityManagement Transfers +SingleFileServices:=BalanceControl BinLookup DataProtection StoredValue POSTerminalManagement Recurring + +all: $(Services) $(SingleFileServices)) + +$(Services): target/spec $(openapi-generator-jar) rm -rf $(models)/$@ $(output) $(openapi-generator-cli) generate \ -i target/spec/json/$(spec).json \ -g $(generator) \ -o $(output) \ - -c ./templates/config.yaml \ + -t ./templates \ --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ @@ -69,6 +77,26 @@ Checkout: target/spec $(openapi-generator-jar) mkdir src/Adyen/Service/$@ mv $(output)/lib/Service/* src/Adyen/Service +$(SingleFileServices): target/spec $(openapi-generator-jar) + rm -rf $(models)/$@ $(output) + $(openapi-generator-cli) generate \ + -i target/spec/json/$(spec).json \ + -g $(generator) \ + -o $(output) \ + -c templates/config.yaml \ + --model-package Model\\$@ \ + --api-package Service\\$@ \ + --reserved-words-mappings configuration=configuration \ + --ignore-file-override ./.openapi-generator-ignore \ + --skip-validate-spec \ + --additional-properties customApi=$@ \ + --additional-properties invokerPackage=Adyen \ + --additional-properties packageName=Adyen + rm -rf src/Adyen/Service/$@Api src/Adyen/Model/$@ + mv $(output)/lib/Model/$@ $(models)/$@ + mv $(output)/lib//ObjectSerializer.php $(models)/$@ + mv $(output)/lib/Service/$@/GeneralApiSingle.php src/Adyen/Service/$@Api.php + # Checkout spec (and patch version) target/spec: git clone https://github.com/Adyen/adyen-openapi.git target/spec diff --git a/src/Adyen/Client.php b/src/Adyen/Client.php index 98fb1dbd6..512cbf284 100644 --- a/src/Adyen/Client.php +++ b/src/Adyen/Client.php @@ -175,6 +175,7 @@ public function setEnvironment($environment, $liveEndpointUrlPrefix = null) $this->config->set('endpointManagementApi', self::MANAGEMENT_API_LIVE); if ($liveEndpointUrlPrefix) { + $this->config->set('prefix', $liveEndpointUrlPrefix); $this->config->set( 'endpoint', self::ENDPOINT_PROTOCOL . $liveEndpointUrlPrefix . self::ENDPOINT_LIVE_SUFFIX diff --git a/src/Adyen/HttpClient/CurlClient.php b/src/Adyen/HttpClient/CurlClient.php index 1f15ccd5d..ac5e718a5 100644 --- a/src/Adyen/HttpClient/CurlClient.php +++ b/src/Adyen/HttpClient/CurlClient.php @@ -6,6 +6,10 @@ class CurlClient implements ClientInterface { + + const USER_AGENT = 'User-Agent: '; + const CONTENT_TYPE = 'Content-Type: application/json'; + // List of parameters that needs to be masked with the same array structure as it appears in // the response array private static $responseParamsToMask = array( @@ -127,7 +131,7 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params) //Set the content type to application/json and use the defined userAgent $headers = array( 'Content-Type: application/x-www-form-urlencoded', - 'User-Agent: ' . $userAgent + self::USER_AGENT . $userAgent ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); @@ -392,8 +396,125 @@ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $meth //Set the content type to application/json and use the defined userAgent $headers = array( - 'Content-Type: application/json', - 'User-Agent: ' . $userAgent + self::CONTENT_TYPE, + self::USER_AGENT . $userAgent + ); + + // if idempotency key is provided as option include into request + if (!empty($requestOptions['idempotencyKey'])) { + $headers[] = 'Idempotency-Key: ' . $requestOptions['idempotencyKey']; + } + + // set authorisation credentials according to support & availability + if (!empty($xApiKey)) { + //Set the content type to application/json and use the defined userAgent along with the x-api-key + $headers[] = 'x-api-key: ' . $xApiKey; + } elseif ($service->requiresApiKey()) { + $msg = "Please provide a valid Checkout API Key"; + throw new AdyenException($msg); + } else { + //Set the basic auth credentials + curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password); + } + + //Set the timeout + if ($config->getTimeout() != null) { + curl_setopt($ch, CURLOPT_TIMEOUT, $config->getTimeout()); + } + + //Set the headers + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + + // return the result + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + //Execute the request + list($result, $httpStatus) = $this->curlRequest($ch); + + // log the response + $decodedResult = json_decode($result, true); + $this->logResponse($logger, $environment, $decodedResult); + + // Get errors + list($errno, $message) = $this->curlError($ch); + + curl_close($ch); + + $resultOKHttpStatusCodes = array(200, 201, 202, 204); + + if (!in_array($httpStatus, $resultOKHttpStatusCodes) && $result) { + $this->handleResultError($result, $logger); + } elseif (!$result) { + $this->handleCurlError($requestUrl, $errno, $message, $logger); + } + + // result in array or json + if ($config->getOutputType() == 'array') { + // transform to PHP Array + $result = json_decode($result, true); + } + + return $result; + } + + // This method implements Restfull requests where the query params are stored in requestOptions as an array. + public function requestHttpRest( + \Adyen\Service $service, + string $requestUrl, + $bodyParams, + string $method, + $requestOptions = null + ): array { + $client = $service->getClient(); + $config = $client->getConfig(); + $logger = $client->getLogger(); + $username = $config->getUsername(); + $password = $config->getPassword(); + $xApiKey = $config->getXApiKey(); + $httpProxy = $config->getHttpProxy(); + $environment = $config->getEnvironment(); + + $jsonRequest = json_encode($bodyParams); + + // Log the request + $this->logRequest($logger, $requestUrl, $environment, $bodyParams); + + //Check if there are url query params to construct the url + $queryParams = $requestOptions; + unset($queryParams['idempotencyKey']); + if (!empty($queryParams)) { + $requestUrl .= '?' . http_build_query($queryParams); + } + //Initiate cURL. + $ch = curl_init($requestUrl); + + if ($method === self::HTTP_METHOD_GET) { + curl_setopt($ch, CURLOPT_HTTPGET, 1); + } elseif ($method === self::HTTP_METHOD_POST) { + //Tell cURL that we want to send a POST request. + curl_setopt($ch, CURLOPT_POST, 1); + //Attach our encoded JSON string to the POST fields. + curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonRequest); + } elseif ($method === self::HTTP_METHOD_PATCH) { + //Tell cURL that we want to send a PATCH request. + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); + //Attach our encoded JSON string to the PATCH fields. + curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonRequest); + } elseif ($method === self::HTTP_METHOD_DELETE) { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); + } + + $this->curlSetHttpProxy($ch, $httpProxy); + + //create a custom User-Agent + $userAgent = $config->get('applicationName') . " " . + \Adyen\Client::USER_AGENT_SUFFIX . $client->getLibraryVersion(); + + //Set the content type to application/json and use the defined userAgent + $headers = array( + self::CONTENT_TYPE, + self::USER_AGENT . $userAgent ); // if idempotency key is provided as option include into request diff --git a/src/Adyen/Service.php b/src/Adyen/Service.php index 772016aef..2418f26fb 100644 --- a/src/Adyen/Service.php +++ b/src/Adyen/Service.php @@ -2,6 +2,8 @@ namespace Adyen; +use PHPUnit\Util\Exception; + class Service { /** @@ -43,6 +45,31 @@ public function getClient() return $this->client; } + /** + * @throws AdyenException + */ + protected function requestHttp( + string $url, + string $method = 'get', + array $bodyParams = null, + array $requestOptions = null + ): array { + // check if rest api method has a value + if (!$method) { + $msg = 'The REST API method is empty'; + $this->getClient()->getLogger()->error($msg); + throw new AdyenException($msg); + } + // check if rest api method has a value + if (!$url) { + $msg = 'The REST API endpoint is empty'; + $this->getClient()->getLogger()->error($msg); + throw new AdyenException($msg); + } + $curlClient = $this->getClient()->getHttpClient(); + return $curlClient->requestHttpRest($this, $url, $bodyParams, $method, $requestOptions); + } + /** * @return bool */ @@ -50,4 +77,51 @@ public function requiresApiKey() { return $this->requiresApiKey; } + + /** + * @param string $url + * @return string + * @throws AdyenException + */ + public function createBaseUrl(string $url): string + { + $config = $this->getClient()->getConfig(); + if ($this->getClient()->getConfig()->getEnvironment() === \Adyen\Environment::LIVE) { + // Add live url prefix for pal/servlet endpoints + if (strpos($url, "pal-") !== false) { + // Check prefix is not empty and if so throw error + if ($config->get('prefix') == null) { + throw new \Adyen\AdyenException( + "Please add your live URL prefix from CA under Developers > API URLs > Prefix" + ); + } + + // We inject the prefix formatted like "https://{PREFIX}-" + $url = str_replace( + "https://pal-test.adyen.com/pal/servlet/", + "https://" . $config->get('prefix') . '-pal-live.adyenpayments.com/pal/servlet/', + $url + ); + } + // Add live url prefix for checkout + if (strpos($url, "checkout-") !== false) { + if ($config->get('prefix') == null) { + throw new \Adyen\AdyenException( + "Please add your checkout live URL prefix from CA under Developers > API URLs > Prefix" + ); + } + + // We inject the live prefix like "https://{PREFIX}-" + $url = str_replace( + "https://checkout-test.adyen.com/", + "https://" . $config->get('prefix') . '-checkout-live.adyenpayments.com/checkout/', + $url + ); + } + + // Replace 'test' in string with 'live' for the other endpoints + $url = str_replace('-test', '-live', $url); + } + return $url; + } } diff --git a/templates/api-single.mustache b/templates/api-single.mustache new file mode 100644 index 000000000..2aa4252ef --- /dev/null +++ b/templates/api-single.mustache @@ -0,0 +1,54 @@ +partial_header}} +namespace Adyen\Service; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use {{modelPackage}}\ObjectSerializer; + +{{#operations}} +class {{customApi}}Api extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * {{packageName}}Service constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("{{{basePath}}}"); + } +{{#operation}} + + /** + {{#summary}} + * {{.}} + {{/summary}} + * + {{#description}} + * Description: {{.}} + * + {{/description}} + {{#allParams}}* @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} + {{/allParams}}* @param array $requestOptions + {{#returnType}}* @return {{returnType}}{{/returnType}} + * @throws AdyenException + */ + public function {{#lambda.camelcase}}{{vendorExtensions.x-methodName}}{{/lambda.camelcase}}({{>api_parameters}}){{#returnType}}: {{{.}}}{{/returnType}} + { + $endpoint = $this->baseURL . {{#hasPathParams}}str_replace([{{#pathParams}}'{{>left_bracket}}{{baseName}}{{>right_bracket}}'{{^-last}}, {{/-last}}{{/pathParams}}], [{{#pathParams}}${{baseName}}{{^-last}}, {{/-last}}{{/pathParams}}], {{/hasPathParams}}"{{{path}}}"{{#hasPathParams}}){{/hasPathParams}}; + {{#returnType}}$response = {{/returnType}}$this->requestHttp($endpoint, strtolower('{{httpMethod}}'), {{#bodyParam}}(array) ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}->jsonSerialize(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, $requestOptions); + {{#returnType}}return ObjectSerializer::deserialize($response, {{returnType}}::class);{{/returnType}} + } +{{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/templates/api.mustache b/templates/api.mustache index ca3bca2aa..d3415fe55 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -10,6 +10,11 @@ use {{modelPackage}}\ObjectSerializer; {{#operations}} class {{classname}} extends Service { + /** + * @var array|string|string[] + */ + private $baseURL; + /** * {{classname}} constructor. * @@ -19,7 +24,9 @@ class {{classname}} extends Service public function __construct(Client $client) { parent::__construct($client); - $this->baseURL = $client->getConfig()->get('endpointCheckout') . "/" . $client->getApiCheckoutVersion(); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("{{{basePath}}}"); } {{#operation}} @@ -39,7 +46,7 @@ class {{classname}} extends Service */ public function {{#lambda.camelcase}}{{vendorExtensions.x-methodName}}{{/lambda.camelcase}}({{>api_parameters}}){{#returnType}}: {{{.}}}{{/returnType}} { - $endpoint = $this->baseURL . {{#hasPathParams}}str_replace({{/hasPathParams}}{{#pathParams}}['{{>left_bracket}}{{baseName}}{{>right_bracket}}'{{#last}}, {{/last}}], [${{baseName}}{{#last}}, {{/last}}], {{/pathParams}}"{{{path}}}"{{#hasPathParams}}){{/hasPathParams}}; + $endpoint = $this->baseURL . {{#hasPathParams}}str_replace([{{#pathParams}}'{{>left_bracket}}{{baseName}}{{>right_bracket}}'{{^-last}}, {{/-last}}{{/pathParams}}], [{{#pathParams}}${{baseName}}{{^-last}}, {{/-last}}{{/pathParams}}], {{/hasPathParams}}"{{{path}}}"{{#hasPathParams}}){{/hasPathParams}}; {{#returnType}}$response = {{/returnType}}$this->requestHttp($endpoint, strtolower('{{httpMethod}}'), {{#bodyParam}}(array) ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}->jsonSerialize(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, $requestOptions); {{#returnType}}return ObjectSerializer::deserialize($response, {{returnType}}::class);{{/returnType}} } diff --git a/templates/api_parameters.mustache b/templates/api_parameters.mustache index ad56bc881..57685257f 100644 --- a/templates/api_parameters.mustache +++ b/templates/api_parameters.mustache @@ -1,2 +1,2 @@ {{! Path and body are required, followed by optional query string and request options }} -{{#pathParams}}{{{dataType}}} ${{baseName}}, {{/pathParams}}{{#bodyParams}}{{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}, {{/bodyParams}}$requestOptions = null \ No newline at end of file +{{#pathParams}}{{{dataType}}} ${{baseName}}, {{/pathParams}}{{#bodyParams}}{{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}, {{/bodyParams}}array $requestOptions = null \ No newline at end of file diff --git a/templates/config.yaml b/templates/config.yaml index 0a8f51781..7307552ee 100644 --- a/templates/config.yaml +++ b/templates/config.yaml @@ -1 +1,6 @@ -templateDir: ./templates \ No newline at end of file +templateDir: ./templates +files: + api-single.mustache: + folder: api + templateType: API + destinationFilename: Single.php \ No newline at end of file diff --git a/templates/model_enum.mustache b/templates/model_enum.mustache deleted file mode 100644 index 77001f2e6..000000000 --- a/templates/model_enum.mustache +++ /dev/null @@ -1,28 +0,0 @@ -class {{classname}} -{ - /** - * Possible values of this enum - */ - {{#allowableValues}} - {{#enumVars}} - public const {{^isString}}NUMBER_{{/isString}}{{{name}}} = {{{value}}}; - - {{/enumVars}} - {{/allowableValues}} - /** - * Gets allowable values of the enum - * @return string[] - */ - public static function getAllowableEnumValues() - { - return [ - {{#allowableValues}} - {{#enumVars}} - self::{{^isString}}NUMBER_{{/isString}}{{{name}}}{{^-last}}, - {{/-last}} - {{/enumVars}} - {{/allowableValues}} - - ]; - } -} diff --git a/tests/Unit/ServiceTest.php b/tests/Unit/ServiceTest.php new file mode 100644 index 000000000..c5e841e15 --- /dev/null +++ b/tests/Unit/ServiceTest.php @@ -0,0 +1,60 @@ +setEnvironment(Environment::LIVE, "[prefix]"); + $service = new Service($client); + $url = $service->createBaseUrl("https://pal-test.adyen.com/pal/servlet/Payment/[version]/[method]"); + self::assertEquals( + "https://[prefix]-pal-live.adyenpayments.com/pal/servlet/Payment/[version]/[method]", + $url + ); + } + + public function testLiveURLPrefixCheckout() + { + $client = new Client(); + $client->setEnvironment(Environment::LIVE, "[prefix]"); + $service = new Service($client); + $url = $service->createBaseUrl("https://checkout-test.adyen.com/[version]/[method]"); + self::assertEquals( + "https://[prefix]-checkout-live.adyenpayments.com/checkout/[version]/[method]", + $url + ); + } + + public function testLiveEndpointWithoutRequiredPrefix() + { + $client = new Client(); + $client->setEnvironment(Environment::LIVE); + $service = new Service($client); + try { + $service->createBaseUrl("https://checkout-test.adyen.com/[version]/[method]"); + } catch (AdyenException $e) { + assertEquals( + "Please add your checkout live URL prefix from CA under Developers > API URLs > Prefix", + $e->getMessage() + ); + } + } + + public function testLiveURLPrefixOther() + { + $client = new Client(); + $client->setEnvironment(Environment::LIVE); + $service = new Service($client); + $url = $service->createBaseUrl("https://kyc-test.adyen.com/lem/v3/legalEntities"); + self::assertEquals("https://kyc-live.adyen.com/lem/v3/legalEntities", $url); + } +} From 01ca7462748c87f8f7d2b21cc7a836dc0835f9cc Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 31 Mar 2023 10:25:50 +0200 Subject: [PATCH 02/33] pull new templates and generate Bcl --- .github/workflows/main.yml | 2 +- sonar-project.properties | 3 +- .../AULocalAccountIdentification.php | 495 +++++++++ .../Model/BalancePlatform/AccountHolder.php | 770 ++++++++++++++ .../AccountHolderCapability.php | 804 ++++++++++++++ .../BalancePlatform/AccountHolderInfo.php | 594 +++++++++++ .../AccountSupportingEntityCapability.php | 702 ++++++++++++ .../ActiveNetworkTokensRestriction.php | 422 ++++++++ .../AdditionalBankIdentification.php | 454 ++++++++ src/Adyen/Model/BalancePlatform/Address.php | 572 ++++++++++ src/Adyen/Model/BalancePlatform/Address2.php | 594 +++++++++++ src/Adyen/Model/BalancePlatform/Amount.php | 427 ++++++++ .../Model/BalancePlatform/Authentication.php | 455 ++++++++ src/Adyen/Model/BalancePlatform/Balance.php | 501 +++++++++ .../Model/BalancePlatform/BalanceAccount.php | 668 ++++++++++++ .../BalancePlatform/BalanceAccountInfo.php | 526 +++++++++ .../BalanceAccountUpdateRequest.php | 594 +++++++++++ .../Model/BalancePlatform/BalancePlatform.php | 458 ++++++++ .../BalanceSweepConfigurationsResponse.php | 464 ++++++++ ...AccountIdentificationValidationRequest.php | 390 +++++++ ...ValidationRequestAccountIdentification.php | 830 +++++++++++++++ .../BrandVariantsRestriction.php | 424 ++++++++ .../Model/BalancePlatform/BulkAddress.php | 662 ++++++++++++ .../CALocalAccountIdentification.php | 599 +++++++++++ .../CZLocalAccountIdentification.php | 495 +++++++++ src/Adyen/Model/BalancePlatform/Card.php | 811 ++++++++++++++ .../BalancePlatform/CardConfiguration.php | 832 +++++++++++++++ src/Adyen/Model/BalancePlatform/CardInfo.php | 638 +++++++++++ .../Model/BalancePlatform/ContactDetails.php | 498 +++++++++ .../BalancePlatform/CountriesRestriction.php | 424 ++++++++ .../BalancePlatform/CronSweepSchedule.php | 463 ++++++++ .../BalancePlatform/DayOfWeekRestriction.php | 457 ++++++++ .../Model/BalancePlatform/DeliveryContact.php | 563 ++++++++++ .../DifferentCurrenciesRestriction.php | 424 ++++++++ src/Adyen/Model/BalancePlatform/Duration.php | 458 ++++++++ .../BalancePlatform/EntryModesRestriction.php | 461 ++++++++ src/Adyen/Model/BalancePlatform/Expiry.php | 421 ++++++++ .../HULocalAccountIdentification.php | 458 ++++++++ .../IbanAccountIdentification.php | 458 ++++++++ .../InternationalTransactionRestriction.php | 424 ++++++++ .../Model/BalancePlatform/InvalidField.php | 464 ++++++++ .../Model/BalancePlatform/JSONObject.php | 421 ++++++++ src/Adyen/Model/BalancePlatform/JSONPath.php | 387 +++++++ .../MatchingTransactionsRestriction.php | 422 ++++++++ .../Model/BalancePlatform/MccsRestriction.php | 424 ++++++++ .../BalancePlatform/MerchantAcquirerPair.php | 421 ++++++++ .../MerchantNamesRestriction.php | 424 ++++++++ .../BalancePlatform/MerchantsRestriction.php | 424 ++++++++ .../Model/BalancePlatform/ModelInterface.php | 95 ++ .../NOLocalAccountIdentification.php | 458 ++++++++ src/Adyen/Model/BalancePlatform/Name.php | 427 ++++++++ .../NumberAndBicAccountIdentification.php | 529 ++++++++++ .../BalancePlatform/ObjectSerializer.php | 319 ++++++ .../PLLocalAccountIdentification.php | 458 ++++++++ .../PaginatedAccountHoldersResponse.php | 464 ++++++++ .../PaginatedBalanceAccountsResponse.php | 464 ++++++++ .../PaginatedPaymentInstrumentsResponse.php | 464 ++++++++ .../BalancePlatform/PaymentInstrument.php | 854 +++++++++++++++ .../PaymentInstrumentBankAccount.php | 537 ++++++++++ .../PaymentInstrumentGroup.php | 563 ++++++++++ .../PaymentInstrumentGroupInfo.php | 529 ++++++++++ .../BalancePlatform/PaymentInstrumentInfo.php | 783 ++++++++++++++ .../PaymentInstrumentRevealInfo.php | 464 ++++++++ .../PaymentInstrumentUpdateRequest.php | 605 +++++++++++ src/Adyen/Model/BalancePlatform/Phone.php | 460 ++++++++ .../Model/BalancePlatform/PhoneNumber.php | 492 +++++++++ .../ProcessingTypesRestriction.php | 459 ++++++++ .../BalancePlatform/RestServiceError.php | 672 ++++++++++++ .../SELocalAccountIdentification.php | 495 +++++++++ .../SGLocalAccountIdentification.php | 492 +++++++++ .../Model/BalancePlatform/StringMatch.php | 458 ++++++++ .../BalancePlatform/SweepConfigurationV2.php | 996 ++++++++++++++++++ .../SweepConfigurationV2Schedule.php | 425 ++++++++ .../BalancePlatform/SweepCounterparty.php | 455 ++++++++ .../Model/BalancePlatform/SweepSchedule.php | 426 ++++++++ src/Adyen/Model/BalancePlatform/TimeOfDay.php | 421 ++++++++ .../BalancePlatform/TimeOfDayRestriction.php | 424 ++++++++ .../TotalAmountRestriction.php | 424 ++++++++ .../Model/BalancePlatform/TransactionRule.php | 983 +++++++++++++++++ .../TransactionRuleEntityKey.php | 421 ++++++++ .../BalancePlatform/TransactionRuleInfo.php | 949 +++++++++++++++++ .../TransactionRuleInterval.php | 644 +++++++++++ .../TransactionRuleResponse.php | 387 +++++++ .../TransactionRuleRestrictions.php | 829 +++++++++++++++ .../TransactionRulesResponse.php | 387 +++++++ .../UKLocalAccountIdentification.php | 495 +++++++++ .../USLocalAccountIdentification.php | 562 ++++++++++ .../UpdatePaymentInstrument.php | 888 ++++++++++++++++ .../BalancePlatform/VerificationDeadline.php | 546 ++++++++++ .../BalancePlatform/AccountHoldersApi.php | 107 ++ .../BalancePlatform/BalanceAccountsApi.php | 189 ++++ .../BankAccountValidationApi.php | 59 ++ .../PaymentInstrumentGroupsApi.php | 89 ++ .../BalancePlatform/PaymentInstrumentsApi.php | 120 +++ .../Service/BalancePlatform/PlatformApi.php | 76 ++ .../BalancePlatform/TransactionRulesApi.php | 105 ++ templates/model.mustache | 2 +- templates/model_generic.mustache | 9 +- 98 files changed, 47036 insertions(+), 5 deletions(-) create mode 100644 src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/AccountHolder.php create mode 100644 src/Adyen/Model/BalancePlatform/AccountHolderCapability.php create mode 100644 src/Adyen/Model/BalancePlatform/AccountHolderInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php create mode 100644 src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/Address.php create mode 100644 src/Adyen/Model/BalancePlatform/Address2.php create mode 100644 src/Adyen/Model/BalancePlatform/Amount.php create mode 100644 src/Adyen/Model/BalancePlatform/Authentication.php create mode 100644 src/Adyen/Model/BalancePlatform/Balance.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceAccount.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/BalancePlatform.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/BulkAddress.php create mode 100644 src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/Card.php create mode 100644 src/Adyen/Model/BalancePlatform/CardConfiguration.php create mode 100644 src/Adyen/Model/BalancePlatform/CardInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/ContactDetails.php create mode 100644 src/Adyen/Model/BalancePlatform/CountriesRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/CronSweepSchedule.php create mode 100644 src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/DeliveryContact.php create mode 100644 src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/Duration.php create mode 100644 src/Adyen/Model/BalancePlatform/EntryModesRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/Expiry.php create mode 100644 src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/InvalidField.php create mode 100644 src/Adyen/Model/BalancePlatform/JSONObject.php create mode 100644 src/Adyen/Model/BalancePlatform/JSONPath.php create mode 100644 src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/MccsRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php create mode 100644 src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/MerchantsRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/ModelInterface.php create mode 100644 src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/Name.php create mode 100644 src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/ObjectSerializer.php create mode 100644 src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrument.php create mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php create mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php create mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/Phone.php create mode 100644 src/Adyen/Model/BalancePlatform/PhoneNumber.php create mode 100644 src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/RestServiceError.php create mode 100644 src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/StringMatch.php create mode 100644 src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php create mode 100644 src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php create mode 100644 src/Adyen/Model/BalancePlatform/SweepCounterparty.php create mode 100644 src/Adyen/Model/BalancePlatform/SweepSchedule.php create mode 100644 src/Adyen/Model/BalancePlatform/TimeOfDay.php create mode 100644 src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php create mode 100644 src/Adyen/Model/BalancePlatform/TransactionRule.php create mode 100644 src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php create mode 100644 src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php create mode 100644 src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php create mode 100644 src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php create mode 100644 src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php create mode 100644 src/Adyen/Model/BalancePlatform/VerificationDeadline.php create mode 100644 src/Adyen/Service/BalancePlatform/AccountHoldersApi.php create mode 100644 src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php create mode 100644 src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php create mode 100644 src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php create mode 100644 src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php create mode 100644 src/Adyen/Service/BalancePlatform/PlatformApi.php create mode 100644 src/Adyen/Service/BalancePlatform/TransactionRulesApi.php diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed127554b..7b28e82c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: run: sed -i "s;`pwd`/;;g" build/*.xml - name: Run PHP Code Sniffer - run: vendor/bin/phpcs + run: vendor/bin/phpcs --exclude=Generic.Files.LineLength - name: Make sure project files are compilable run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l diff --git a/sonar-project.properties b/sonar-project.properties index 881c18393..196c0bb2e 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,4 +2,5 @@ sonar.organization=adyen sonar.projectKey=Adyen_adyen-php-api-library sonar.sources=. sonar.php.coverage.reportPaths=build/clover.xml -sonar.php.tests.reportPath=build/tests-log.xml \ No newline at end of file +sonar.php.tests.reportPath=build/tests-log.xml +sonar.exclusions=src/Adyen/Model/**, src/Adyen/Service/Checkout/**, src/Adyen/Service/Payments/**, src/Adyen/Service/Management/** \ No newline at end of file diff --git a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php new file mode 100644 index 000000000..24d9ac505 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php @@ -0,0 +1,495 @@ + + */ +class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AULocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'bsb_code' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'bsb_code' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'bsb_code' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'bsb_code' => 'bsbCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'bsb_code' => 'setBsbCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'bsb_code' => 'getBsbCode', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_AU_LOCAL = 'auLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AU_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('bsb_code', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'auLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['bsb_code'] === null) { + $invalidProperties[] = "'bsb_code' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets bsb_code + * + * @return string + */ + public function getBsbCode() + { + return $this->container['bsb_code']; + } + + /** + * Sets bsb_code + * + * @param string $bsb_code The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * + * @return self + */ + public function setBsbCode($bsb_code) + { + if (is_null($bsb_code)) { + throw new \InvalidArgumentException('non-nullable bsb_code cannot be null'); + } + $this->container['bsb_code'] = $bsb_code; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **auLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php new file mode 100644 index 000000000..709dee5d1 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -0,0 +1,770 @@ + + */ +class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolder'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_platform' => 'string', + 'capabilities' => 'array', + 'contact_details' => '\Adyen\Model\BalancePlatform\ContactDetails', + 'description' => 'string', + 'id' => 'string', + 'legal_entity_id' => 'string', + 'primary_balance_account' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'time_zone' => 'string', + 'verification_deadlines' => '\Adyen\Model\BalancePlatform\VerificationDeadline[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_platform' => null, + 'capabilities' => null, + 'contact_details' => null, + 'description' => null, + 'id' => null, + 'legal_entity_id' => null, + 'primary_balance_account' => null, + 'reference' => null, + 'status' => null, + 'time_zone' => null, + 'verification_deadlines' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_platform' => false, + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'id' => false, + 'legal_entity_id' => false, + 'primary_balance_account' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false, + 'verification_deadlines' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_platform' => 'balancePlatform', + 'capabilities' => 'capabilities', + 'contact_details' => 'contactDetails', + 'description' => 'description', + 'id' => 'id', + 'legal_entity_id' => 'legalEntityId', + 'primary_balance_account' => 'primaryBalanceAccount', + 'reference' => 'reference', + 'status' => 'status', + 'time_zone' => 'timeZone', + 'verification_deadlines' => 'verificationDeadlines' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_platform' => 'setBalancePlatform', + 'capabilities' => 'setCapabilities', + 'contact_details' => 'setContactDetails', + 'description' => 'setDescription', + 'id' => 'setId', + 'legal_entity_id' => 'setLegalEntityId', + 'primary_balance_account' => 'setPrimaryBalanceAccount', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'time_zone' => 'setTimeZone', + 'verification_deadlines' => 'setVerificationDeadlines' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_platform' => 'getBalancePlatform', + 'capabilities' => 'getCapabilities', + 'contact_details' => 'getContactDetails', + 'description' => 'getDescription', + 'id' => 'getId', + 'legal_entity_id' => 'getLegalEntityId', + 'primary_balance_account' => 'getPrimaryBalanceAccount', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'time_zone' => 'getTimeZone', + 'verification_deadlines' => 'getVerificationDeadlines' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_platform', $data ?? [], null); + $this->setIfExists('capabilities', $data ?? [], null); + $this->setIfExists('contact_details', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('legal_entity_id', $data ?? [], null); + $this->setIfExists('primary_balance_account', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + $this->setIfExists('verification_deadlines', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['legal_entity_id'] === null) { + $invalidProperties[] = "'legal_entity_id' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance_platform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balance_platform']; + } + + /** + * Sets balance_platform + * + * @param string|null $balance_platform The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + * + * @return self + */ + public function setBalancePlatform($balance_platform) + { + if (is_null($balance_platform)) { + throw new \InvalidArgumentException('non-nullable balance_platform cannot be null'); + } + $this->container['balance_platform'] = $balance_platform; + + return $this; + } + + /** + * Gets capabilities + * + * @return array|null + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param array|null $capabilities Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + * + * @return self + */ + public function setCapabilities($capabilities) + { + if (is_null($capabilities)) { + throw new \InvalidArgumentException('non-nullable capabilities cannot be null'); + } + $this->container['capabilities'] = $capabilities; + + return $this; + } + + /** + * Gets contact_details + * + * @return \Adyen\Model\BalancePlatform\ContactDetails|null + */ + public function getContactDetails() + { + return $this->container['contact_details']; + } + + /** + * Sets contact_details + * + * @param \Adyen\Model\BalancePlatform\ContactDetails|null $contact_details contact_details + * + * @return self + */ + public function setContactDetails($contact_details) + { + if (is_null($contact_details)) { + throw new \InvalidArgumentException('non-nullable contact_details cannot be null'); + } + $this->container['contact_details'] = $contact_details; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the account holder, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the account holder. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets legal_entity_id + * + * @return string + */ + public function getLegalEntityId() + { + return $this->container['legal_entity_id']; + } + + /** + * Sets legal_entity_id + * + * @param string $legal_entity_id The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. + * + * @return self + */ + public function setLegalEntityId($legal_entity_id) + { + if (is_null($legal_entity_id)) { + throw new \InvalidArgumentException('non-nullable legal_entity_id cannot be null'); + } + $this->container['legal_entity_id'] = $legal_entity_id; + + return $this; + } + + /** + * Gets primary_balance_account + * + * @return string|null + */ + public function getPrimaryBalanceAccount() + { + return $this->container['primary_balance_account']; + } + + /** + * Sets primary_balance_account + * + * @param string|null $primary_balance_account The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. + * + * @return self + */ + public function setPrimaryBalanceAccount($primary_balance_account) + { + if (is_null($primary_balance_account)) { + throw new \InvalidArgumentException('non-nullable primary_balance_account cannot be null'); + } + $this->container['primary_balance_account'] = $primary_balance_account; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets time_zone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string|null $time_zone The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($time_zone) + { + if (is_null($time_zone)) { + throw new \InvalidArgumentException('non-nullable time_zone cannot be null'); + } + $this->container['time_zone'] = $time_zone; + + return $this; + } + + /** + * Gets verification_deadlines + * + * @return \Adyen\Model\BalancePlatform\VerificationDeadline[]|null + */ + public function getVerificationDeadlines() + { + return $this->container['verification_deadlines']; + } + + /** + * Sets verification_deadlines + * + * @param \Adyen\Model\BalancePlatform\VerificationDeadline[]|null $verification_deadlines List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. + * + * @return self + */ + public function setVerificationDeadlines($verification_deadlines) + { + if (is_null($verification_deadlines)) { + throw new \InvalidArgumentException('non-nullable verification_deadlines cannot be null'); + } + $this->container['verification_deadlines'] = $verification_deadlines; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php new file mode 100644 index 000000000..3d71d1a50 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php @@ -0,0 +1,804 @@ + + */ +class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderCapability'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'allowed_level' => 'string', + 'allowed_settings' => '\Adyen\Model\BalancePlatform\JSONObject', + 'enabled' => 'bool', + 'problems' => 'object[]', + 'requested' => 'bool', + 'requested_level' => 'string', + 'requested_settings' => '\Adyen\Model\BalancePlatform\JSONObject', + 'transfer_instruments' => '\Adyen\Model\BalancePlatform\AccountSupportingEntityCapability[]', + 'verification_status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed' => null, + 'allowed_level' => null, + 'allowed_settings' => null, + 'enabled' => null, + 'problems' => null, + 'requested' => null, + 'requested_level' => null, + 'requested_settings' => null, + 'transfer_instruments' => null, + 'verification_status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'allowed_level' => false, + 'allowed_settings' => false, + 'enabled' => false, + 'problems' => false, + 'requested' => false, + 'requested_level' => false, + 'requested_settings' => false, + 'transfer_instruments' => false, + 'verification_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed' => 'allowed', + 'allowed_level' => 'allowedLevel', + 'allowed_settings' => 'allowedSettings', + 'enabled' => 'enabled', + 'problems' => 'problems', + 'requested' => 'requested', + 'requested_level' => 'requestedLevel', + 'requested_settings' => 'requestedSettings', + 'transfer_instruments' => 'transferInstruments', + 'verification_status' => 'verificationStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed', + 'allowed_level' => 'setAllowedLevel', + 'allowed_settings' => 'setAllowedSettings', + 'enabled' => 'setEnabled', + 'problems' => 'setProblems', + 'requested' => 'setRequested', + 'requested_level' => 'setRequestedLevel', + 'requested_settings' => 'setRequestedSettings', + 'transfer_instruments' => 'setTransferInstruments', + 'verification_status' => 'setVerificationStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed', + 'allowed_level' => 'getAllowedLevel', + 'allowed_settings' => 'getAllowedSettings', + 'enabled' => 'getEnabled', + 'problems' => 'getProblems', + 'requested' => 'getRequested', + 'requested_level' => 'getRequestedLevel', + 'requested_settings' => 'getRequestedSettings', + 'transfer_instruments' => 'getTransferInstruments', + 'verification_status' => 'getVerificationStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ALLOWED_LEVEL_HIGH = 'high'; + public const ALLOWED_LEVEL_LOW = 'low'; + public const ALLOWED_LEVEL_MEDIUM = 'medium'; + public const ALLOWED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const REQUESTED_LEVEL_HIGH = 'high'; + public const REQUESTED_LEVEL_LOW = 'low'; + public const REQUESTED_LEVEL_MEDIUM = 'medium'; + public const REQUESTED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const VERIFICATION_STATUS_INVALID = 'invalid'; + public const VERIFICATION_STATUS_PENDING = 'pending'; + public const VERIFICATION_STATUS_REJECTED = 'rejected'; + public const VERIFICATION_STATUS_VALID = 'valid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAllowedLevelAllowableValues() + { + return [ + self::ALLOWED_LEVEL_HIGH, + self::ALLOWED_LEVEL_LOW, + self::ALLOWED_LEVEL_MEDIUM, + self::ALLOWED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequestedLevelAllowableValues() + { + return [ + self::REQUESTED_LEVEL_HIGH, + self::REQUESTED_LEVEL_LOW, + self::REQUESTED_LEVEL_MEDIUM, + self::REQUESTED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerificationStatusAllowableValues() + { + return [ + self::VERIFICATION_STATUS_INVALID, + self::VERIFICATION_STATUS_PENDING, + self::VERIFICATION_STATUS_REJECTED, + self::VERIFICATION_STATUS_VALID, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed', $data ?? [], null); + $this->setIfExists('allowed_level', $data ?? [], null); + $this->setIfExists('allowed_settings', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('problems', $data ?? [], null); + $this->setIfExists('requested', $data ?? [], null); + $this->setIfExists('requested_level', $data ?? [], null); + $this->setIfExists('requested_settings', $data ?? [], null); + $this->setIfExists('transfer_instruments', $data ?? [], null); + $this->setIfExists('verification_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAllowedLevelAllowableValues(); + if (!is_null($this->container['allowed_level']) && !in_array($this->container['allowed_level'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'allowed_level', must be one of '%s'", + $this->container['allowed_level'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!is_null($this->container['requested_level']) && !in_array($this->container['requested_level'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'requested_level', must be one of '%s'", + $this->container['requested_level'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!is_null($this->container['verification_status']) && !in_array($this->container['verification_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'verification_status', must be one of '%s'", + $this->container['verification_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed + * + * @return bool|null + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * + * @param bool|null $allowed Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + * + * @return self + */ + public function setAllowed($allowed) + { + if (is_null($allowed)) { + throw new \InvalidArgumentException('non-nullable allowed cannot be null'); + } + $this->container['allowed'] = $allowed; + + return $this; + } + + /** + * Gets allowed_level + * + * @return string|null + */ + public function getAllowedLevel() + { + return $this->container['allowed_level']; + } + + /** + * Sets allowed_level + * + * @param string|null $allowed_level The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setAllowedLevel($allowed_level) + { + if (is_null($allowed_level)) { + throw new \InvalidArgumentException('non-nullable allowed_level cannot be null'); + } + $allowedValues = $this->getAllowedLevelAllowableValues(); + if (!in_array($allowed_level, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'allowed_level', must be one of '%s'", + $allowed_level, + implode("', '", $allowedValues) + ) + ); + } + $this->container['allowed_level'] = $allowed_level; + + return $this; + } + + /** + * Gets allowed_settings + * + * @return \Adyen\Model\BalancePlatform\JSONObject|null + */ + public function getAllowedSettings() + { + return $this->container['allowed_settings']; + } + + /** + * Sets allowed_settings + * + * @param \Adyen\Model\BalancePlatform\JSONObject|null $allowed_settings allowed_settings + * + * @return self + */ + public function setAllowedSettings($allowed_settings) + { + if (is_null($allowed_settings)) { + throw new \InvalidArgumentException('non-nullable allowed_settings cannot be null'); + } + $this->container['allowed_settings'] = $allowed_settings; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets problems + * + * @return object[]|null + */ + public function getProblems() + { + return $this->container['problems']; + } + + /** + * Sets problems + * + * @param object[]|null $problems Contains verification errors and the actions that you can take to resolve them. + * + * @return self + */ + public function setProblems($problems) + { + if (is_null($problems)) { + throw new \InvalidArgumentException('non-nullable problems cannot be null'); + } + $this->container['problems'] = $problems; + + return $this; + } + + /** + * Gets requested + * + * @return bool|null + */ + public function getRequested() + { + return $this->container['requested']; + } + + /** + * Sets requested + * + * @param bool|null $requested Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + * + * @return self + */ + public function setRequested($requested) + { + if (is_null($requested)) { + throw new \InvalidArgumentException('non-nullable requested cannot be null'); + } + $this->container['requested'] = $requested; + + return $this; + } + + /** + * Gets requested_level + * + * @return string|null + */ + public function getRequestedLevel() + { + return $this->container['requested_level']; + } + + /** + * Sets requested_level + * + * @param string|null $requested_level The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setRequestedLevel($requested_level) + { + if (is_null($requested_level)) { + throw new \InvalidArgumentException('non-nullable requested_level cannot be null'); + } + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!in_array($requested_level, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'requested_level', must be one of '%s'", + $requested_level, + implode("', '", $allowedValues) + ) + ); + } + $this->container['requested_level'] = $requested_level; + + return $this; + } + + /** + * Gets requested_settings + * + * @return \Adyen\Model\BalancePlatform\JSONObject|null + */ + public function getRequestedSettings() + { + return $this->container['requested_settings']; + } + + /** + * Sets requested_settings + * + * @param \Adyen\Model\BalancePlatform\JSONObject|null $requested_settings requested_settings + * + * @return self + */ + public function setRequestedSettings($requested_settings) + { + if (is_null($requested_settings)) { + throw new \InvalidArgumentException('non-nullable requested_settings cannot be null'); + } + $this->container['requested_settings'] = $requested_settings; + + return $this; + } + + /** + * Gets transfer_instruments + * + * @return \Adyen\Model\BalancePlatform\AccountSupportingEntityCapability[]|null + */ + public function getTransferInstruments() + { + return $this->container['transfer_instruments']; + } + + /** + * Sets transfer_instruments + * + * @param \Adyen\Model\BalancePlatform\AccountSupportingEntityCapability[]|null $transfer_instruments Contains the status of the transfer instruments associated with this capability. + * + * @return self + */ + public function setTransferInstruments($transfer_instruments) + { + if (is_null($transfer_instruments)) { + throw new \InvalidArgumentException('non-nullable transfer_instruments cannot be null'); + } + $this->container['transfer_instruments'] = $transfer_instruments; + + return $this; + } + + /** + * Gets verification_status + * + * @return string|null + */ + public function getVerificationStatus() + { + return $this->container['verification_status']; + } + + /** + * Sets verification_status + * + * @param string|null $verification_status The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + * + * @return self + */ + public function setVerificationStatus($verification_status) + { + if (is_null($verification_status)) { + throw new \InvalidArgumentException('non-nullable verification_status cannot be null'); + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!in_array($verification_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'verification_status', must be one of '%s'", + $verification_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['verification_status'] = $verification_status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php new file mode 100644 index 000000000..193594ffa --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -0,0 +1,594 @@ + + */ +class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_platform' => 'string', + 'capabilities' => 'array', + 'contact_details' => '\Adyen\Model\BalancePlatform\ContactDetails', + 'description' => 'string', + 'legal_entity_id' => 'string', + 'reference' => 'string', + 'time_zone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_platform' => null, + 'capabilities' => null, + 'contact_details' => null, + 'description' => null, + 'legal_entity_id' => null, + 'reference' => null, + 'time_zone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_platform' => false, + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'legal_entity_id' => false, + 'reference' => false, + 'time_zone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_platform' => 'balancePlatform', + 'capabilities' => 'capabilities', + 'contact_details' => 'contactDetails', + 'description' => 'description', + 'legal_entity_id' => 'legalEntityId', + 'reference' => 'reference', + 'time_zone' => 'timeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_platform' => 'setBalancePlatform', + 'capabilities' => 'setCapabilities', + 'contact_details' => 'setContactDetails', + 'description' => 'setDescription', + 'legal_entity_id' => 'setLegalEntityId', + 'reference' => 'setReference', + 'time_zone' => 'setTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_platform' => 'getBalancePlatform', + 'capabilities' => 'getCapabilities', + 'contact_details' => 'getContactDetails', + 'description' => 'getDescription', + 'legal_entity_id' => 'getLegalEntityId', + 'reference' => 'getReference', + 'time_zone' => 'getTimeZone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_platform', $data ?? [], null); + $this->setIfExists('capabilities', $data ?? [], null); + $this->setIfExists('contact_details', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('legal_entity_id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['legal_entity_id'] === null) { + $invalidProperties[] = "'legal_entity_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance_platform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balance_platform']; + } + + /** + * Sets balance_platform + * + * @param string|null $balance_platform The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + * + * @return self + */ + public function setBalancePlatform($balance_platform) + { + if (is_null($balance_platform)) { + throw new \InvalidArgumentException('non-nullable balance_platform cannot be null'); + } + $this->container['balance_platform'] = $balance_platform; + + return $this; + } + + /** + * Gets capabilities + * + * @return array|null + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param array|null $capabilities Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + * + * @return self + */ + public function setCapabilities($capabilities) + { + if (is_null($capabilities)) { + throw new \InvalidArgumentException('non-nullable capabilities cannot be null'); + } + $this->container['capabilities'] = $capabilities; + + return $this; + } + + /** + * Gets contact_details + * + * @return \Adyen\Model\BalancePlatform\ContactDetails|null + */ + public function getContactDetails() + { + return $this->container['contact_details']; + } + + /** + * Sets contact_details + * + * @param \Adyen\Model\BalancePlatform\ContactDetails|null $contact_details contact_details + * + * @return self + */ + public function setContactDetails($contact_details) + { + if (is_null($contact_details)) { + throw new \InvalidArgumentException('non-nullable contact_details cannot be null'); + } + $this->container['contact_details'] = $contact_details; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the account holder, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets legal_entity_id + * + * @return string + */ + public function getLegalEntityId() + { + return $this->container['legal_entity_id']; + } + + /** + * Sets legal_entity_id + * + * @param string $legal_entity_id The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. + * + * @return self + */ + public function setLegalEntityId($legal_entity_id) + { + if (is_null($legal_entity_id)) { + throw new \InvalidArgumentException('non-nullable legal_entity_id cannot be null'); + } + $this->container['legal_entity_id'] = $legal_entity_id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the account holder, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets time_zone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string|null $time_zone The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($time_zone) + { + if (is_null($time_zone)) { + throw new \InvalidArgumentException('non-nullable time_zone cannot be null'); + } + $this->container['time_zone'] = $time_zone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php new file mode 100644 index 000000000..48d14a6cc --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php @@ -0,0 +1,702 @@ + + */ +class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountSupportingEntityCapability'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'allowed_level' => 'string', + 'enabled' => 'bool', + 'id' => 'string', + 'requested' => 'bool', + 'requested_level' => 'string', + 'verification_status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed' => null, + 'allowed_level' => null, + 'enabled' => null, + 'id' => null, + 'requested' => null, + 'requested_level' => null, + 'verification_status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'allowed_level' => false, + 'enabled' => false, + 'id' => false, + 'requested' => false, + 'requested_level' => false, + 'verification_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed' => 'allowed', + 'allowed_level' => 'allowedLevel', + 'enabled' => 'enabled', + 'id' => 'id', + 'requested' => 'requested', + 'requested_level' => 'requestedLevel', + 'verification_status' => 'verificationStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed', + 'allowed_level' => 'setAllowedLevel', + 'enabled' => 'setEnabled', + 'id' => 'setId', + 'requested' => 'setRequested', + 'requested_level' => 'setRequestedLevel', + 'verification_status' => 'setVerificationStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed', + 'allowed_level' => 'getAllowedLevel', + 'enabled' => 'getEnabled', + 'id' => 'getId', + 'requested' => 'getRequested', + 'requested_level' => 'getRequestedLevel', + 'verification_status' => 'getVerificationStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ALLOWED_LEVEL_HIGH = 'high'; + public const ALLOWED_LEVEL_LOW = 'low'; + public const ALLOWED_LEVEL_MEDIUM = 'medium'; + public const ALLOWED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const REQUESTED_LEVEL_HIGH = 'high'; + public const REQUESTED_LEVEL_LOW = 'low'; + public const REQUESTED_LEVEL_MEDIUM = 'medium'; + public const REQUESTED_LEVEL_NOT_APPLICABLE = 'notApplicable'; + public const VERIFICATION_STATUS_INVALID = 'invalid'; + public const VERIFICATION_STATUS_PENDING = 'pending'; + public const VERIFICATION_STATUS_REJECTED = 'rejected'; + public const VERIFICATION_STATUS_VALID = 'valid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAllowedLevelAllowableValues() + { + return [ + self::ALLOWED_LEVEL_HIGH, + self::ALLOWED_LEVEL_LOW, + self::ALLOWED_LEVEL_MEDIUM, + self::ALLOWED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequestedLevelAllowableValues() + { + return [ + self::REQUESTED_LEVEL_HIGH, + self::REQUESTED_LEVEL_LOW, + self::REQUESTED_LEVEL_MEDIUM, + self::REQUESTED_LEVEL_NOT_APPLICABLE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerificationStatusAllowableValues() + { + return [ + self::VERIFICATION_STATUS_INVALID, + self::VERIFICATION_STATUS_PENDING, + self::VERIFICATION_STATUS_REJECTED, + self::VERIFICATION_STATUS_VALID, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed', $data ?? [], null); + $this->setIfExists('allowed_level', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('requested', $data ?? [], null); + $this->setIfExists('requested_level', $data ?? [], null); + $this->setIfExists('verification_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAllowedLevelAllowableValues(); + if (!is_null($this->container['allowed_level']) && !in_array($this->container['allowed_level'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'allowed_level', must be one of '%s'", + $this->container['allowed_level'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!is_null($this->container['requested_level']) && !in_array($this->container['requested_level'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'requested_level', must be one of '%s'", + $this->container['requested_level'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!is_null($this->container['verification_status']) && !in_array($this->container['verification_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'verification_status', must be one of '%s'", + $this->container['verification_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed + * + * @return bool|null + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * + * @param bool|null $allowed Indicates whether the supporting entity capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + * + * @return self + */ + public function setAllowed($allowed) + { + if (is_null($allowed)) { + throw new \InvalidArgumentException('non-nullable allowed cannot be null'); + } + $this->container['allowed'] = $allowed; + + return $this; + } + + /** + * Gets allowed_level + * + * @return string|null + */ + public function getAllowedLevel() + { + return $this->container['allowed_level']; + } + + /** + * Sets allowed_level + * + * @param string|null $allowed_level The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setAllowedLevel($allowed_level) + { + if (is_null($allowed_level)) { + throw new \InvalidArgumentException('non-nullable allowed_level cannot be null'); + } + $allowedValues = $this->getAllowedLevelAllowableValues(); + if (!in_array($allowed_level, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'allowed_level', must be one of '%s'", + $allowed_level, + implode("', '", $allowedValues) + ) + ); + } + $this->container['allowed_level'] = $allowed_level; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the supporting entity. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets requested + * + * @return bool|null + */ + public function getRequested() + { + return $this->container['requested']; + } + + /** + * Sets requested + * + * @param bool|null $requested Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + * + * @return self + */ + public function setRequested($requested) + { + if (is_null($requested)) { + throw new \InvalidArgumentException('non-nullable requested cannot be null'); + } + $this->container['requested'] = $requested; + + return $this; + } + + /** + * Gets requested_level + * + * @return string|null + */ + public function getRequestedLevel() + { + return $this->container['requested_level']; + } + + /** + * Sets requested_level + * + * @param string|null $requested_level The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + * + * @return self + */ + public function setRequestedLevel($requested_level) + { + if (is_null($requested_level)) { + throw new \InvalidArgumentException('non-nullable requested_level cannot be null'); + } + $allowedValues = $this->getRequestedLevelAllowableValues(); + if (!in_array($requested_level, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'requested_level', must be one of '%s'", + $requested_level, + implode("', '", $allowedValues) + ) + ); + } + $this->container['requested_level'] = $requested_level; + + return $this; + } + + /** + * Gets verification_status + * + * @return string|null + */ + public function getVerificationStatus() + { + return $this->container['verification_status']; + } + + /** + * Sets verification_status + * + * @param string|null $verification_status The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + * + * @return self + */ + public function setVerificationStatus($verification_status) + { + if (is_null($verification_status)) { + throw new \InvalidArgumentException('non-nullable verification_status cannot be null'); + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!in_array($verification_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'verification_status', must be one of '%s'", + $verification_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['verification_status'] = $verification_status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php new file mode 100644 index 000000000..efa8cf26b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php @@ -0,0 +1,422 @@ + + */ +class ActiveNetworkTokensRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ActiveNetworkTokensRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The number of tokens. + * + * @return self + */ + public function setValue($value) + { + // Do nothing for nullable integers + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php new file mode 100644 index 000000000..7ccc21434 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php @@ -0,0 +1,454 @@ + + */ +class AdditionalBankIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalBankIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'code' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GB_SORT_CODE = 'gbSortCode'; + public const TYPE_US_ROUTING_NUMBER = 'usRoutingNumber'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GB_SORT_CODE, + self::TYPE_US_ROUTING_NUMBER, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The value of the additional bank identification. + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Address.php b/src/Adyen/Model/BalancePlatform/Address.php new file mode 100644 index 000000000..94ec71f14 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Address.php @@ -0,0 +1,572 @@ + + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'house_number_or_name' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'house_number_or_name' => null, + 'postal_code' => null, + 'state_or_province' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'house_number_or_name' => 'houseNumberOrName', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'house_number_or_name' => 'setHouseNumberOrName', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'house_number_or_name' => 'getHouseNumberOrName', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('house_number_or_name', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ($this->container['house_number_or_name'] === null) { + $invalidProperties[] = "'house_number_or_name' can't be null"; + } + if ($this->container['postal_code'] === null) { + $invalidProperties[] = "'postal_code' can't be null"; + } + if ($this->container['street'] === null) { + $invalidProperties[] = "'street' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The name of the city. Maximum length: 3000 characters. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets house_number_or_name + * + * @return string + */ + public function getHouseNumberOrName() + { + return $this->container['house_number_or_name']; + } + + /** + * Sets house_number_or_name + * + * @param string $house_number_or_name The number or name of the house. Maximum length: 3000 characters. + * + * @return self + */ + public function setHouseNumberOrName($house_number_or_name) + { + if (is_null($house_number_or_name)) { + throw new \InvalidArgumentException('non-nullable house_number_or_name cannot be null'); + } + $this->container['house_number_or_name'] = $house_number_or_name; + + return $this; + } + + /** + * Gets postal_code + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string $postal_code A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Address2.php b/src/Adyen/Model/BalancePlatform/Address2.php new file mode 100644 index 000000000..7d6648f03 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Address2.php @@ -0,0 +1,594 @@ + + */ +class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address-2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'line3' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'line1' => null, + 'line2' => null, + 'line3' => null, + 'postal_code' => null, + 'state_or_province' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'line1' => 'line1', + 'line2' => 'line2', + 'line3' => 'line3', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'line3' => 'setLine3', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'line3' => 'getLine3', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('line3', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 First line of the address. + * + * @return self + */ + public function setLine1($line1) + { + if (is_null($line1)) { + throw new \InvalidArgumentException('non-nullable line1 cannot be null'); + } + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 Second line of the address. + * + * @return self + */ + public function setLine2($line2) + { + if (is_null($line2)) { + throw new \InvalidArgumentException('non-nullable line2 cannot be null'); + } + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets line3 + * + * @return string|null + */ + public function getLine3() + { + return $this->container['line3']; + } + + /** + * Sets line3 + * + * @param string|null $line3 Third line of the address. + * + * @return self + */ + public function setLine3($line3) + { + if (is_null($line3)) { + throw new \InvalidArgumentException('non-nullable line3 cannot be null'); + } + $this->container['line3'] = $line3; + + 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. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The two-letterISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php new file mode 100644 index 000000000..5bf62d874 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -0,0 +1,427 @@ + + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Authentication.php b/src/Adyen/Model/BalancePlatform/Authentication.php new file mode 100644 index 000000000..5c7fdbb4f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Authentication.php @@ -0,0 +1,455 @@ + + */ +class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Authentication'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'email' => 'string', + 'password' => 'string', + 'phone' => '\Adyen\Model\BalancePlatform\Phone' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email' => null, + 'password' => null, + 'phone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'email' => false, + 'password' => false, + 'phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'password' => 'password', + 'phone' => 'phone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'password' => 'setPassword', + 'phone' => 'setPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'password' => 'getPassword', + 'phone' => 'getPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address where the one-time password (OTP) is sent. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets phone + * + * @return \Adyen\Model\BalancePlatform\Phone|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Adyen\Model\BalancePlatform\Phone|null $phone phone + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php new file mode 100644 index 000000000..8ad88e526 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -0,0 +1,501 @@ + + */ +class Balance implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Balance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'available' => 'int', + 'balance' => 'int', + 'currency' => 'string', + 'reserved' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'available' => 'int64', + 'balance' => 'int64', + 'currency' => null, + 'reserved' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'available' => false, + 'balance' => false, + 'currency' => false, + 'reserved' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'available' => 'available', + 'balance' => 'balance', + 'currency' => 'currency', + 'reserved' => 'reserved' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'available' => 'setAvailable', + 'balance' => 'setBalance', + 'currency' => 'setCurrency', + 'reserved' => 'setReserved' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'available' => 'getAvailable', + 'balance' => 'getBalance', + 'currency' => 'getCurrency', + 'reserved' => 'getReserved' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('available', $data ?? [], null); + $this->setIfExists('balance', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('reserved', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['available'] === null) { + $invalidProperties[] = "'available' can't be null"; + } + if ($this->container['balance'] === null) { + $invalidProperties[] = "'balance' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['reserved'] === null) { + $invalidProperties[] = "'reserved' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets available + * + * @return int + */ + public function getAvailable() + { + return $this->container['available']; + } + + /** + * Sets available + * + * @param int $available The remaining amount available for spending. + * + * @return self + */ + public function setAvailable($available) + { + if (is_null($available)) { + throw new \InvalidArgumentException('non-nullable available cannot be null'); + } + $this->container['available'] = $available; + + return $this; + } + + /** + * Gets balance + * + * @return int + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param int $balance The total amount in the balance. + * + * @return self + */ + public function setBalance($balance) + { + if (is_null($balance)) { + throw new \InvalidArgumentException('non-nullable balance cannot be null'); + } + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets reserved + * + * @return int + */ + public function getReserved() + { + return $this->container['reserved']; + } + + /** + * Sets reserved + * + * @param int $reserved The amount reserved for payments that have been authorised, but have not been captured yet. + * + * @return self + */ + public function setReserved($reserved) + { + if (is_null($reserved)) { + throw new \InvalidArgumentException('non-nullable reserved cannot be null'); + } + $this->container['reserved'] = $reserved; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php new file mode 100644 index 000000000..537594491 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -0,0 +1,668 @@ + + */ +class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_holder_id' => 'string', + 'balances' => '\Adyen\Model\BalancePlatform\Balance[]', + 'default_currency_code' => 'string', + 'description' => 'string', + 'id' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'time_zone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_holder_id' => null, + 'balances' => null, + 'default_currency_code' => null, + 'description' => null, + 'id' => null, + 'reference' => null, + 'status' => null, + 'time_zone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_holder_id' => false, + 'balances' => false, + 'default_currency_code' => false, + 'description' => false, + 'id' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_holder_id' => 'accountHolderId', + 'balances' => 'balances', + 'default_currency_code' => 'defaultCurrencyCode', + 'description' => 'description', + 'id' => 'id', + 'reference' => 'reference', + 'status' => 'status', + 'time_zone' => 'timeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_holder_id' => 'setAccountHolderId', + 'balances' => 'setBalances', + 'default_currency_code' => 'setDefaultCurrencyCode', + 'description' => 'setDescription', + 'id' => 'setId', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'time_zone' => 'setTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_holder_id' => 'getAccountHolderId', + 'balances' => 'getBalances', + 'default_currency_code' => 'getDefaultCurrencyCode', + 'description' => 'getDescription', + 'id' => 'getId', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'time_zone' => 'getTimeZone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_holder_id', $data ?? [], null); + $this->setIfExists('balances', $data ?? [], null); + $this->setIfExists('default_currency_code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_holder_id'] === null) { + $invalidProperties[] = "'account_holder_id' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_holder_id + * + * @return string + */ + public function getAccountHolderId() + { + return $this->container['account_holder_id']; + } + + /** + * Sets account_holder_id + * + * @param string $account_holder_id The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + * + * @return self + */ + public function setAccountHolderId($account_holder_id) + { + if (is_null($account_holder_id)) { + throw new \InvalidArgumentException('non-nullable account_holder_id cannot be null'); + } + $this->container['account_holder_id'] = $account_holder_id; + + return $this; + } + + /** + * Gets balances + * + * @return \Adyen\Model\BalancePlatform\Balance[]|null + */ + public function getBalances() + { + return $this->container['balances']; + } + + /** + * Sets balances + * + * @param \Adyen\Model\BalancePlatform\Balance[]|null $balances List of balances with the amount and currency. + * + * @return self + */ + public function setBalances($balances) + { + if (is_null($balances)) { + throw new \InvalidArgumentException('non-nullable balances cannot be null'); + } + $this->container['balances'] = $balances; + + return $this; + } + + /** + * Gets default_currency_code + * + * @return string|null + */ + public function getDefaultCurrencyCode() + { + return $this->container['default_currency_code']; + } + + /** + * Sets default_currency_code + * + * @param string|null $default_currency_code The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + * + * @return self + */ + public function setDefaultCurrencyCode($default_currency_code) + { + if (is_null($default_currency_code)) { + throw new \InvalidArgumentException('non-nullable default_currency_code cannot be null'); + } + $this->container['default_currency_code'] = $default_currency_code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the balance account. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the balance account, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the balance account, set to **active** by default. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets time_zone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string|null $time_zone The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($time_zone) + { + if (is_null($time_zone)) { + throw new \InvalidArgumentException('non-nullable time_zone cannot be null'); + } + $this->container['time_zone'] = $time_zone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php new file mode 100644 index 000000000..5692fa378 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -0,0 +1,526 @@ + + */ +class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_holder_id' => 'string', + 'default_currency_code' => 'string', + 'description' => 'string', + 'reference' => 'string', + 'time_zone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_holder_id' => null, + 'default_currency_code' => null, + 'description' => null, + 'reference' => null, + 'time_zone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_holder_id' => false, + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'time_zone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_holder_id' => 'accountHolderId', + 'default_currency_code' => 'defaultCurrencyCode', + 'description' => 'description', + 'reference' => 'reference', + 'time_zone' => 'timeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_holder_id' => 'setAccountHolderId', + 'default_currency_code' => 'setDefaultCurrencyCode', + 'description' => 'setDescription', + 'reference' => 'setReference', + 'time_zone' => 'setTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_holder_id' => 'getAccountHolderId', + 'default_currency_code' => 'getDefaultCurrencyCode', + 'description' => 'getDescription', + 'reference' => 'getReference', + 'time_zone' => 'getTimeZone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_holder_id', $data ?? [], null); + $this->setIfExists('default_currency_code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_holder_id'] === null) { + $invalidProperties[] = "'account_holder_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_holder_id + * + * @return string + */ + public function getAccountHolderId() + { + return $this->container['account_holder_id']; + } + + /** + * Sets account_holder_id + * + * @param string $account_holder_id The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + * + * @return self + */ + public function setAccountHolderId($account_holder_id) + { + if (is_null($account_holder_id)) { + throw new \InvalidArgumentException('non-nullable account_holder_id cannot be null'); + } + $this->container['account_holder_id'] = $account_holder_id; + + return $this; + } + + /** + * Gets default_currency_code + * + * @return string|null + */ + public function getDefaultCurrencyCode() + { + return $this->container['default_currency_code']; + } + + /** + * Sets default_currency_code + * + * @param string|null $default_currency_code The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + * + * @return self + */ + public function setDefaultCurrencyCode($default_currency_code) + { + if (is_null($default_currency_code)) { + throw new \InvalidArgumentException('non-nullable default_currency_code cannot be null'); + } + $this->container['default_currency_code'] = $default_currency_code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the balance account, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets time_zone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string|null $time_zone The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($time_zone) + { + if (is_null($time_zone)) { + throw new \InvalidArgumentException('non-nullable time_zone cannot be null'); + } + $this->container['time_zone'] = $time_zone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php new file mode 100644 index 000000000..03c75d32d --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -0,0 +1,594 @@ + + */ +class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_holder_id' => 'string', + 'default_currency_code' => 'string', + 'description' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'time_zone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_holder_id' => null, + 'default_currency_code' => null, + 'description' => null, + 'reference' => null, + 'status' => null, + 'time_zone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_holder_id' => false, + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_holder_id' => 'accountHolderId', + 'default_currency_code' => 'defaultCurrencyCode', + 'description' => 'description', + 'reference' => 'reference', + 'status' => 'status', + 'time_zone' => 'timeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_holder_id' => 'setAccountHolderId', + 'default_currency_code' => 'setDefaultCurrencyCode', + 'description' => 'setDescription', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'time_zone' => 'setTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_holder_id' => 'getAccountHolderId', + 'default_currency_code' => 'getDefaultCurrencyCode', + 'description' => 'getDescription', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'time_zone' => 'getTimeZone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_holder_id', $data ?? [], null); + $this->setIfExists('default_currency_code', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_holder_id + * + * @return string|null + */ + public function getAccountHolderId() + { + return $this->container['account_holder_id']; + } + + /** + * Sets account_holder_id + * + * @param string|null $account_holder_id The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + * + * @return self + */ + public function setAccountHolderId($account_holder_id) + { + if (is_null($account_holder_id)) { + throw new \InvalidArgumentException('non-nullable account_holder_id cannot be null'); + } + $this->container['account_holder_id'] = $account_holder_id; + + return $this; + } + + /** + * Gets default_currency_code + * + * @return string|null + */ + public function getDefaultCurrencyCode() + { + return $this->container['default_currency_code']; + } + + /** + * Sets default_currency_code + * + * @param string|null $default_currency_code The default currency code of this balance account, in three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) format. The default value is **EUR**. + * + * @return self + */ + public function setDefaultCurrencyCode($default_currency_code) + { + if (is_null($default_currency_code)) { + throw new \InvalidArgumentException('non-nullable default_currency_code cannot be null'); + } + $this->container['default_currency_code'] = $default_currency_code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference to the balance account, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the balance account. Payment instruments linked to the balance account can only be used if the balance account status is **active**. Possible values: **active**, **inactive**, **closed**, **suspended**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets time_zone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string|null $time_zone The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * + * @return self + */ + public function setTimeZone($time_zone) + { + if (is_null($time_zone)) { + throw new \InvalidArgumentException('non-nullable time_zone cannot be null'); + } + $this->container['time_zone'] = $time_zone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatform.php b/src/Adyen/Model/BalancePlatform/BalancePlatform.php new file mode 100644 index 000000000..fe53ad778 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalancePlatform.php @@ -0,0 +1,458 @@ + + */ +class BalancePlatform implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalancePlatform'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description of the balance platform, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the balance platform. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the balance platform. Possible values: **Active**, **Inactive**, **Closed**, **Suspended**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php new file mode 100644 index 000000000..ee1614c42 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php @@ -0,0 +1,464 @@ + + */ +class BalanceSweepConfigurationsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceSweepConfigurationsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'has_next' => 'bool', + 'has_previous' => 'bool', + 'sweeps' => '\Adyen\Model\BalancePlatform\SweepConfigurationV2[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'has_next' => null, + 'has_previous' => null, + 'sweeps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'has_next' => false, + 'has_previous' => false, + 'sweeps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'has_next' => 'hasNext', + 'has_previous' => 'hasPrevious', + 'sweeps' => 'sweeps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'has_next' => 'setHasNext', + 'has_previous' => 'setHasPrevious', + 'sweeps' => 'setSweeps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'has_next' => 'getHasNext', + 'has_previous' => 'getHasPrevious', + 'sweeps' => 'getSweeps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('has_next', $data ?? [], null); + $this->setIfExists('has_previous', $data ?? [], null); + $this->setIfExists('sweeps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['has_next'] === null) { + $invalidProperties[] = "'has_next' can't be null"; + } + if ($this->container['has_previous'] === null) { + $invalidProperties[] = "'has_previous' can't be null"; + } + if ($this->container['sweeps'] === null) { + $invalidProperties[] = "'sweeps' 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 has_next + * + * @return bool + */ + public function getHasNext() + { + return $this->container['has_next']; + } + + /** + * Sets has_next + * + * @param bool $has_next Indicates whether there are more items on the next page. + * + * @return self + */ + public function setHasNext($has_next) + { + if (is_null($has_next)) { + throw new \InvalidArgumentException('non-nullable has_next cannot be null'); + } + $this->container['has_next'] = $has_next; + + return $this; + } + + /** + * Gets has_previous + * + * @return bool + */ + public function getHasPrevious() + { + return $this->container['has_previous']; + } + + /** + * Sets has_previous + * + * @param bool $has_previous Indicates whether there are more items on the previous page. + * + * @return self + */ + public function setHasPrevious($has_previous) + { + if (is_null($has_previous)) { + throw new \InvalidArgumentException('non-nullable has_previous cannot be null'); + } + $this->container['has_previous'] = $has_previous; + + return $this; + } + + /** + * Gets sweeps + * + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2[] + */ + public function getSweeps() + { + return $this->container['sweeps']; + } + + /** + * Sets sweeps + * + * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2[] $sweeps List of sweeps associated with the balance account. + * + * @return self + */ + public function setSweeps($sweeps) + { + if (is_null($sweeps)) { + throw new \InvalidArgumentException('non-nullable sweeps cannot be null'); + } + $this->container['sweeps'] = $sweeps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php new file mode 100644 index 000000000..53542da7c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php @@ -0,0 +1,390 @@ + + */ +class BankAccountIdentificationValidationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountIdentificationValidationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_identification' => '\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequestAccountIdentification' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_identification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_identification' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_identification' => 'accountIdentification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_identification' => 'setAccountIdentification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_identification' => 'getAccountIdentification' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_identification', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_identification'] === null) { + $invalidProperties[] = "'account_identification' 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 account_identification + * + * @return \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequestAccountIdentification + */ + public function getAccountIdentification() + { + return $this->container['account_identification']; + } + + /** + * Sets account_identification + * + * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequestAccountIdentification $account_identification account_identification + * + * @return self + */ + public function setAccountIdentification($account_identification) + { + if (is_null($account_identification)) { + throw new \InvalidArgumentException('non-nullable account_identification cannot be null'); + } + $this->container['account_identification'] = $account_identification; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php new file mode 100644 index 000000000..319aa44b3 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -0,0 +1,830 @@ + + */ +class BankAccountIdentificationValidationRequestAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountIdentificationValidationRequest_accountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'bsb_code' => 'string', + 'type' => 'string', + 'account_type' => 'string', + 'institution_number' => 'string', + 'transit_number' => 'string', + 'bank_code' => 'string', + 'iban' => 'string', + 'additional_bank_identification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', + 'bic' => 'string', + 'clearing_number' => 'string', + 'sort_code' => 'string', + 'routing_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'bsb_code' => null, + 'type' => null, + 'account_type' => null, + 'institution_number' => null, + 'transit_number' => null, + 'bank_code' => null, + 'iban' => null, + 'additional_bank_identification' => null, + 'bic' => null, + 'clearing_number' => null, + 'sort_code' => null, + 'routing_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'bsb_code' => false, + 'type' => false, + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'bank_code' => false, + 'iban' => false, + 'additional_bank_identification' => false, + 'bic' => false, + 'clearing_number' => false, + 'sort_code' => false, + 'routing_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'bsb_code' => 'bsbCode', + 'type' => 'type', + 'account_type' => 'accountType', + 'institution_number' => 'institutionNumber', + 'transit_number' => 'transitNumber', + 'bank_code' => 'bankCode', + 'iban' => 'iban', + 'additional_bank_identification' => 'additionalBankIdentification', + 'bic' => 'bic', + 'clearing_number' => 'clearingNumber', + 'sort_code' => 'sortCode', + 'routing_number' => 'routingNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'bsb_code' => 'setBsbCode', + 'type' => 'setType', + 'account_type' => 'setAccountType', + 'institution_number' => 'setInstitutionNumber', + 'transit_number' => 'setTransitNumber', + 'bank_code' => 'setBankCode', + 'iban' => 'setIban', + 'additional_bank_identification' => 'setAdditionalBankIdentification', + 'bic' => 'setBic', + 'clearing_number' => 'setClearingNumber', + 'sort_code' => 'setSortCode', + 'routing_number' => 'setRoutingNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'bsb_code' => 'getBsbCode', + 'type' => 'getType', + 'account_type' => 'getAccountType', + 'institution_number' => 'getInstitutionNumber', + 'transit_number' => 'getTransitNumber', + 'bank_code' => 'getBankCode', + 'iban' => 'getIban', + 'additional_bank_identification' => 'getAdditionalBankIdentification', + 'bic' => 'getBic', + 'clearing_number' => 'getClearingNumber', + 'sort_code' => 'getSortCode', + 'routing_number' => 'getRoutingNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('bsb_code', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + $this->setIfExists('account_type', $data ?? [], 'checking'); + $this->setIfExists('institution_number', $data ?? [], null); + $this->setIfExists('transit_number', $data ?? [], null); + $this->setIfExists('bank_code', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('additional_bank_identification', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('clearing_number', $data ?? [], null); + $this->setIfExists('sort_code', $data ?? [], null); + $this->setIfExists('routing_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['bsb_code'] === null) { + $invalidProperties[] = "'bsb_code' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + + if ($this->container['institution_number'] === null) { + $invalidProperties[] = "'institution_number' can't be null"; + } + if ($this->container['transit_number'] === null) { + $invalidProperties[] = "'transit_number' can't be null"; + } + if ($this->container['bank_code'] === null) { + $invalidProperties[] = "'bank_code' can't be null"; + } + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' can't be null"; + } + if ($this->container['clearing_number'] === null) { + $invalidProperties[] = "'clearing_number' can't be null"; + } + if ($this->container['sort_code'] === null) { + $invalidProperties[] = "'sort_code' can't be null"; + } + if ($this->container['routing_number'] === null) { + $invalidProperties[] = "'routing_number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets bsb_code + * + * @return string + */ + public function getBsbCode() + { + return $this->container['bsb_code']; + } + + /** + * Sets bsb_code + * + * @param string $bsb_code The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * + * @return self + */ + public function setBsbCode($bsb_code) + { + if (is_null($bsb_code)) { + throw new \InvalidArgumentException('non-nullable bsb_code cannot be null'); + } + $this->container['bsb_code'] = $bsb_code; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets institution_number + * + * @return string + */ + public function getInstitutionNumber() + { + return $this->container['institution_number']; + } + + /** + * Sets institution_number + * + * @param string $institution_number The 3-digit institution number, without separators or whitespace. + * + * @return self + */ + public function setInstitutionNumber($institution_number) + { + if (is_null($institution_number)) { + throw new \InvalidArgumentException('non-nullable institution_number cannot be null'); + } + $this->container['institution_number'] = $institution_number; + + return $this; + } + + /** + * Gets transit_number + * + * @return string + */ + public function getTransitNumber() + { + return $this->container['transit_number']; + } + + /** + * Sets transit_number + * + * @param string $transit_number The 5-digit transit number, without separators or whitespace. + * + * @return self + */ + public function setTransitNumber($transit_number) + { + if (is_null($transit_number)) { + throw new \InvalidArgumentException('non-nullable transit_number cannot be null'); + } + $this->container['transit_number'] = $transit_number; + + return $this; + } + + /** + * Gets bank_code + * + * @return string + */ + public function getBankCode() + { + return $this->container['bank_code']; + } + + /** + * Sets bank_code + * + * @param string $bank_code The 4-digit bank code (Kód banky), without separators or whitespace. + * + * @return self + */ + public function setBankCode($bank_code) + { + if (is_null($bank_code)) { + throw new \InvalidArgumentException('non-nullable bank_code cannot be null'); + } + $this->container['bank_code'] = $bank_code; + + return $this; + } + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets additional_bank_identification + * + * @return \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null + */ + public function getAdditionalBankIdentification() + { + return $this->container['additional_bank_identification']; + } + + /** + * Sets additional_bank_identification + * + * @param \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null $additional_bank_identification additional_bank_identification + * + * @return self + */ + public function setAdditionalBankIdentification($additional_bank_identification) + { + if (is_null($additional_bank_identification)) { + throw new \InvalidArgumentException('non-nullable additional_bank_identification cannot be null'); + } + $this->container['additional_bank_identification'] = $additional_bank_identification; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets clearing_number + * + * @return string + */ + public function getClearingNumber() + { + return $this->container['clearing_number']; + } + + /** + * Sets clearing_number + * + * @param string $clearing_number The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + * + * @return self + */ + public function setClearingNumber($clearing_number) + { + if (is_null($clearing_number)) { + throw new \InvalidArgumentException('non-nullable clearing_number cannot be null'); + } + $this->container['clearing_number'] = $clearing_number; + + return $this; + } + + /** + * Gets sort_code + * + * @return string + */ + public function getSortCode() + { + return $this->container['sort_code']; + } + + /** + * Sets sort_code + * + * @param string $sort_code The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sort_code) + { + if (is_null($sort_code)) { + throw new \InvalidArgumentException('non-nullable sort_code cannot be null'); + } + $this->container['sort_code'] = $sort_code; + + return $this; + } + + /** + * Gets routing_number + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routing_number']; + } + + /** + * Sets routing_number + * + * @param string $routing_number The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routing_number) + { + if (is_null($routing_number)) { + throw new \InvalidArgumentException('non-nullable routing_number cannot be null'); + } + $this->container['routing_number'] = $routing_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php new file mode 100644 index 000000000..dbc1b317a --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php @@ -0,0 +1,424 @@ + + */ +class BrandVariantsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BrandVariantsRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value List of card brand variants. Possible values: - **mc**, **mccredit**, **mccommercialcredit_b2b**, **mcdebit**, **mcbusinessdebit**, **mcbusinessworlddebit**, **mcprepaid**, **mcmaestro** - **visa**, **visacredit**, **visadebit**, **visaprepaid**. You can specify a rule for a generic variant. For example, to create a rule for all Mastercard payment instruments, use **mc**. The rule is applied to all payment instruments under **mc**, such as **mcbusinessdebit** and **mcdebit**. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BulkAddress.php b/src/Adyen/Model/BalancePlatform/BulkAddress.php new file mode 100644 index 000000000..21cb09b88 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BulkAddress.php @@ -0,0 +1,662 @@ + + */ +class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BulkAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'company' => 'string', + 'country' => 'string', + 'email' => 'string', + 'house_number_or_name' => 'string', + 'mobile' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'company' => null, + 'country' => null, + 'email' => null, + 'house_number_or_name' => null, + 'mobile' => null, + 'postal_code' => null, + 'state_or_province' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'company' => false, + 'country' => false, + 'email' => false, + 'house_number_or_name' => false, + 'mobile' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'company' => 'company', + 'country' => 'country', + 'email' => 'email', + 'house_number_or_name' => 'houseNumberOrName', + 'mobile' => 'mobile', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'company' => 'setCompany', + 'country' => 'setCountry', + 'email' => 'setEmail', + 'house_number_or_name' => 'setHouseNumberOrName', + 'mobile' => 'setMobile', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'company' => 'getCompany', + 'country' => 'getCountry', + 'email' => 'getEmail', + 'house_number_or_name' => 'getHouseNumberOrName', + 'mobile' => 'getMobile', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('house_number_or_name', $data ?? [], null); + $this->setIfExists('mobile', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets company + * + * @return string|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param string|null $company The name of the company. + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets 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. + * + * @return self + */ + public function setHouseNumberOrName($house_number_or_name) + { + if (is_null($house_number_or_name)) { + throw new \InvalidArgumentException('non-nullable house_number_or_name cannot be null'); + } + $this->container['house_number_or_name'] = $house_number_or_name; + + return $this; + } + + /** + * Gets mobile + * + * @return string|null + */ + public function getMobile() + { + return $this->container['mobile']; + } + + /** + * Sets mobile + * + * @param string|null $mobile The full telephone number. + * + * @return self + */ + public function setMobile($mobile) + { + if (is_null($mobile)) { + throw new \InvalidArgumentException('non-nullable mobile cannot be null'); + } + $this->container['mobile'] = $mobile; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all other countries. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in the US. + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street The streetname of the house. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php new file mode 100644 index 000000000..cabb2a927 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php @@ -0,0 +1,599 @@ + + */ +class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CALocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'account_type' => 'string', + 'institution_number' => 'string', + 'transit_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'account_type' => null, + 'institution_number' => null, + 'transit_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'account_type' => 'accountType', + 'institution_number' => 'institutionNumber', + 'transit_number' => 'transitNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'account_type' => 'setAccountType', + 'institution_number' => 'setInstitutionNumber', + 'transit_number' => 'setTransitNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'account_type' => 'getAccountType', + 'institution_number' => 'getInstitutionNumber', + 'transit_number' => 'getTransitNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACCOUNT_TYPE_CHECKING = 'checking'; + public const ACCOUNT_TYPE_SAVINGS = 'savings'; + public const TYPE_CA_LOCAL = 'caLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_CHECKING, + self::ACCOUNT_TYPE_SAVINGS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CA_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('account_type', $data ?? [], 'checking'); + $this->setIfExists('institution_number', $data ?? [], null); + $this->setIfExists('transit_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'caLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['account_type']) && !in_array($this->container['account_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_type', must be one of '%s'", + $this->container['account_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['institution_number'] === null) { + $invalidProperties[] = "'institution_number' can't be null"; + } + if ($this->container['transit_number'] === null) { + $invalidProperties[] = "'transit_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 5- to 12-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($account_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_type', must be one of '%s'", + $account_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets institution_number + * + * @return string + */ + public function getInstitutionNumber() + { + return $this->container['institution_number']; + } + + /** + * Sets institution_number + * + * @param string $institution_number The 3-digit institution number, without separators or whitespace. + * + * @return self + */ + public function setInstitutionNumber($institution_number) + { + if (is_null($institution_number)) { + throw new \InvalidArgumentException('non-nullable institution_number cannot be null'); + } + $this->container['institution_number'] = $institution_number; + + return $this; + } + + /** + * Gets transit_number + * + * @return string + */ + public function getTransitNumber() + { + return $this->container['transit_number']; + } + + /** + * Sets transit_number + * + * @param string $transit_number The 5-digit transit number, without separators or whitespace. + * + * @return self + */ + public function setTransitNumber($transit_number) + { + if (is_null($transit_number)) { + throw new \InvalidArgumentException('non-nullable transit_number cannot be null'); + } + $this->container['transit_number'] = $transit_number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **caLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php new file mode 100644 index 000000000..7796cd397 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php @@ -0,0 +1,495 @@ + + */ +class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CZLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'bank_code' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'bank_code' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'bank_code' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'bank_code' => 'bankCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'bank_code' => 'setBankCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'bank_code' => 'getBankCode', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CZ_LOCAL = 'czLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CZ_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('bank_code', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'czLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['bank_code'] === null) { + $invalidProperties[] = "'bank_code' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized) + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets bank_code + * + * @return string + */ + public function getBankCode() + { + return $this->container['bank_code']; + } + + /** + * Sets bank_code + * + * @param string $bank_code The 4-digit bank code (Kód banky), without separators or whitespace. + * + * @return self + */ + public function setBankCode($bank_code) + { + if (is_null($bank_code)) { + throw new \InvalidArgumentException('non-nullable bank_code cannot be null'); + } + $this->container['bank_code'] = $bank_code; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **czLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php new file mode 100644 index 000000000..a0f59f249 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -0,0 +1,811 @@ + + */ +class Card implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Card'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication' => '\Adyen\Model\BalancePlatform\Authentication', + 'bin' => 'string', + 'brand' => 'string', + 'brand_variant' => 'string', + 'cardholder_name' => 'string', + 'configuration' => '\Adyen\Model\BalancePlatform\CardConfiguration', + 'cvc' => 'string', + 'delivery_contact' => '\Adyen\Model\BalancePlatform\DeliveryContact', + 'expiration' => '\Adyen\Model\BalancePlatform\Expiry', + 'form_factor' => 'string', + 'last_four' => 'string', + 'number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication' => null, + 'bin' => null, + 'brand' => null, + 'brand_variant' => null, + 'cardholder_name' => null, + 'configuration' => null, + 'cvc' => null, + 'delivery_contact' => null, + 'expiration' => null, + 'form_factor' => null, + 'last_four' => null, + 'number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication' => false, + 'bin' => false, + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'cvc' => false, + 'delivery_contact' => false, + 'expiration' => false, + 'form_factor' => false, + 'last_four' => false, + 'number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication' => 'authentication', + 'bin' => 'bin', + 'brand' => 'brand', + 'brand_variant' => 'brandVariant', + 'cardholder_name' => 'cardholderName', + 'configuration' => 'configuration', + 'cvc' => 'cvc', + 'delivery_contact' => 'deliveryContact', + 'expiration' => 'expiration', + 'form_factor' => 'formFactor', + 'last_four' => 'lastFour', + 'number' => 'number' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication' => 'setAuthentication', + 'bin' => 'setBin', + 'brand' => 'setBrand', + 'brand_variant' => 'setBrandVariant', + 'cardholder_name' => 'setCardholderName', + 'configuration' => 'setConfiguration', + 'cvc' => 'setCvc', + 'delivery_contact' => 'setDeliveryContact', + 'expiration' => 'setExpiration', + 'form_factor' => 'setFormFactor', + 'last_four' => 'setLastFour', + 'number' => 'setNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication' => 'getAuthentication', + 'bin' => 'getBin', + 'brand' => 'getBrand', + 'brand_variant' => 'getBrandVariant', + 'cardholder_name' => 'getCardholderName', + 'configuration' => 'getConfiguration', + 'cvc' => 'getCvc', + 'delivery_contact' => 'getDeliveryContact', + 'expiration' => 'getExpiration', + 'form_factor' => 'getFormFactor', + 'last_four' => 'getLastFour', + 'number' => 'getNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FORM_FACTOR_PHYSICAL = 'physical'; + public const FORM_FACTOR_UNKNOWN = 'unknown'; + public const FORM_FACTOR_VIRTUAL = 'virtual'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFormFactorAllowableValues() + { + return [ + self::FORM_FACTOR_PHYSICAL, + self::FORM_FACTOR_UNKNOWN, + self::FORM_FACTOR_VIRTUAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication', $data ?? [], null); + $this->setIfExists('bin', $data ?? [], null); + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('brand_variant', $data ?? [], null); + $this->setIfExists('cardholder_name', $data ?? [], null); + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('delivery_contact', $data ?? [], null); + $this->setIfExists('expiration', $data ?? [], null); + $this->setIfExists('form_factor', $data ?? [], null); + $this->setIfExists('last_four', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['brand'] === null) { + $invalidProperties[] = "'brand' can't be null"; + } + if ($this->container['brand_variant'] === null) { + $invalidProperties[] = "'brand_variant' can't be null"; + } + if ($this->container['cardholder_name'] === null) { + $invalidProperties[] = "'cardholder_name' can't be null"; + } + if ($this->container['form_factor'] === null) { + $invalidProperties[] = "'form_factor' can't be null"; + } + $allowedValues = $this->getFormFactorAllowableValues(); + if (!is_null($this->container['form_factor']) && !in_array($this->container['form_factor'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'form_factor', must be one of '%s'", + $this->container['form_factor'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['number'] === null) { + $invalidProperties[] = "'number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication + * + * @return \Adyen\Model\BalancePlatform\Authentication|null + */ + public function getAuthentication() + { + return $this->container['authentication']; + } + + /** + * Sets authentication + * + * @param \Adyen\Model\BalancePlatform\Authentication|null $authentication authentication + * + * @return self + */ + public function setAuthentication($authentication) + { + if (is_null($authentication)) { + throw new \InvalidArgumentException('non-nullable authentication cannot be null'); + } + $this->container['authentication'] = $authentication; + + return $this; + } + + /** + * Gets bin + * + * @return string|null + */ + public function getBin() + { + return $this->container['bin']; + } + + /** + * Sets bin + * + * @param string|null $bin The bank identification number (BIN) of the card number. + * + * @return self + */ + public function setBin($bin) + { + if (is_null($bin)) { + throw new \InvalidArgumentException('non-nullable bin cannot be null'); + } + $this->container['bin'] = $bin; + + return $this; + } + + /** + * Gets brand + * + * @return string + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string $brand The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets brand_variant + * + * @return string + */ + public function getBrandVariant() + { + return $this->container['brand_variant']; + } + + /** + * Sets brand_variant + * + * @param string $brand_variant The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * + * @return self + */ + public function setBrandVariant($brand_variant) + { + if (is_null($brand_variant)) { + throw new \InvalidArgumentException('non-nullable brand_variant cannot be null'); + } + $this->container['brand_variant'] = $brand_variant; + + return $this; + } + + /** + * Gets cardholder_name + * + * @return string + */ + public function getCardholderName() + { + return $this->container['cardholder_name']; + } + + /** + * Sets cardholder_name + * + * @param string $cardholder_name The name of the cardholder. Maximum length: 26 characters. + * + * @return self + */ + public function setCardholderName($cardholder_name) + { + if (is_null($cardholder_name)) { + throw new \InvalidArgumentException('non-nullable cardholder_name cannot be null'); + } + $this->container['cardholder_name'] = $cardholder_name; + + return $this; + } + + /** + * Gets configuration + * + * @return \Adyen\Model\BalancePlatform\CardConfiguration|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param \Adyen\Model\BalancePlatform\CardConfiguration|null $configuration configuration + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets delivery_contact + * + * @return \Adyen\Model\BalancePlatform\DeliveryContact|null + */ + public function getDeliveryContact() + { + return $this->container['delivery_contact']; + } + + /** + * Sets delivery_contact + * + * @param \Adyen\Model\BalancePlatform\DeliveryContact|null $delivery_contact delivery_contact + * + * @return self + */ + public function setDeliveryContact($delivery_contact) + { + if (is_null($delivery_contact)) { + throw new \InvalidArgumentException('non-nullable delivery_contact cannot be null'); + } + $this->container['delivery_contact'] = $delivery_contact; + + return $this; + } + + /** + * Gets expiration + * + * @return \Adyen\Model\BalancePlatform\Expiry|null + */ + public function getExpiration() + { + return $this->container['expiration']; + } + + /** + * Sets expiration + * + * @param \Adyen\Model\BalancePlatform\Expiry|null $expiration expiration + * + * @return self + */ + public function setExpiration($expiration) + { + if (is_null($expiration)) { + throw new \InvalidArgumentException('non-nullable expiration cannot be null'); + } + $this->container['expiration'] = $expiration; + + return $this; + } + + /** + * Gets form_factor + * + * @return string + */ + public function getFormFactor() + { + return $this->container['form_factor']; + } + + /** + * Sets form_factor + * + * @param string $form_factor The form factor of the card. Possible values: **virtual**, **physical**. + * + * @return self + */ + public function setFormFactor($form_factor) + { + if (is_null($form_factor)) { + throw new \InvalidArgumentException('non-nullable form_factor cannot be null'); + } + $allowedValues = $this->getFormFactorAllowableValues(); + if (!in_array($form_factor, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'form_factor', must be one of '%s'", + $form_factor, + implode("', '", $allowedValues) + ) + ); + } + $this->container['form_factor'] = $form_factor; + + return $this; + } + + /** + * Gets last_four + * + * @return string|null + */ + public function getLastFour() + { + return $this->container['last_four']; + } + + /** + * Sets last_four + * + * @param string|null $last_four Last last four digits of the card number. + * + * @return self + */ + public function setLastFour($last_four) + { + if (is_null($last_four)) { + throw new \InvalidArgumentException('non-nullable last_four cannot be null'); + } + $this->container['last_four'] = $last_four; + + return $this; + } + + /** + * Gets number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php new file mode 100644 index 000000000..407696741 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -0,0 +1,832 @@ + + */ +class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'activation' => 'string', + 'activation_url' => 'string', + 'bulk_address' => '\Adyen\Model\BalancePlatform\BulkAddress', + 'card_image_id' => 'string', + 'carrier' => 'string', + 'carrier_image_id' => 'string', + 'configuration_profile_id' => 'string', + 'currency' => 'string', + 'envelope' => 'string', + 'insert' => 'string', + 'language' => 'string', + 'logo_image_id' => 'string', + 'pin_mailer' => 'string', + 'shipment_method' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'activation' => null, + 'activation_url' => null, + 'bulk_address' => null, + 'card_image_id' => null, + 'carrier' => null, + 'carrier_image_id' => null, + 'configuration_profile_id' => null, + 'currency' => null, + 'envelope' => null, + 'insert' => null, + 'language' => null, + 'logo_image_id' => null, + 'pin_mailer' => null, + 'shipment_method' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'activation' => false, + 'activation_url' => false, + 'bulk_address' => false, + 'card_image_id' => false, + 'carrier' => false, + 'carrier_image_id' => false, + 'configuration_profile_id' => false, + 'currency' => false, + 'envelope' => false, + 'insert' => false, + 'language' => false, + 'logo_image_id' => false, + 'pin_mailer' => false, + 'shipment_method' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activation' => 'activation', + 'activation_url' => 'activationUrl', + 'bulk_address' => 'bulkAddress', + 'card_image_id' => 'cardImageId', + 'carrier' => 'carrier', + 'carrier_image_id' => 'carrierImageId', + 'configuration_profile_id' => 'configurationProfileId', + 'currency' => 'currency', + 'envelope' => 'envelope', + 'insert' => 'insert', + 'language' => 'language', + 'logo_image_id' => 'logoImageId', + 'pin_mailer' => 'pinMailer', + 'shipment_method' => 'shipmentMethod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activation' => 'setActivation', + 'activation_url' => 'setActivationUrl', + 'bulk_address' => 'setBulkAddress', + 'card_image_id' => 'setCardImageId', + 'carrier' => 'setCarrier', + 'carrier_image_id' => 'setCarrierImageId', + 'configuration_profile_id' => 'setConfigurationProfileId', + 'currency' => 'setCurrency', + 'envelope' => 'setEnvelope', + 'insert' => 'setInsert', + 'language' => 'setLanguage', + 'logo_image_id' => 'setLogoImageId', + 'pin_mailer' => 'setPinMailer', + 'shipment_method' => 'setShipmentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activation' => 'getActivation', + 'activation_url' => 'getActivationUrl', + 'bulk_address' => 'getBulkAddress', + 'card_image_id' => 'getCardImageId', + 'carrier' => 'getCarrier', + 'carrier_image_id' => 'getCarrierImageId', + 'configuration_profile_id' => 'getConfigurationProfileId', + 'currency' => 'getCurrency', + 'envelope' => 'getEnvelope', + 'insert' => 'getInsert', + 'language' => 'getLanguage', + 'logo_image_id' => 'getLogoImageId', + 'pin_mailer' => 'getPinMailer', + 'shipment_method' => 'getShipmentMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('activation', $data ?? [], null); + $this->setIfExists('activation_url', $data ?? [], null); + $this->setIfExists('bulk_address', $data ?? [], null); + $this->setIfExists('card_image_id', $data ?? [], null); + $this->setIfExists('carrier', $data ?? [], null); + $this->setIfExists('carrier_image_id', $data ?? [], null); + $this->setIfExists('configuration_profile_id', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('envelope', $data ?? [], null); + $this->setIfExists('insert', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('logo_image_id', $data ?? [], null); + $this->setIfExists('pin_mailer', $data ?? [], null); + $this->setIfExists('shipment_method', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['configuration_profile_id'] === null) { + $invalidProperties[] = "'configuration_profile_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets activation + * + * @return string|null + */ + public function getActivation() + { + return $this->container['activation']; + } + + /** + * Sets activation + * + * @param string|null $activation Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. + * + * @return self + */ + public function setActivation($activation) + { + if (is_null($activation)) { + throw new \InvalidArgumentException('non-nullable activation cannot be null'); + } + $this->container['activation'] = $activation; + + return $this; + } + + /** + * Gets activation_url + * + * @return string|null + */ + public function getActivationUrl() + { + return $this->container['activation_url']; + } + + /** + * Sets activation_url + * + * @param string|null $activation_url Your app's URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. + * + * @return self + */ + public function setActivationUrl($activation_url) + { + if (is_null($activation_url)) { + throw new \InvalidArgumentException('non-nullable activation_url cannot be null'); + } + $this->container['activation_url'] = $activation_url; + + return $this; + } + + /** + * Gets bulk_address + * + * @return \Adyen\Model\BalancePlatform\BulkAddress|null + */ + public function getBulkAddress() + { + return $this->container['bulk_address']; + } + + /** + * Sets bulk_address + * + * @param \Adyen\Model\BalancePlatform\BulkAddress|null $bulk_address bulk_address + * + * @return self + */ + public function setBulkAddress($bulk_address) + { + if (is_null($bulk_address)) { + throw new \InvalidArgumentException('non-nullable bulk_address cannot be null'); + } + $this->container['bulk_address'] = $bulk_address; + + return $this; + } + + /** + * Gets card_image_id + * + * @return string|null + */ + public function getCardImageId() + { + return $this->container['card_image_id']; + } + + /** + * Sets card_image_id + * + * @param string|null $card_image_id The ID of the card image. This is the image that will be printed on the full front of the card. + * + * @return self + */ + public function setCardImageId($card_image_id) + { + if (is_null($card_image_id)) { + throw new \InvalidArgumentException('non-nullable card_image_id cannot be null'); + } + $this->container['card_image_id'] = $card_image_id; + + return $this; + } + + /** + * Gets carrier + * + * @return string|null + */ + public function getCarrier() + { + return $this->container['carrier']; + } + + /** + * Sets carrier + * + * @param string|null $carrier Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. + * + * @return self + */ + public function setCarrier($carrier) + { + if (is_null($carrier)) { + throw new \InvalidArgumentException('non-nullable carrier cannot be null'); + } + $this->container['carrier'] = $carrier; + + return $this; + } + + /** + * Gets carrier_image_id + * + * @return string|null + */ + public function getCarrierImageId() + { + return $this->container['carrier_image_id']; + } + + /** + * Sets carrier_image_id + * + * @param string|null $carrier_image_id The ID of the carrier image. This is the image that will printed on the letter to which the card is attached. + * + * @return self + */ + public function setCarrierImageId($carrier_image_id) + { + if (is_null($carrier_image_id)) { + throw new \InvalidArgumentException('non-nullable carrier_image_id cannot be null'); + } + $this->container['carrier_image_id'] = $carrier_image_id; + + return $this; + } + + /** + * Gets configuration_profile_id + * + * @return string + */ + public function getConfigurationProfileId() + { + return $this->container['configuration_profile_id']; + } + + /** + * Sets configuration_profile_id + * + * @param string $configuration_profile_id The ID of the card configuration profile that contains the settings of the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. All the settings in the profile are applied to the card, unless you provide other fields to override them. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. + * + * @return self + */ + public function setConfigurationProfileId($configuration_profile_id) + { + if (is_null($configuration_profile_id)) { + throw new \InvalidArgumentException('non-nullable configuration_profile_id cannot be null'); + } + $this->container['configuration_profile_id'] = $configuration_profile_id; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets envelope + * + * @return string|null + */ + public function getEnvelope() + { + return $this->container['envelope']; + } + + /** + * Sets envelope + * + * @param string|null $envelope Overrides the envelope design ID defined in the `configurationProfileId`. + * + * @return self + */ + public function setEnvelope($envelope) + { + if (is_null($envelope)) { + throw new \InvalidArgumentException('non-nullable envelope cannot be null'); + } + $this->container['envelope'] = $envelope; + + return $this; + } + + /** + * Gets insert + * + * @return string|null + */ + public function getInsert() + { + return $this->container['insert']; + } + + /** + * Sets insert + * + * @param string|null $insert Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. + * + * @return self + */ + public function setInsert($insert) + { + if (is_null($insert)) { + throw new \InvalidArgumentException('non-nullable insert cannot be null'); + } + $this->container['insert'] = $insert; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language The two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code of the card. For example, **en**. + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets logo_image_id + * + * @return string|null + */ + public function getLogoImageId() + { + return $this->container['logo_image_id']; + } + + /** + * Sets logo_image_id + * + * @param string|null $logo_image_id The ID of the logo image. This is the image that will be printed on the partial front of the card, such as a logo on the upper right corner. + * + * @return self + */ + public function setLogoImageId($logo_image_id) + { + if (is_null($logo_image_id)) { + throw new \InvalidArgumentException('non-nullable logo_image_id cannot be null'); + } + $this->container['logo_image_id'] = $logo_image_id; + + return $this; + } + + /** + * Gets pin_mailer + * + * @return string|null + */ + public function getPinMailer() + { + return $this->container['pin_mailer']; + } + + /** + * Sets pin_mailer + * + * @param string|null $pin_mailer Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN mailer is the letter on which the PIN is printed. + * + * @return self + */ + public function setPinMailer($pin_mailer) + { + if (is_null($pin_mailer)) { + throw new \InvalidArgumentException('non-nullable pin_mailer cannot be null'); + } + $this->container['pin_mailer'] = $pin_mailer; + + return $this; + } + + /** + * Gets shipment_method + * + * @return string|null + */ + public function getShipmentMethod() + { + return $this->container['shipment_method']; + } + + /** + * Sets shipment_method + * + * @param string|null $shipment_method Overrides the logistics company defined in the `configurationProfileId`. + * + * @return self + */ + public function setShipmentMethod($shipment_method) + { + if (is_null($shipment_method)) { + throw new \InvalidArgumentException('non-nullable shipment_method cannot be null'); + } + $this->container['shipment_method'] = $shipment_method; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CardInfo.php b/src/Adyen/Model/BalancePlatform/CardInfo.php new file mode 100644 index 000000000..fbb7e9f66 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CardInfo.php @@ -0,0 +1,638 @@ + + */ +class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication' => '\Adyen\Model\BalancePlatform\Authentication', + 'brand' => 'string', + 'brand_variant' => 'string', + 'cardholder_name' => 'string', + 'configuration' => '\Adyen\Model\BalancePlatform\CardConfiguration', + 'delivery_contact' => '\Adyen\Model\BalancePlatform\DeliveryContact', + 'form_factor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication' => null, + 'brand' => null, + 'brand_variant' => null, + 'cardholder_name' => null, + 'configuration' => null, + 'delivery_contact' => null, + 'form_factor' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication' => false, + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'delivery_contact' => false, + 'form_factor' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication' => 'authentication', + 'brand' => 'brand', + 'brand_variant' => 'brandVariant', + 'cardholder_name' => 'cardholderName', + 'configuration' => 'configuration', + 'delivery_contact' => 'deliveryContact', + 'form_factor' => 'formFactor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication' => 'setAuthentication', + 'brand' => 'setBrand', + 'brand_variant' => 'setBrandVariant', + 'cardholder_name' => 'setCardholderName', + 'configuration' => 'setConfiguration', + 'delivery_contact' => 'setDeliveryContact', + 'form_factor' => 'setFormFactor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication' => 'getAuthentication', + 'brand' => 'getBrand', + 'brand_variant' => 'getBrandVariant', + 'cardholder_name' => 'getCardholderName', + 'configuration' => 'getConfiguration', + 'delivery_contact' => 'getDeliveryContact', + 'form_factor' => 'getFormFactor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FORM_FACTOR_PHYSICAL = 'physical'; + public const FORM_FACTOR_UNKNOWN = 'unknown'; + public const FORM_FACTOR_VIRTUAL = 'virtual'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFormFactorAllowableValues() + { + return [ + self::FORM_FACTOR_PHYSICAL, + self::FORM_FACTOR_UNKNOWN, + self::FORM_FACTOR_VIRTUAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication', $data ?? [], null); + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('brand_variant', $data ?? [], null); + $this->setIfExists('cardholder_name', $data ?? [], null); + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('delivery_contact', $data ?? [], null); + $this->setIfExists('form_factor', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['brand'] === null) { + $invalidProperties[] = "'brand' can't be null"; + } + if ($this->container['brand_variant'] === null) { + $invalidProperties[] = "'brand_variant' can't be null"; + } + if ($this->container['cardholder_name'] === null) { + $invalidProperties[] = "'cardholder_name' can't be null"; + } + if ($this->container['form_factor'] === null) { + $invalidProperties[] = "'form_factor' can't be null"; + } + $allowedValues = $this->getFormFactorAllowableValues(); + if (!is_null($this->container['form_factor']) && !in_array($this->container['form_factor'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'form_factor', must be one of '%s'", + $this->container['form_factor'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication + * + * @return \Adyen\Model\BalancePlatform\Authentication|null + */ + public function getAuthentication() + { + return $this->container['authentication']; + } + + /** + * Sets authentication + * + * @param \Adyen\Model\BalancePlatform\Authentication|null $authentication authentication + * + * @return self + */ + public function setAuthentication($authentication) + { + if (is_null($authentication)) { + throw new \InvalidArgumentException('non-nullable authentication cannot be null'); + } + $this->container['authentication'] = $authentication; + + return $this; + } + + /** + * Gets brand + * + * @return string + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string $brand The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets brand_variant + * + * @return string + */ + public function getBrandVariant() + { + return $this->container['brand_variant']; + } + + /** + * Sets brand_variant + * + * @param string $brand_variant The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * + * @return self + */ + public function setBrandVariant($brand_variant) + { + if (is_null($brand_variant)) { + throw new \InvalidArgumentException('non-nullable brand_variant cannot be null'); + } + $this->container['brand_variant'] = $brand_variant; + + return $this; + } + + /** + * Gets cardholder_name + * + * @return string + */ + public function getCardholderName() + { + return $this->container['cardholder_name']; + } + + /** + * Sets cardholder_name + * + * @param string $cardholder_name The name of the cardholder. Maximum length: 26 characters. + * + * @return self + */ + public function setCardholderName($cardholder_name) + { + if (is_null($cardholder_name)) { + throw new \InvalidArgumentException('non-nullable cardholder_name cannot be null'); + } + $this->container['cardholder_name'] = $cardholder_name; + + return $this; + } + + /** + * Gets configuration + * + * @return \Adyen\Model\BalancePlatform\CardConfiguration|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param \Adyen\Model\BalancePlatform\CardConfiguration|null $configuration configuration + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets delivery_contact + * + * @return \Adyen\Model\BalancePlatform\DeliveryContact|null + */ + public function getDeliveryContact() + { + return $this->container['delivery_contact']; + } + + /** + * Sets delivery_contact + * + * @param \Adyen\Model\BalancePlatform\DeliveryContact|null $delivery_contact delivery_contact + * + * @return self + */ + public function setDeliveryContact($delivery_contact) + { + if (is_null($delivery_contact)) { + throw new \InvalidArgumentException('non-nullable delivery_contact cannot be null'); + } + $this->container['delivery_contact'] = $delivery_contact; + + return $this; + } + + /** + * Gets form_factor + * + * @return string + */ + public function getFormFactor() + { + return $this->container['form_factor']; + } + + /** + * Sets form_factor + * + * @param string $form_factor The form factor of the card. Possible values: **virtual**, **physical**. + * + * @return self + */ + public function setFormFactor($form_factor) + { + if (is_null($form_factor)) { + throw new \InvalidArgumentException('non-nullable form_factor cannot be null'); + } + $allowedValues = $this->getFormFactorAllowableValues(); + if (!in_array($form_factor, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'form_factor', must be one of '%s'", + $form_factor, + implode("', '", $allowedValues) + ) + ); + } + $this->container['form_factor'] = $form_factor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ContactDetails.php b/src/Adyen/Model/BalancePlatform/ContactDetails.php new file mode 100644 index 000000000..ce4cb4855 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ContactDetails.php @@ -0,0 +1,498 @@ + + */ +class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ContactDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\BalancePlatform\Address', + 'email' => 'string', + 'phone' => '\Adyen\Model\BalancePlatform\Phone', + 'web_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'email' => null, + 'phone' => null, + 'web_address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'email' => false, + 'phone' => false, + 'web_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'email' => 'email', + 'phone' => 'phone', + 'web_address' => 'webAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'web_address' => 'setWebAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'web_address' => 'getWebAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('web_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['phone'] === null) { + $invalidProperties[] = "'phone' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\BalancePlatform\Address + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\BalancePlatform\Address $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the account holder. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Adyen\Model\BalancePlatform\Phone + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Adyen\Model\BalancePlatform\Phone $phone phone + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets web_address + * + * @return string|null + */ + public function getWebAddress() + { + return $this->container['web_address']; + } + + /** + * Sets web_address + * + * @param string|null $web_address The URL of the account holder's website. + * + * @return self + */ + public function setWebAddress($web_address) + { + if (is_null($web_address)) { + throw new \InvalidArgumentException('non-nullable web_address cannot be null'); + } + $this->container['web_address'] = $web_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php new file mode 100644 index 000000000..49e127b4c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php @@ -0,0 +1,424 @@ + + */ +class CountriesRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CountriesRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value List of two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php new file mode 100644 index 000000000..0b2ab8a56 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php @@ -0,0 +1,463 @@ + + */ +class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CronSweepSchedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cron_expression' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cron_expression' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cron_expression' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cron_expression' => 'cronExpression', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cron_expression' => 'setCronExpression', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cron_expression' => 'getCronExpression', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DAILY = 'daily'; + public const TYPE_WEEKLY = 'weekly'; + public const TYPE_MONTHLY = 'monthly'; + public const TYPE_BALANCE = 'balance'; + public const TYPE_CRON = 'cron'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DAILY, + self::TYPE_WEEKLY, + self::TYPE_MONTHLY, + self::TYPE_BALANCE, + self::TYPE_CRON, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cron_expression', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cron_expression'] === null) { + $invalidProperties[] = "'cron_expression' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cron_expression + * + * @return string + */ + public function getCronExpression() + { + return $this->container['cron_expression']; + } + + /** + * Sets cron_expression + * + * @param string $cron_expression A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. + * + * @return self + */ + public function setCronExpression($cron_expression) + { + if (is_null($cron_expression)) { + throw new \InvalidArgumentException('non-nullable cron_expression cannot be null'); + } + $this->container['cron_expression'] = $cron_expression; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php new file mode 100644 index 000000000..13e248b8e --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php @@ -0,0 +1,457 @@ + + */ +class DayOfWeekRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DayOfWeekRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_FRIDAY = 'friday'; + public const VALUE_MONDAY = 'monday'; + public const VALUE_SATURDAY = 'saturday'; + public const VALUE_SUNDAY = 'sunday'; + public const VALUE_THURSDAY = 'thursday'; + public const VALUE_TUESDAY = 'tuesday'; + public const VALUE_WEDNESDAY = 'wednesday'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_FRIDAY, + self::VALUE_MONDAY, + self::VALUE_SATURDAY, + self::VALUE_SUNDAY, + self::VALUE_THURSDAY, + self::VALUE_TUESDAY, + self::VALUE_WEDNESDAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value List of days of the week. Possible values: **monday**, **tuesday**, **wednesday**, **thursday**, **friday**, **saturday**, **sunday**. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (array_diff($value, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'value', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php new file mode 100644 index 000000000..d1b5f5ec8 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -0,0 +1,563 @@ + + */ +class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeliveryContact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\BalancePlatform\Address2', + 'email' => 'string', + 'full_phone_number' => 'string', + 'name' => '\Adyen\Model\BalancePlatform\Name', + 'phone_number' => '\Adyen\Model\BalancePlatform\PhoneNumber', + 'web_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'email' => null, + 'full_phone_number' => null, + 'name' => null, + 'phone_number' => null, + 'web_address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'email' => false, + 'full_phone_number' => false, + 'name' => false, + 'phone_number' => false, + 'web_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'email' => 'email', + 'full_phone_number' => 'fullPhoneNumber', + 'name' => 'name', + 'phone_number' => 'phoneNumber', + 'web_address' => 'webAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'email' => 'setEmail', + 'full_phone_number' => 'setFullPhoneNumber', + 'name' => 'setName', + 'phone_number' => 'setPhoneNumber', + 'web_address' => 'setWebAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'email' => 'getEmail', + 'full_phone_number' => 'getFullPhoneNumber', + 'name' => 'getName', + 'phone_number' => 'getPhoneNumber', + 'web_address' => 'getWebAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('full_phone_number', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('web_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\BalancePlatform\Address2 + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\BalancePlatform\Address2 $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address of the contact. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets full_phone_number + * + * @return string|null + */ + public function getFullPhoneNumber() + { + return $this->container['full_phone_number']; + } + + /** + * Sets full_phone_number + * + * @param string|null $full_phone_number The full phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" + * + * @return self + */ + public function setFullPhoneNumber($full_phone_number) + { + if (is_null($full_phone_number)) { + throw new \InvalidArgumentException('non-nullable full_phone_number cannot be null'); + } + $this->container['full_phone_number'] = $full_phone_number; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\BalancePlatform\Name + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\BalancePlatform\Name $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phone_number + * + * @return \Adyen\Model\BalancePlatform\PhoneNumber|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param \Adyen\Model\BalancePlatform\PhoneNumber|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets web_address + * + * @return string|null + */ + public function getWebAddress() + { + return $this->container['web_address']; + } + + /** + * Sets web_address + * + * @param string|null $web_address The URL of the contact's website. + * + * @return self + */ + public function setWebAddress($web_address) + { + if (is_null($web_address)) { + throw new \InvalidArgumentException('non-nullable web_address cannot be null'); + } + $this->container['web_address'] = $web_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php new file mode 100644 index 000000000..d99db659e --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php @@ -0,0 +1,424 @@ + + */ +class DifferentCurrenciesRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DifferentCurrenciesRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return bool|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param bool|null $value Checks the currency of the payment against the currency of the payment instrument. Possible values: - **true**: The currency of the payment is different from the currency of the payment instrument. - **false**: The currencies are the same. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Duration.php b/src/Adyen/Model/BalancePlatform/Duration.php new file mode 100644 index 000000000..9f5ffa4db --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Duration.php @@ -0,0 +1,458 @@ + + */ +class Duration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Duration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'unit' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'unit' => null, + 'value' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'unit' => false, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'unit' => 'unit', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'unit' => 'setUnit', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'unit' => 'getUnit', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const UNIT_DAYS = 'days'; + public const UNIT_HOURS = 'hours'; + public const UNIT_MINUTES = 'minutes'; + public const UNIT_MONTHS = 'months'; + public const UNIT_WEEKS = 'weeks'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getUnitAllowableValues() + { + return [ + self::UNIT_DAYS, + self::UNIT_HOURS, + self::UNIT_MINUTES, + self::UNIT_MONTHS, + self::UNIT_WEEKS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('unit', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getUnitAllowableValues(); + if (!is_null($this->container['unit']) && !in_array($this->container['unit'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'unit', must be one of '%s'", + $this->container['unit'], + 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 unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months** + * + * @return self + */ + public function setUnit($unit) + { + if (is_null($unit)) { + throw new \InvalidArgumentException('non-nullable unit cannot be null'); + } + $allowedValues = $this->getUnitAllowableValues(); + if (!in_array($unit, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'unit', must be one of '%s'", + $unit, + implode("', '", $allowedValues) + ) + ); + } + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months. + * + * @return self + */ + public function setValue($value) + { + // Do nothing for nullable integers + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php new file mode 100644 index 000000000..4a062c74d --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php @@ -0,0 +1,461 @@ + + */ +class EntryModesRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EntryModesRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_BARCODE = 'barcode'; + public const VALUE_CHIP = 'chip'; + public const VALUE_COF = 'cof'; + public const VALUE_CONTACTLESS = 'contactless'; + public const VALUE_MAGSTRIPE = 'magstripe'; + public const VALUE_MANUAL = 'manual'; + public const VALUE_OCR = 'ocr'; + public const VALUE_SERVER = 'server'; + public const VALUE_UNKNOWN = 'unknown'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_BARCODE, + self::VALUE_CHIP, + self::VALUE_COF, + self::VALUE_CONTACTLESS, + self::VALUE_MAGSTRIPE, + self::VALUE_MANUAL, + self::VALUE_OCR, + self::VALUE_SERVER, + self::VALUE_UNKNOWN, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value List of point-of-sale entry modes. Possible values: **barcode**, **chip**, **cof**, **contactless**, **magstripe**, **manual**, **ocr**, **server**. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (array_diff($value, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'value', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Expiry.php b/src/Adyen/Model/BalancePlatform/Expiry.php new file mode 100644 index 000000000..a713dfba3 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Expiry.php @@ -0,0 +1,421 @@ + + */ +class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Expiry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'month' => 'string', + 'year' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'month' => null, + 'year' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'month' => false, + 'year' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'month' => 'month', + 'year' => 'year' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'month' => 'setMonth', + 'year' => 'setYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'month' => 'getMonth', + 'year' => 'getYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets month + * + * @return string|null + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param string|null $month The month in which the card will expire. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets year + * + * @return string|null + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param string|null $year The year in which the card will expire. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php new file mode 100644 index 000000000..8ef664195 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php @@ -0,0 +1,458 @@ + + */ +class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HULocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_HU_LOCAL = 'huLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_HU_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'huLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 24-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **huLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php new file mode 100644 index 000000000..efd00176f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -0,0 +1,458 @@ + + */ +class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IbanAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'iban' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'iban' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'iban' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'iban' => 'iban', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'iban' => 'setIban', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'iban' => 'getIban', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_IBAN = 'iban'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IBAN, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'iban'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **iban** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php new file mode 100644 index 000000000..9b73c033d --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php @@ -0,0 +1,424 @@ + + */ +class InternationalTransactionRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InternationalTransactionRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return bool|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param bool|null $value Boolean indicating whether transaction is an international transaction. Possible values: - **true**: The transaction is an international transaction. - **false**: The transaction is a domestic transaction. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/InvalidField.php b/src/Adyen/Model/BalancePlatform/InvalidField.php new file mode 100644 index 000000000..79fd00ec0 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/InvalidField.php @@ -0,0 +1,464 @@ + + */ +class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'name' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'name' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'message' => false, + 'name' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'name' => 'name', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'name' => 'setName', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'name' => 'getName', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Description of the validation error. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The field that has an invalid value. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The invalid value. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/JSONObject.php b/src/Adyen/Model/BalancePlatform/JSONObject.php new file mode 100644 index 000000000..e78daea48 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/JSONObject.php @@ -0,0 +1,421 @@ + + */ +class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JSONObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paths' => '\Adyen\Model\BalancePlatform\JSONPath[]', + 'root_path' => '\Adyen\Model\BalancePlatform\JSONPath' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paths' => null, + 'root_path' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paths' => false, + 'root_path' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'paths' => 'paths', + 'root_path' => 'rootPath' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paths' => 'setPaths', + 'root_path' => 'setRootPath' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paths' => 'getPaths', + 'root_path' => 'getRootPath' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('paths', $data ?? [], null); + $this->setIfExists('root_path', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets paths + * + * @return \Adyen\Model\BalancePlatform\JSONPath[]|null + */ + public function getPaths() + { + return $this->container['paths']; + } + + /** + * Sets paths + * + * @param \Adyen\Model\BalancePlatform\JSONPath[]|null $paths paths + * + * @return self + */ + public function setPaths($paths) + { + if (is_null($paths)) { + throw new \InvalidArgumentException('non-nullable paths cannot be null'); + } + $this->container['paths'] = $paths; + + return $this; + } + + /** + * Gets root_path + * + * @return \Adyen\Model\BalancePlatform\JSONPath|null + */ + public function getRootPath() + { + return $this->container['root_path']; + } + + /** + * Sets root_path + * + * @param \Adyen\Model\BalancePlatform\JSONPath|null $root_path root_path + * + * @return self + */ + public function setRootPath($root_path) + { + if (is_null($root_path)) { + throw new \InvalidArgumentException('non-nullable root_path cannot be null'); + } + $this->container['root_path'] = $root_path; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/JSONPath.php b/src/Adyen/Model/BalancePlatform/JSONPath.php new file mode 100644 index 000000000..f577e9910 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/JSONPath.php @@ -0,0 +1,387 @@ + + */ +class JSONPath implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JSONPath'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'content' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('content', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets content + * + * @return string[]|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string[]|null $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php new file mode 100644 index 000000000..288965ca1 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php @@ -0,0 +1,422 @@ + + */ +class MatchingTransactionsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MatchingTransactionsRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The number of transactions. + * + * @return self + */ + public function setValue($value) + { + // Do nothing for nullable integers + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MccsRestriction.php b/src/Adyen/Model/BalancePlatform/MccsRestriction.php new file mode 100644 index 000000000..c37bd3438 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MccsRestriction.php @@ -0,0 +1,424 @@ + + */ +class MccsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MccsRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value List of merchant category codes (MCCs). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php new file mode 100644 index 000000000..02704cadf --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php @@ -0,0 +1,421 @@ + + */ +class MerchantAcquirerPair implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantAcquirerPair'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acquirer_id' => 'string', + 'merchant_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acquirer_id' => null, + 'merchant_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acquirer_id' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acquirer_id' => 'acquirerId', + 'merchant_id' => 'merchantId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acquirer_id' => 'setAcquirerId', + 'merchant_id' => 'setMerchantId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acquirer_id' => 'getAcquirerId', + 'merchant_id' => 'getMerchantId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('acquirer_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets acquirer_id + * + * @return string|null + */ + public function getAcquirerId() + { + return $this->container['acquirer_id']; + } + + /** + * Sets acquirer_id + * + * @param string|null $acquirer_id The acquirer ID. + * + * @return self + */ + public function setAcquirerId($acquirer_id) + { + if (is_null($acquirer_id)) { + throw new \InvalidArgumentException('non-nullable acquirer_id cannot be null'); + } + $this->container['acquirer_id'] = $acquirer_id; + + return $this; + } + + /** + * Gets merchant_id + * + * @return string|null + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string|null $merchant_id The merchant identification number (MID). + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php new file mode 100644 index 000000000..3cbf61ec0 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php @@ -0,0 +1,424 @@ + + */ +class MerchantNamesRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantNamesRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => '\Adyen\Model\BalancePlatform\StringMatch[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return \Adyen\Model\BalancePlatform\StringMatch[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Adyen\Model\BalancePlatform\StringMatch[]|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php new file mode 100644 index 000000000..071a8eb6f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php @@ -0,0 +1,424 @@ + + */ +class MerchantsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantsRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => '\Adyen\Model\BalancePlatform\MerchantAcquirerPair[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return \Adyen\Model\BalancePlatform\MerchantAcquirerPair[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Adyen\Model\BalancePlatform\MerchantAcquirerPair[]|null $value List of merchant ID and acquirer ID pairs. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ModelInterface.php b/src/Adyen/Model/BalancePlatform/ModelInterface.php new file mode 100644 index 000000000..5c4ab4f12 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ModelInterface.php @@ -0,0 +1,95 @@ + + */ +class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NOLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_NO_LOCAL = 'noLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NO_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'noLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 11-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **noLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Name.php b/src/Adyen/Model/BalancePlatform/Name.php new file mode 100644 index 000000000..bab3c4994 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Name.php @@ -0,0 +1,427 @@ + + */ +class Name implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Name'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string' + ]; + + /** + * 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 + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'first_name' => false, + 'last_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'firstName', + 'last_name' => 'lastName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['first_name'] === null) { + $invalidProperties[] = "'first_name' can't be null"; + } + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' 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 first_name + * + * @return string + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string $first_name The first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string $last_name The last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_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 + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php new file mode 100644 index 000000000..0c35925fd --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php @@ -0,0 +1,529 @@ + + */ +class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumberAndBicAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'additional_bank_identification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', + 'bic' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'additional_bank_identification' => null, + 'bic' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'additional_bank_identification' => false, + 'bic' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'additional_bank_identification' => 'additionalBankIdentification', + 'bic' => 'bic', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'additional_bank_identification' => 'setAdditionalBankIdentification', + 'bic' => 'setBic', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'additional_bank_identification' => 'getAdditionalBankIdentification', + 'bic' => 'getBic', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_NUMBER_AND_BIC = 'numberAndBic'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NUMBER_AND_BIC, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('additional_bank_identification', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'numberAndBic'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The bank account number, without separators or whitespace. The length and format depends on the bank or country. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets additional_bank_identification + * + * @return \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null + */ + public function getAdditionalBankIdentification() + { + return $this->container['additional_bank_identification']; + } + + /** + * Sets additional_bank_identification + * + * @param \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null $additional_bank_identification additional_bank_identification + * + * @return self + */ + public function setAdditionalBankIdentification($additional_bank_identification) + { + if (is_null($additional_bank_identification)) { + throw new \InvalidArgumentException('non-nullable additional_bank_identification cannot be null'); + } + $this->container['additional_bank_identification'] = $additional_bank_identification; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **numberAndBic** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php new file mode 100644 index 000000000..c50681a56 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -0,0 +1,319 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php new file mode 100644 index 000000000..f461856c9 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php @@ -0,0 +1,458 @@ + + */ +class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PLLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_PL_LOCAL = 'plLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PL_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'plLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **plLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php new file mode 100644 index 000000000..db123042f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php @@ -0,0 +1,464 @@ + + */ +class PaginatedAccountHoldersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaginatedAccountHoldersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_holders' => '\Adyen\Model\BalancePlatform\AccountHolder[]', + 'has_next' => 'bool', + 'has_previous' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_holders' => null, + 'has_next' => null, + 'has_previous' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_holders' => false, + 'has_next' => false, + 'has_previous' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_holders' => 'accountHolders', + 'has_next' => 'hasNext', + 'has_previous' => 'hasPrevious' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_holders' => 'setAccountHolders', + 'has_next' => 'setHasNext', + 'has_previous' => 'setHasPrevious' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_holders' => 'getAccountHolders', + 'has_next' => 'getHasNext', + 'has_previous' => 'getHasPrevious' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_holders', $data ?? [], null); + $this->setIfExists('has_next', $data ?? [], null); + $this->setIfExists('has_previous', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_holders'] === null) { + $invalidProperties[] = "'account_holders' can't be null"; + } + if ($this->container['has_next'] === null) { + $invalidProperties[] = "'has_next' can't be null"; + } + if ($this->container['has_previous'] === null) { + $invalidProperties[] = "'has_previous' 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 account_holders + * + * @return \Adyen\Model\BalancePlatform\AccountHolder[] + */ + public function getAccountHolders() + { + return $this->container['account_holders']; + } + + /** + * Sets account_holders + * + * @param \Adyen\Model\BalancePlatform\AccountHolder[] $account_holders List of account holders. + * + * @return self + */ + public function setAccountHolders($account_holders) + { + if (is_null($account_holders)) { + throw new \InvalidArgumentException('non-nullable account_holders cannot be null'); + } + $this->container['account_holders'] = $account_holders; + + return $this; + } + + /** + * Gets has_next + * + * @return bool + */ + public function getHasNext() + { + return $this->container['has_next']; + } + + /** + * Sets has_next + * + * @param bool $has_next Indicates whether there are more items on the next page. + * + * @return self + */ + public function setHasNext($has_next) + { + if (is_null($has_next)) { + throw new \InvalidArgumentException('non-nullable has_next cannot be null'); + } + $this->container['has_next'] = $has_next; + + return $this; + } + + /** + * Gets has_previous + * + * @return bool + */ + public function getHasPrevious() + { + return $this->container['has_previous']; + } + + /** + * Sets has_previous + * + * @param bool $has_previous Indicates whether there are more items on the previous page. + * + * @return self + */ + public function setHasPrevious($has_previous) + { + if (is_null($has_previous)) { + throw new \InvalidArgumentException('non-nullable has_previous cannot be null'); + } + $this->container['has_previous'] = $has_previous; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php new file mode 100644 index 000000000..d6e4f5f24 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php @@ -0,0 +1,464 @@ + + */ +class PaginatedBalanceAccountsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaginatedBalanceAccountsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_accounts' => '\Adyen\Model\BalancePlatform\BalanceAccount[]', + 'has_next' => 'bool', + 'has_previous' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_accounts' => null, + 'has_next' => null, + 'has_previous' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_accounts' => false, + 'has_next' => false, + 'has_previous' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_accounts' => 'balanceAccounts', + 'has_next' => 'hasNext', + 'has_previous' => 'hasPrevious' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_accounts' => 'setBalanceAccounts', + 'has_next' => 'setHasNext', + 'has_previous' => 'setHasPrevious' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_accounts' => 'getBalanceAccounts', + 'has_next' => 'getHasNext', + 'has_previous' => 'getHasPrevious' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_accounts', $data ?? [], null); + $this->setIfExists('has_next', $data ?? [], null); + $this->setIfExists('has_previous', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balance_accounts'] === null) { + $invalidProperties[] = "'balance_accounts' can't be null"; + } + if ($this->container['has_next'] === null) { + $invalidProperties[] = "'has_next' can't be null"; + } + if ($this->container['has_previous'] === null) { + $invalidProperties[] = "'has_previous' 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 balance_accounts + * + * @return \Adyen\Model\BalancePlatform\BalanceAccount[] + */ + public function getBalanceAccounts() + { + return $this->container['balance_accounts']; + } + + /** + * Sets balance_accounts + * + * @param \Adyen\Model\BalancePlatform\BalanceAccount[] $balance_accounts List of balance accounts. + * + * @return self + */ + public function setBalanceAccounts($balance_accounts) + { + if (is_null($balance_accounts)) { + throw new \InvalidArgumentException('non-nullable balance_accounts cannot be null'); + } + $this->container['balance_accounts'] = $balance_accounts; + + return $this; + } + + /** + * Gets has_next + * + * @return bool + */ + public function getHasNext() + { + return $this->container['has_next']; + } + + /** + * Sets has_next + * + * @param bool $has_next Indicates whether there are more items on the next page. + * + * @return self + */ + public function setHasNext($has_next) + { + if (is_null($has_next)) { + throw new \InvalidArgumentException('non-nullable has_next cannot be null'); + } + $this->container['has_next'] = $has_next; + + return $this; + } + + /** + * Gets has_previous + * + * @return bool + */ + public function getHasPrevious() + { + return $this->container['has_previous']; + } + + /** + * Sets has_previous + * + * @param bool $has_previous Indicates whether there are more items on the previous page. + * + * @return self + */ + public function setHasPrevious($has_previous) + { + if (is_null($has_previous)) { + throw new \InvalidArgumentException('non-nullable has_previous cannot be null'); + } + $this->container['has_previous'] = $has_previous; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php new file mode 100644 index 000000000..53fa5c833 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php @@ -0,0 +1,464 @@ + + */ +class PaginatedPaymentInstrumentsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaginatedPaymentInstrumentsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'has_next' => 'bool', + 'has_previous' => 'bool', + 'payment_instruments' => '\Adyen\Model\BalancePlatform\PaymentInstrument[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'has_next' => null, + 'has_previous' => null, + 'payment_instruments' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'has_next' => false, + 'has_previous' => false, + 'payment_instruments' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'has_next' => 'hasNext', + 'has_previous' => 'hasPrevious', + 'payment_instruments' => 'paymentInstruments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'has_next' => 'setHasNext', + 'has_previous' => 'setHasPrevious', + 'payment_instruments' => 'setPaymentInstruments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'has_next' => 'getHasNext', + 'has_previous' => 'getHasPrevious', + 'payment_instruments' => 'getPaymentInstruments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('has_next', $data ?? [], null); + $this->setIfExists('has_previous', $data ?? [], null); + $this->setIfExists('payment_instruments', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['has_next'] === null) { + $invalidProperties[] = "'has_next' can't be null"; + } + if ($this->container['has_previous'] === null) { + $invalidProperties[] = "'has_previous' can't be null"; + } + if ($this->container['payment_instruments'] === null) { + $invalidProperties[] = "'payment_instruments' 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 has_next + * + * @return bool + */ + public function getHasNext() + { + return $this->container['has_next']; + } + + /** + * Sets has_next + * + * @param bool $has_next Indicates whether there are more items on the next page. + * + * @return self + */ + public function setHasNext($has_next) + { + if (is_null($has_next)) { + throw new \InvalidArgumentException('non-nullable has_next cannot be null'); + } + $this->container['has_next'] = $has_next; + + return $this; + } + + /** + * Gets has_previous + * + * @return bool + */ + public function getHasPrevious() + { + return $this->container['has_previous']; + } + + /** + * Sets has_previous + * + * @param bool $has_previous Indicates whether there are more items on the previous page. + * + * @return self + */ + public function setHasPrevious($has_previous) + { + if (is_null($has_previous)) { + throw new \InvalidArgumentException('non-nullable has_previous cannot be null'); + } + $this->container['has_previous'] = $has_previous; + + return $this; + } + + /** + * Gets payment_instruments + * + * @return \Adyen\Model\BalancePlatform\PaymentInstrument[] + */ + public function getPaymentInstruments() + { + return $this->container['payment_instruments']; + } + + /** + * Sets payment_instruments + * + * @param \Adyen\Model\BalancePlatform\PaymentInstrument[] $payment_instruments List of payment instruments associated with the balance account. + * + * @return self + */ + public function setPaymentInstruments($payment_instruments) + { + if (is_null($payment_instruments)) { + throw new \InvalidArgumentException('non-nullable payment_instruments cannot be null'); + } + $this->container['payment_instruments'] = $payment_instruments; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php new file mode 100644 index 000000000..6e300bb5b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -0,0 +1,854 @@ + + */ +class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_account_id' => 'string', + 'bank_account' => '\Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount', + 'card' => '\Adyen\Model\BalancePlatform\Card', + 'description' => 'string', + 'id' => 'string', + 'issuing_country_code' => 'string', + 'payment_instrument_group_id' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'status_reason' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_account_id' => null, + 'bank_account' => null, + 'card' => null, + 'description' => null, + 'id' => null, + 'issuing_country_code' => null, + 'payment_instrument_group_id' => null, + 'reference' => null, + 'status' => null, + 'status_reason' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_account_id' => false, + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_account_id' => 'balanceAccountId', + 'bank_account' => 'bankAccount', + 'card' => 'card', + 'description' => 'description', + 'id' => 'id', + 'issuing_country_code' => 'issuingCountryCode', + 'payment_instrument_group_id' => 'paymentInstrumentGroupId', + 'reference' => 'reference', + 'status' => 'status', + 'status_reason' => 'statusReason', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_account_id' => 'setBalanceAccountId', + 'bank_account' => 'setBankAccount', + 'card' => 'setCard', + 'description' => 'setDescription', + 'id' => 'setId', + 'issuing_country_code' => 'setIssuingCountryCode', + 'payment_instrument_group_id' => 'setPaymentInstrumentGroupId', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'status_reason' => 'setStatusReason', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_account_id' => 'getBalanceAccountId', + 'bank_account' => 'getBankAccount', + 'card' => 'getCard', + 'description' => 'getDescription', + 'id' => 'getId', + 'issuing_country_code' => 'getIssuingCountryCode', + 'payment_instrument_group_id' => 'getPaymentInstrumentGroupId', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'status_reason' => 'getStatusReason', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + public const STATUS_REASON_ACCOUNT_CLOSURE = 'accountClosure'; + public const STATUS_REASON_DAMAGED = 'damaged'; + public const STATUS_REASON_END_OF_LIFE = 'endOfLife'; + public const STATUS_REASON_EXPIRED = 'expired'; + public const STATUS_REASON_LOST = 'lost'; + public const STATUS_REASON_OTHER = 'other'; + public const STATUS_REASON_STOLEN = 'stolen'; + public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const TYPE_BANK_ACCOUNT = 'bankAccount'; + public const TYPE_CARD = 'card'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusReasonAllowableValues() + { + return [ + self::STATUS_REASON_ACCOUNT_CLOSURE, + self::STATUS_REASON_DAMAGED, + self::STATUS_REASON_END_OF_LIFE, + self::STATUS_REASON_EXPIRED, + self::STATUS_REASON_LOST, + self::STATUS_REASON_OTHER, + self::STATUS_REASON_STOLEN, + self::STATUS_REASON_SUSPECTED_FRAUD, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK_ACCOUNT, + self::TYPE_CARD, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_account_id', $data ?? [], null); + $this->setIfExists('bank_account', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('issuing_country_code', $data ?? [], null); + $this->setIfExists('payment_instrument_group_id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('status_reason', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balance_account_id'] === null) { + $invalidProperties[] = "'balance_account_id' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['issuing_country_code'] === null) { + $invalidProperties[] = "'issuing_country_code' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!is_null($this->container['status_reason']) && !in_array($this->container['status_reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status_reason', must be one of '%s'", + $this->container['status_reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance_account_id + * + * @return string + */ + public function getBalanceAccountId() + { + return $this->container['balance_account_id']; + } + + /** + * Sets balance_account_id + * + * @param string $balance_account_id The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + * + * @return self + */ + public function setBalanceAccountId($balance_account_id) + { + if (is_null($balance_account_id)) { + throw new \InvalidArgumentException('non-nullable balance_account_id cannot be null'); + } + $this->container['balance_account_id'] = $balance_account_id; + + return $this; + } + + /** + * Gets bank_account + * + * @return \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null + */ + public function getBankAccount() + { + return $this->container['bank_account']; + } + + /** + * Sets bank_account + * + * @param \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null $bank_account bank_account + * + * @return self + */ + public function setBankAccount($bank_account) + { + if (is_null($bank_account)) { + throw new \InvalidArgumentException('non-nullable bank_account cannot be null'); + } + $this->container['bank_account'] = $bank_account; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\BalancePlatform\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\BalancePlatform\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the payment instrument, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the payment instrument. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets issuing_country_code + * + * @return string + */ + public function getIssuingCountryCode() + { + return $this->container['issuing_country_code']; + } + + /** + * Sets issuing_country_code + * + * @param string $issuing_country_code The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + * + * @return self + */ + public function setIssuingCountryCode($issuing_country_code) + { + if (is_null($issuing_country_code)) { + throw new \InvalidArgumentException('non-nullable issuing_country_code cannot be null'); + } + $this->container['issuing_country_code'] = $issuing_country_code; + + return $this; + } + + /** + * Gets payment_instrument_group_id + * + * @return string|null + */ + public function getPaymentInstrumentGroupId() + { + return $this->container['payment_instrument_group_id']; + } + + /** + * Sets payment_instrument_group_id + * + * @param string|null $payment_instrument_group_id The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + * + * @return self + */ + public function setPaymentInstrumentGroupId($payment_instrument_group_id) + { + if (is_null($payment_instrument_group_id)) { + throw new \InvalidArgumentException('non-nullable payment_instrument_group_id cannot be null'); + } + $this->container['payment_instrument_group_id'] = $payment_instrument_group_id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment instrument, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets status_reason + * + * @return string|null + */ + public function getStatusReason() + { + return $this->container['status_reason']; + } + + /** + * Sets status_reason + * + * @param string|null $status_reason The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * + * @return self + */ + public function setStatusReason($status_reason) + { + if (is_null($status_reason)) { + throw new \InvalidArgumentException('non-nullable status_reason cannot be null'); + } + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!in_array($status_reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status_reason', must be one of '%s'", + $status_reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status_reason'] = $status_reason; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php new file mode 100644 index 000000000..3a941f5dd --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php @@ -0,0 +1,537 @@ + + */ +class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrument_bankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'iban' => 'string', + 'type' => 'string', + 'account_number' => 'string', + 'account_type' => 'string', + 'routing_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'iban' => null, + 'type' => null, + 'account_number' => null, + 'account_type' => null, + 'routing_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'iban' => false, + 'type' => false, + 'account_number' => false, + 'account_type' => false, + 'routing_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'iban' => 'iban', + 'type' => 'type', + 'account_number' => 'accountNumber', + 'account_type' => 'accountType', + 'routing_number' => 'routingNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'iban' => 'setIban', + 'type' => 'setType', + 'account_number' => 'setAccountNumber', + 'account_type' => 'setAccountType', + 'routing_number' => 'setRoutingNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'iban' => 'getIban', + 'type' => 'getType', + 'account_number' => 'getAccountNumber', + 'account_type' => 'getAccountType', + 'routing_number' => 'getRoutingNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('account_type', $data ?? [], 'checking'); + $this->setIfExists('routing_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + + if ($this->container['routing_number'] === null) { + $invalidProperties[] = "'routing_number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets routing_number + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routing_number']; + } + + /** + * Sets routing_number + * + * @param string $routing_number The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routing_number) + { + if (is_null($routing_number)) { + throw new \InvalidArgumentException('non-nullable routing_number cannot be null'); + } + $this->container['routing_number'] = $routing_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php new file mode 100644 index 000000000..a19088ee9 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php @@ -0,0 +1,563 @@ + + */ +class PaymentInstrumentGroup implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_platform' => 'string', + 'description' => 'string', + 'id' => 'string', + 'properties' => 'array', + 'reference' => 'string', + 'tx_variant' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_platform' => null, + 'description' => null, + 'id' => null, + 'properties' => null, + 'reference' => null, + 'tx_variant' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_platform' => false, + 'description' => false, + 'id' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_platform' => 'balancePlatform', + 'description' => 'description', + 'id' => 'id', + 'properties' => 'properties', + 'reference' => 'reference', + 'tx_variant' => 'txVariant' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_platform' => 'setBalancePlatform', + 'description' => 'setDescription', + 'id' => 'setId', + 'properties' => 'setProperties', + 'reference' => 'setReference', + 'tx_variant' => 'setTxVariant' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_platform' => 'getBalancePlatform', + 'description' => 'getDescription', + 'id' => 'getId', + 'properties' => 'getProperties', + 'reference' => 'getReference', + 'tx_variant' => 'getTxVariant' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_platform', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('tx_variant', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balance_platform'] === null) { + $invalidProperties[] = "'balance_platform' can't be null"; + } + if ($this->container['tx_variant'] === null) { + $invalidProperties[] = "'tx_variant' 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 balance_platform + * + * @return string + */ + public function getBalancePlatform() + { + return $this->container['balance_platform']; + } + + /** + * Sets balance_platform + * + * @param string $balance_platform The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the payment instrument group belongs. + * + * @return self + */ + public function setBalancePlatform($balance_platform) + { + if (is_null($balance_platform)) { + throw new \InvalidArgumentException('non-nullable balance_platform cannot be null'); + } + $this->container['balance_platform'] = $balance_platform; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the payment instrument group, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the payment instrument group. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets properties + * + * @return array|null + */ + public function getProperties() + { + return $this->container['properties']; + } + + /** + * Sets properties + * + * @param array|null $properties Properties of the payment instrument group. + * + * @return self + */ + public function setProperties($properties) + { + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); + } + $this->container['properties'] = $properties; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment instrument group, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets tx_variant + * + * @return string + */ + public function getTxVariant() + { + return $this->container['tx_variant']; + } + + /** + * Sets tx_variant + * + * @param string $tx_variant The tx variant of the payment instrument group. + * + * @return self + */ + public function setTxVariant($tx_variant) + { + if (is_null($tx_variant)) { + throw new \InvalidArgumentException('non-nullable tx_variant cannot be null'); + } + $this->container['tx_variant'] = $tx_variant; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php new file mode 100644 index 000000000..39e4fd53b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php @@ -0,0 +1,529 @@ + + */ +class PaymentInstrumentGroupInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentGroupInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_platform' => 'string', + 'description' => 'string', + 'properties' => 'array', + 'reference' => 'string', + 'tx_variant' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_platform' => null, + 'description' => null, + 'properties' => null, + 'reference' => null, + 'tx_variant' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_platform' => false, + 'description' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_platform' => 'balancePlatform', + 'description' => 'description', + 'properties' => 'properties', + 'reference' => 'reference', + 'tx_variant' => 'txVariant' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_platform' => 'setBalancePlatform', + 'description' => 'setDescription', + 'properties' => 'setProperties', + 'reference' => 'setReference', + 'tx_variant' => 'setTxVariant' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_platform' => 'getBalancePlatform', + 'description' => 'getDescription', + 'properties' => 'getProperties', + 'reference' => 'getReference', + 'tx_variant' => 'getTxVariant' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_platform', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('tx_variant', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balance_platform'] === null) { + $invalidProperties[] = "'balance_platform' can't be null"; + } + if ($this->container['tx_variant'] === null) { + $invalidProperties[] = "'tx_variant' 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 balance_platform + * + * @return string + */ + public function getBalancePlatform() + { + return $this->container['balance_platform']; + } + + /** + * Sets balance_platform + * + * @param string $balance_platform The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the payment instrument group belongs. + * + * @return self + */ + public function setBalancePlatform($balance_platform) + { + if (is_null($balance_platform)) { + throw new \InvalidArgumentException('non-nullable balance_platform cannot be null'); + } + $this->container['balance_platform'] = $balance_platform; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the payment instrument group, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets properties + * + * @return array|null + */ + public function getProperties() + { + return $this->container['properties']; + } + + /** + * Sets properties + * + * @param array|null $properties Properties of the payment instrument group. + * + * @return self + */ + public function setProperties($properties) + { + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); + } + $this->container['properties'] = $properties; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment instrument group, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets tx_variant + * + * @return string + */ + public function getTxVariant() + { + return $this->container['tx_variant']; + } + + /** + * Sets tx_variant + * + * @param string $tx_variant The tx variant of the payment instrument group. + * + * @return self + */ + public function setTxVariant($tx_variant) + { + if (is_null($tx_variant)) { + throw new \InvalidArgumentException('non-nullable tx_variant cannot be null'); + } + $this->container['tx_variant'] = $tx_variant; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php new file mode 100644 index 000000000..558664dd3 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -0,0 +1,783 @@ + + */ +class PaymentInstrumentInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_account_id' => 'string', + 'card' => '\Adyen\Model\BalancePlatform\CardInfo', + 'description' => 'string', + 'issuing_country_code' => 'string', + 'payment_instrument_group_id' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'status_reason' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_account_id' => null, + 'card' => null, + 'description' => null, + 'issuing_country_code' => null, + 'payment_instrument_group_id' => null, + 'reference' => null, + 'status' => null, + 'status_reason' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_account_id' => false, + 'card' => false, + 'description' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_account_id' => 'balanceAccountId', + 'card' => 'card', + 'description' => 'description', + 'issuing_country_code' => 'issuingCountryCode', + 'payment_instrument_group_id' => 'paymentInstrumentGroupId', + 'reference' => 'reference', + 'status' => 'status', + 'status_reason' => 'statusReason', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_account_id' => 'setBalanceAccountId', + 'card' => 'setCard', + 'description' => 'setDescription', + 'issuing_country_code' => 'setIssuingCountryCode', + 'payment_instrument_group_id' => 'setPaymentInstrumentGroupId', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'status_reason' => 'setStatusReason', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_account_id' => 'getBalanceAccountId', + 'card' => 'getCard', + 'description' => 'getDescription', + 'issuing_country_code' => 'getIssuingCountryCode', + 'payment_instrument_group_id' => 'getPaymentInstrumentGroupId', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'status_reason' => 'getStatusReason', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + public const STATUS_REASON_ACCOUNT_CLOSURE = 'accountClosure'; + public const STATUS_REASON_DAMAGED = 'damaged'; + public const STATUS_REASON_END_OF_LIFE = 'endOfLife'; + public const STATUS_REASON_EXPIRED = 'expired'; + public const STATUS_REASON_LOST = 'lost'; + public const STATUS_REASON_OTHER = 'other'; + public const STATUS_REASON_STOLEN = 'stolen'; + public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const TYPE_BANK_ACCOUNT = 'bankAccount'; + public const TYPE_CARD = 'card'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusReasonAllowableValues() + { + return [ + self::STATUS_REASON_ACCOUNT_CLOSURE, + self::STATUS_REASON_DAMAGED, + self::STATUS_REASON_END_OF_LIFE, + self::STATUS_REASON_EXPIRED, + self::STATUS_REASON_LOST, + self::STATUS_REASON_OTHER, + self::STATUS_REASON_STOLEN, + self::STATUS_REASON_SUSPECTED_FRAUD, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK_ACCOUNT, + self::TYPE_CARD, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_account_id', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('issuing_country_code', $data ?? [], null); + $this->setIfExists('payment_instrument_group_id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('status_reason', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balance_account_id'] === null) { + $invalidProperties[] = "'balance_account_id' can't be null"; + } + if ($this->container['issuing_country_code'] === null) { + $invalidProperties[] = "'issuing_country_code' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!is_null($this->container['status_reason']) && !in_array($this->container['status_reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status_reason', must be one of '%s'", + $this->container['status_reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance_account_id + * + * @return string + */ + public function getBalanceAccountId() + { + return $this->container['balance_account_id']; + } + + /** + * Sets balance_account_id + * + * @param string $balance_account_id The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + * + * @return self + */ + public function setBalanceAccountId($balance_account_id) + { + if (is_null($balance_account_id)) { + throw new \InvalidArgumentException('non-nullable balance_account_id cannot be null'); + } + $this->container['balance_account_id'] = $balance_account_id; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\BalancePlatform\CardInfo|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\BalancePlatform\CardInfo|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the payment instrument, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets issuing_country_code + * + * @return string + */ + public function getIssuingCountryCode() + { + return $this->container['issuing_country_code']; + } + + /** + * Sets issuing_country_code + * + * @param string $issuing_country_code The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + * + * @return self + */ + public function setIssuingCountryCode($issuing_country_code) + { + if (is_null($issuing_country_code)) { + throw new \InvalidArgumentException('non-nullable issuing_country_code cannot be null'); + } + $this->container['issuing_country_code'] = $issuing_country_code; + + return $this; + } + + /** + * Gets payment_instrument_group_id + * + * @return string|null + */ + public function getPaymentInstrumentGroupId() + { + return $this->container['payment_instrument_group_id']; + } + + /** + * Sets payment_instrument_group_id + * + * @param string|null $payment_instrument_group_id The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + * + * @return self + */ + public function setPaymentInstrumentGroupId($payment_instrument_group_id) + { + if (is_null($payment_instrument_group_id)) { + throw new \InvalidArgumentException('non-nullable payment_instrument_group_id cannot be null'); + } + $this->container['payment_instrument_group_id'] = $payment_instrument_group_id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment instrument, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets status_reason + * + * @return string|null + */ + public function getStatusReason() + { + return $this->container['status_reason']; + } + + /** + * Sets status_reason + * + * @param string|null $status_reason The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * + * @return self + */ + public function setStatusReason($status_reason) + { + if (is_null($status_reason)) { + throw new \InvalidArgumentException('non-nullable status_reason cannot be null'); + } + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!in_array($status_reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status_reason', must be one of '%s'", + $status_reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status_reason'] = $status_reason; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php new file mode 100644 index 000000000..9c83b8108 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php @@ -0,0 +1,464 @@ + + */ +class PaymentInstrumentRevealInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentRevealInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cvc' => 'string', + 'expiration' => '\Adyen\Model\BalancePlatform\Expiry', + 'pan' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cvc' => null, + 'expiration' => null, + 'pan' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cvc' => false, + 'expiration' => false, + 'pan' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cvc' => 'cvc', + 'expiration' => 'expiration', + 'pan' => 'pan' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cvc' => 'setCvc', + 'expiration' => 'setExpiration', + 'pan' => 'setPan' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cvc' => 'getCvc', + 'expiration' => 'getExpiration', + 'pan' => 'getPan' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('expiration', $data ?? [], null); + $this->setIfExists('pan', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cvc'] === null) { + $invalidProperties[] = "'cvc' can't be null"; + } + if ($this->container['expiration'] === null) { + $invalidProperties[] = "'expiration' can't be null"; + } + if ($this->container['pan'] === null) { + $invalidProperties[] = "'pan' 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 cvc + * + * @return string + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string $cvc The CVC2 value of the card. + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets expiration + * + * @return \Adyen\Model\BalancePlatform\Expiry + */ + public function getExpiration() + { + return $this->container['expiration']; + } + + /** + * Sets expiration + * + * @param \Adyen\Model\BalancePlatform\Expiry $expiration expiration + * + * @return self + */ + public function setExpiration($expiration) + { + if (is_null($expiration)) { + throw new \InvalidArgumentException('non-nullable expiration cannot be null'); + } + $this->container['expiration'] = $expiration; + + return $this; + } + + /** + * Gets pan + * + * @return string + */ + public function getPan() + { + return $this->container['pan']; + } + + /** + * Sets pan + * + * @param string $pan The primary account number (PAN) of the card. + * + * @return self + */ + public function setPan($pan) + { + if (is_null($pan)) { + throw new \InvalidArgumentException('non-nullable pan cannot be null'); + } + $this->container['pan'] = $pan; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php new file mode 100644 index 000000000..70861a974 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php @@ -0,0 +1,605 @@ + + */ +class PaymentInstrumentUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_account_id' => 'string', + 'card' => '\Adyen\Model\BalancePlatform\CardInfo', + 'status' => 'string', + 'status_comment' => 'string', + 'status_reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_account_id' => null, + 'card' => null, + 'status' => null, + 'status_comment' => null, + 'status_reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_account_id' => false, + 'card' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_account_id' => 'balanceAccountId', + 'card' => 'card', + 'status' => 'status', + 'status_comment' => 'statusComment', + 'status_reason' => 'statusReason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_account_id' => 'setBalanceAccountId', + 'card' => 'setCard', + 'status' => 'setStatus', + 'status_comment' => 'setStatusComment', + 'status_reason' => 'setStatusReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_account_id' => 'getBalanceAccountId', + 'card' => 'getCard', + 'status' => 'getStatus', + 'status_comment' => 'getStatusComment', + 'status_reason' => 'getStatusReason' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + public const STATUS_REASON_ACCOUNT_CLOSURE = 'accountClosure'; + public const STATUS_REASON_DAMAGED = 'damaged'; + public const STATUS_REASON_END_OF_LIFE = 'endOfLife'; + public const STATUS_REASON_EXPIRED = 'expired'; + public const STATUS_REASON_LOST = 'lost'; + public const STATUS_REASON_OTHER = 'other'; + public const STATUS_REASON_STOLEN = 'stolen'; + public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusReasonAllowableValues() + { + return [ + self::STATUS_REASON_ACCOUNT_CLOSURE, + self::STATUS_REASON_DAMAGED, + self::STATUS_REASON_END_OF_LIFE, + self::STATUS_REASON_EXPIRED, + self::STATUS_REASON_LOST, + self::STATUS_REASON_OTHER, + self::STATUS_REASON_STOLEN, + self::STATUS_REASON_SUSPECTED_FRAUD, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_account_id', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('status_comment', $data ?? [], null); + $this->setIfExists('status_reason', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!is_null($this->container['status_reason']) && !in_array($this->container['status_reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status_reason', must be one of '%s'", + $this->container['status_reason'], + 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 balance_account_id + * + * @return string|null + */ + public function getBalanceAccountId() + { + return $this->container['balance_account_id']; + } + + /** + * Sets balance_account_id + * + * @param string|null $balance_account_id The unique identifier of the balance account associated with this payment instrument. >You can only change the balance account ID if the payment instrument has **inactive** status. + * + * @return self + */ + public function setBalanceAccountId($balance_account_id) + { + if (is_null($balance_account_id)) { + throw new \InvalidArgumentException('non-nullable balance_account_id cannot be null'); + } + $this->container['balance_account_id'] = $balance_account_id; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\BalancePlatform\CardInfo|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\BalancePlatform\CardInfo|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets status_comment + * + * @return string|null + */ + public function getStatusComment() + { + return $this->container['status_comment']; + } + + /** + * Sets status_comment + * + * @param string|null $status_comment Comment for the status of the payment instrument. Required if `statusReason` is **other**. + * + * @return self + */ + public function setStatusComment($status_comment) + { + if (is_null($status_comment)) { + throw new \InvalidArgumentException('non-nullable status_comment cannot be null'); + } + $this->container['status_comment'] = $status_comment; + + return $this; + } + + /** + * Gets status_reason + * + * @return string|null + */ + public function getStatusReason() + { + return $this->container['status_reason']; + } + + /** + * Sets status_reason + * + * @param string|null $status_reason The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * + * @return self + */ + public function setStatusReason($status_reason) + { + if (is_null($status_reason)) { + throw new \InvalidArgumentException('non-nullable status_reason cannot be null'); + } + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!in_array($status_reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status_reason', must be one of '%s'", + $status_reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status_reason'] = $status_reason; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Phone.php b/src/Adyen/Model/BalancePlatform/Phone.php new file mode 100644 index 000000000..1677aa9b2 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Phone.php @@ -0,0 +1,460 @@ + + */ +class Phone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Phone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'number' => 'number', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'number' => 'setNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'number' => 'getNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_LANDLINE = 'landline'; + public const TYPE_MOBILE = 'mobile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_LANDLINE, + self::TYPE_MOBILE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['number'] === null) { + $invalidProperties[] = "'number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of phone number. Possible values: **Landline**, **Mobile**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PhoneNumber.php b/src/Adyen/Model/BalancePlatform/PhoneNumber.php new file mode 100644 index 000000000..49ee0c287 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PhoneNumber.php @@ -0,0 +1,492 @@ + + */ +class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PhoneNumber'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'phone_country_code' => 'string', + 'phone_number' => 'string', + 'phone_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'phone_country_code' => null, + 'phone_number' => null, + 'phone_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'phone_country_code' => false, + 'phone_number' => false, + 'phone_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'phone_country_code' => 'phoneCountryCode', + 'phone_number' => 'phoneNumber', + 'phone_type' => 'phoneType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'phone_country_code' => 'setPhoneCountryCode', + 'phone_number' => 'setPhoneNumber', + 'phone_type' => 'setPhoneType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'phone_country_code' => 'getPhoneCountryCode', + 'phone_number' => 'getPhoneNumber', + 'phone_type' => 'getPhoneType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const PHONE_TYPE_FAX = 'Fax'; + public const PHONE_TYPE_LANDLINE = 'Landline'; + public const PHONE_TYPE_MOBILE = 'Mobile'; + public const PHONE_TYPE_SIP = 'SIP'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPhoneTypeAllowableValues() + { + return [ + self::PHONE_TYPE_FAX, + self::PHONE_TYPE_LANDLINE, + self::PHONE_TYPE_MOBILE, + self::PHONE_TYPE_SIP, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('phone_country_code', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('phone_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getPhoneTypeAllowableValues(); + if (!is_null($this->container['phone_type']) && !in_array($this->container['phone_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'phone_type', must be one of '%s'", + $this->container['phone_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 phone_country_code + * + * @return string|null + */ + public function getPhoneCountryCode() + { + return $this->container['phone_country_code']; + } + + /** + * Sets phone_country_code + * + * @param string|null $phone_country_code The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**. + * + * @return self + */ + public function setPhoneCountryCode($phone_country_code) + { + if (is_null($phone_country_code)) { + throw new \InvalidArgumentException('non-nullable phone_country_code cannot be null'); + } + $this->container['phone_country_code'] = $phone_country_code; + + 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. The inclusion of the phone number country code is not necessary. + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets phone_type + * + * @return string|null + */ + public function getPhoneType() + { + return $this->container['phone_type']; + } + + /** + * Sets phone_type + * + * @param string|null $phone_type The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. + * + * @return self + */ + public function setPhoneType($phone_type) + { + if (is_null($phone_type)) { + throw new \InvalidArgumentException('non-nullable phone_type cannot be null'); + } + $allowedValues = $this->getPhoneTypeAllowableValues(); + if (!in_array($phone_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'phone_type', must be one of '%s'", + $phone_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['phone_type'] = $phone_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php new file mode 100644 index 000000000..22aec905d --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php @@ -0,0 +1,459 @@ + + */ +class ProcessingTypesRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ProcessingTypesRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_ATM_WITHDRAW = 'atmWithdraw'; + public const VALUE_BALANCE_INQUIRY = 'balanceInquiry'; + public const VALUE_ECOMMERCE = 'ecommerce'; + public const VALUE_MOTO = 'moto'; + public const VALUE_POS = 'pos'; + public const VALUE_RECURRING = 'recurring'; + public const VALUE_TOKEN = 'token'; + public const VALUE_UNKNOWN = 'unknown'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_ATM_WITHDRAW, + self::VALUE_BALANCE_INQUIRY, + self::VALUE_ECOMMERCE, + self::VALUE_MOTO, + self::VALUE_POS, + self::VALUE_RECURRING, + self::VALUE_TOKEN, + self::VALUE_UNKNOWN, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string[]|null $value List of processing types. Possible values: **atmWithdraw**, **balanceInquiry**, **ecommerce**, **moto**, **pos**, **recurring**, **token**. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (array_diff($value, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'value', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/RestServiceError.php b/src/Adyen/Model/BalancePlatform/RestServiceError.php new file mode 100644 index 000000000..3de3284ba --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RestServiceError.php @@ -0,0 +1,672 @@ + + */ +class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RestServiceError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'error_code' => 'string', + 'instance' => 'string', + 'invalid_fields' => '\Adyen\Model\BalancePlatform\InvalidField[]', + 'request_id' => 'string', + 'response' => '\Adyen\Model\BalancePlatform\JSONObject', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'error_code' => null, + 'instance' => null, + 'invalid_fields' => null, + 'request_id' => null, + 'response' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'error_code' => false, + 'instance' => false, + 'invalid_fields' => false, + 'request_id' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detail' => 'detail', + 'error_code' => 'errorCode', + 'instance' => 'instance', + 'invalid_fields' => 'invalidFields', + 'request_id' => 'requestId', + 'response' => 'response', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'error_code' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalid_fields' => 'setInvalidFields', + 'request_id' => 'setRequestId', + 'response' => 'setResponse', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'error_code' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalid_fields' => 'getInvalidFields', + 'request_id' => 'getRequestId', + 'response' => 'getResponse', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalid_fields', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('response', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detail'] === null) { + $invalidProperties[] = "'detail' can't be null"; + } + if ($this->container['error_code'] === null) { + $invalidProperties[] = "'error_code' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets error_code + * + * @return string + */ + public function getErrorCode() + { + return $this->container['error_code']; + } + + /** + * Sets error_code + * + * @param string $error_code A code that identifies the problem type. + * + * @return self + */ + public function setErrorCode($error_code) + { + if (is_null($error_code)) { + throw new \InvalidArgumentException('non-nullable error_code cannot be null'); + } + $this->container['error_code'] = $error_code; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A unique URI that identifies the specific occurrence of the problem. + * + * @return self + */ + public function setInstance($instance) + { + if (is_null($instance)) { + throw new \InvalidArgumentException('non-nullable instance cannot be null'); + } + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalid_fields + * + * @return \Adyen\Model\BalancePlatform\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalid_fields']; + } + + /** + * Sets invalid_fields + * + * @param \Adyen\Model\BalancePlatform\InvalidField[]|null $invalid_fields Detailed explanation of each validation error, when applicable. + * + * @return self + */ + public function setInvalidFields($invalid_fields) + { + if (is_null($invalid_fields)) { + throw new \InvalidArgumentException('non-nullable invalid_fields cannot be null'); + } + $this->container['invalid_fields'] = $invalid_fields; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A unique reference for the request, essentially the same as `pspReference`. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets response + * + * @return \Adyen\Model\BalancePlatform\JSONObject|null + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param \Adyen\Model\BalancePlatform\JSONObject|null $response response + * + * @return self + */ + public function setResponse($response) + { + if (is_null($response)) { + throw new \InvalidArgumentException('non-nullable response cannot be null'); + } + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + // Do nothing for nullable integers + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type A URI that identifies the problem type, pointing to human-readable documentation on this problem type. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php new file mode 100644 index 000000000..30f219400 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php @@ -0,0 +1,495 @@ + + */ +class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SELocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'clearing_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'clearing_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'clearing_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'clearing_number' => 'clearingNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'clearing_number' => 'setClearingNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'clearing_number' => 'getClearingNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SE_LOCAL = 'seLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SE_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('clearing_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'seLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['clearing_number'] === null) { + $invalidProperties[] = "'clearing_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets clearing_number + * + * @return string + */ + public function getClearingNumber() + { + return $this->container['clearing_number']; + } + + /** + * Sets clearing_number + * + * @param string $clearing_number The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + * + * @return self + */ + public function setClearingNumber($clearing_number) + { + if (is_null($clearing_number)) { + throw new \InvalidArgumentException('non-nullable clearing_number cannot be null'); + } + $this->container['clearing_number'] = $clearing_number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **seLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php new file mode 100644 index 000000000..8322532bd --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php @@ -0,0 +1,492 @@ + + */ +class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SGLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'bic' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'bic' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'bic' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'bic' => 'bic', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'bic' => 'setBic', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'bic' => 'getBic', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SG_LOCAL = 'sgLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SG_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'sgLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 4- to 19-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **sgLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/StringMatch.php b/src/Adyen/Model/BalancePlatform/StringMatch.php new file mode 100644 index 000000000..5e93be9ae --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/StringMatch.php @@ -0,0 +1,458 @@ + + */ +class StringMatch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StringMatch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const OPERATION_CONTAINS = 'contains'; + public const OPERATION_ENDS_WITH = 'endsWith'; + public const OPERATION_IS_EQUAL_TO = 'isEqualTo'; + public const OPERATION_STARTS_WITH = 'startsWith'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOperationAllowableValues() + { + return [ + self::OPERATION_CONTAINS, + self::OPERATION_ENDS_WITH, + self::OPERATION_IS_EQUAL_TO, + self::OPERATION_STARTS_WITH, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getOperationAllowableValues(); + if (!is_null($this->container['operation']) && !in_array($this->container['operation'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'operation', must be one of '%s'", + $this->container['operation'], + 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 operation + * + * @return string|null + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string|null $operation The type of string matching operation. Possible values: **startsWith**, **endsWith**, **isEqualTo**, **contains**, + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $allowedValues = $this->getOperationAllowableValues(); + if (!in_array($operation, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operation', must be one of '%s'", + $operation, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The string to be matched. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php new file mode 100644 index 000000000..f89d8b96e --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -0,0 +1,996 @@ + + */ +class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepConfigurationV2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'category' => 'string', + 'counterparty' => '\Adyen\Model\BalancePlatform\SweepCounterparty', + 'currency' => 'string', + 'description' => 'string', + 'id' => 'string', + 'priorities' => 'string[]', + 'reason' => 'string', + 'schedule' => '\Adyen\Model\BalancePlatform\SweepConfigurationV2Schedule', + 'status' => 'string', + 'sweep_amount' => '\Adyen\Model\BalancePlatform\Amount', + 'target_amount' => '\Adyen\Model\BalancePlatform\Amount', + 'trigger_amount' => '\Adyen\Model\BalancePlatform\Amount', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'category' => null, + 'counterparty' => null, + 'currency' => null, + 'description' => null, + 'id' => null, + 'priorities' => null, + 'reason' => null, + 'schedule' => null, + 'status' => null, + 'sweep_amount' => null, + 'target_amount' => null, + 'trigger_amount' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'category' => false, + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweep_amount' => false, + 'target_amount' => false, + 'trigger_amount' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'category' => 'category', + 'counterparty' => 'counterparty', + 'currency' => 'currency', + 'description' => 'description', + 'id' => 'id', + 'priorities' => 'priorities', + 'reason' => 'reason', + 'schedule' => 'schedule', + 'status' => 'status', + 'sweep_amount' => 'sweepAmount', + 'target_amount' => 'targetAmount', + 'trigger_amount' => 'triggerAmount', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'category' => 'setCategory', + 'counterparty' => 'setCounterparty', + 'currency' => 'setCurrency', + 'description' => 'setDescription', + 'id' => 'setId', + 'priorities' => 'setPriorities', + 'reason' => 'setReason', + 'schedule' => 'setSchedule', + 'status' => 'setStatus', + 'sweep_amount' => 'setSweepAmount', + 'target_amount' => 'setTargetAmount', + 'trigger_amount' => 'setTriggerAmount', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'category' => 'getCategory', + 'counterparty' => 'getCounterparty', + 'currency' => 'getCurrency', + 'description' => 'getDescription', + 'id' => 'getId', + 'priorities' => 'getPriorities', + 'reason' => 'getReason', + 'schedule' => 'getSchedule', + 'status' => 'getStatus', + 'sweep_amount' => 'getSweepAmount', + 'target_amount' => 'getTargetAmount', + 'trigger_amount' => 'getTriggerAmount', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CATEGORY_BANK = 'bank'; + public const CATEGORY_INTERNAL = 'internal'; + public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const PRIORITIES_CROSS_BORDER = 'crossBorder'; + public const PRIORITIES_DIRECT_DEBIT = 'directDebit'; + public const PRIORITIES_FAST = 'fast'; + public const PRIORITIES_INSTANT = 'instant'; + public const PRIORITIES_INTERNAL = 'internal'; + public const PRIORITIES_REGULAR = 'regular'; + public const PRIORITIES_WIRE = 'wire'; + public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; + public const REASON_APPROVED = 'approved'; + public const REASON_COUNTERPARTY_ACCOUNT_BLOCKED = 'counterpartyAccountBlocked'; + public const REASON_COUNTERPARTY_ACCOUNT_CLOSED = 'counterpartyAccountClosed'; + public const REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND = 'counterpartyAccountNotFound'; + public const REASON_COUNTERPARTY_ADDRESS_REQUIRED = 'counterpartyAddressRequired'; + public const REASON_COUNTERPARTY_BANK_TIMED_OUT = 'counterpartyBankTimedOut'; + public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; + public const REASON_ERROR = 'error'; + public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; + public const REASON_UNKNOWN = 'unknown'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_PULL = 'pull'; + public const TYPE_PUSH = 'push'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_BANK, + self::CATEGORY_INTERNAL, + self::CATEGORY_PLATFORM_PAYMENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPrioritiesAllowableValues() + { + return [ + self::PRIORITIES_CROSS_BORDER, + self::PRIORITIES_DIRECT_DEBIT, + self::PRIORITIES_FAST, + self::PRIORITIES_INSTANT, + self::PRIORITIES_INTERNAL, + self::PRIORITIES_REGULAR, + self::PRIORITIES_WIRE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_AMOUNT_LIMIT_EXCEEDED, + self::REASON_APPROVED, + self::REASON_COUNTERPARTY_ACCOUNT_BLOCKED, + self::REASON_COUNTERPARTY_ACCOUNT_CLOSED, + self::REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND, + self::REASON_COUNTERPARTY_ADDRESS_REQUIRED, + self::REASON_COUNTERPARTY_BANK_TIMED_OUT, + self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, + self::REASON_ERROR, + self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_ROUTE_NOT_FOUND, + self::REASON_UNKNOWN, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PULL, + self::TYPE_PUSH, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('priorities', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sweep_amount', $data ?? [], null); + $this->setIfExists('target_amount', $data ?? [], null); + $this->setIfExists('trigger_amount', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'push'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCategoryAllowableValues(); + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'category', must be one of '%s'", + $this->container['category'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['counterparty'] === null) { + $invalidProperties[] = "'counterparty' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['schedule'] === null) { + $invalidProperties[] = "'schedule' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\BalancePlatform\SweepCounterparty + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\BalancePlatform\SweepCounterparty $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the sweep. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets priorities + * + * @return string[]|null + */ + public function getPriorities() + { + return $this->container['priorities']; + } + + /** + * Sets priorities + * + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * + * @return self + */ + public function setPriorities($priorities) + { + if (is_null($priorities)) { + throw new \InvalidArgumentException('non-nullable priorities cannot be null'); + } + $allowedValues = $this->getPrioritiesAllowableValues(); + if (array_diff($priorities, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'priorities', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['priorities'] = $priorities; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for disabling the sweep. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets schedule + * + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2Schedule + */ + public function getSchedule() + { + return $this->container['schedule']; + } + + /** + * Sets schedule + * + * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2Schedule $schedule schedule + * + * @return self + */ + public function setSchedule($schedule) + { + if (is_null($schedule)) { + throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + } + $this->container['schedule'] = $schedule; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets sweep_amount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getSweepAmount() + { + return $this->container['sweep_amount']; + } + + /** + * Sets sweep_amount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $sweep_amount sweep_amount + * + * @return self + */ + public function setSweepAmount($sweep_amount) + { + if (is_null($sweep_amount)) { + throw new \InvalidArgumentException('non-nullable sweep_amount cannot be null'); + } + $this->container['sweep_amount'] = $sweep_amount; + + return $this; + } + + /** + * Gets target_amount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getTargetAmount() + { + return $this->container['target_amount']; + } + + /** + * Sets target_amount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $target_amount target_amount + * + * @return self + */ + public function setTargetAmount($target_amount) + { + if (is_null($target_amount)) { + throw new \InvalidArgumentException('non-nullable target_amount cannot be null'); + } + $this->container['target_amount'] = $target_amount; + + return $this; + } + + /** + * Gets trigger_amount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getTriggerAmount() + { + return $this->container['trigger_amount']; + } + + /** + * Sets trigger_amount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $trigger_amount trigger_amount + * + * @return self + */ + public function setTriggerAmount($trigger_amount) + { + if (is_null($trigger_amount)) { + throw new \InvalidArgumentException('non-nullable trigger_amount cannot be null'); + } + $this->container['trigger_amount'] = $trigger_amount; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php new file mode 100644 index 000000000..c07e6bb44 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php @@ -0,0 +1,425 @@ + + */ +class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepConfigurationV2_schedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cron_expression' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cron_expression' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cron_expression' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cron_expression' => 'cronExpression', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cron_expression' => 'setCronExpression', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cron_expression' => 'getCronExpression', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cron_expression', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cron_expression'] === null) { + $invalidProperties[] = "'cron_expression' 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 cron_expression + * + * @return string + */ + public function getCronExpression() + { + return $this->container['cron_expression']; + } + + /** + * Sets cron_expression + * + * @param string $cron_expression A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. + * + * @return self + */ + public function setCronExpression($cron_expression) + { + if (is_null($cron_expression)) { + throw new \InvalidArgumentException('non-nullable cron_expression cannot be null'); + } + $this->container['cron_expression'] = $cron_expression; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php new file mode 100644 index 000000000..b465f0ba0 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -0,0 +1,455 @@ + + */ +class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepCounterparty'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_account_id' => 'string', + 'merchant_account' => 'string', + 'transfer_instrument_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_account_id' => null, + 'merchant_account' => null, + 'transfer_instrument_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_account_id' => false, + 'merchant_account' => false, + 'transfer_instrument_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_account_id' => 'balanceAccountId', + 'merchant_account' => 'merchantAccount', + 'transfer_instrument_id' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_account_id' => 'setBalanceAccountId', + 'merchant_account' => 'setMerchantAccount', + 'transfer_instrument_id' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_account_id' => 'getBalanceAccountId', + 'merchant_account' => 'getMerchantAccount', + 'transfer_instrument_id' => 'getTransferInstrumentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_account_id', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('transfer_instrument_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance_account_id + * + * @return string|null + */ + public function getBalanceAccountId() + { + return $this->container['balance_account_id']; + } + + /** + * Sets balance_account_id + * + * @param string|null $balance_account_id The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + * + * @return self + */ + public function setBalanceAccountId($balance_account_id) + { + if (is_null($balance_account_id)) { + throw new \InvalidArgumentException('non-nullable balance_account_id cannot be null'); + } + $this->container['balance_account_id'] = $balance_account_id; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets transfer_instrument_id + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transfer_instrument_id']; + } + + /** + * Sets transfer_instrument_id + * + * @param string|null $transfer_instrument_id The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + * + * @return self + */ + public function setTransferInstrumentId($transfer_instrument_id) + { + if (is_null($transfer_instrument_id)) { + throw new \InvalidArgumentException('non-nullable transfer_instrument_id cannot be null'); + } + $this->container['transfer_instrument_id'] = $transfer_instrument_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php new file mode 100644 index 000000000..0df075c54 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -0,0 +1,426 @@ + + */ +class SweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SweepSchedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DAILY = 'daily'; + public const TYPE_WEEKLY = 'weekly'; + public const TYPE_MONTHLY = 'monthly'; + public const TYPE_BALANCE = 'balance'; + public const TYPE_CRON = 'cron'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DAILY, + self::TYPE_WEEKLY, + self::TYPE_MONTHLY, + self::TYPE_BALANCE, + self::TYPE_CRON, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDay.php b/src/Adyen/Model/BalancePlatform/TimeOfDay.php new file mode 100644 index 000000000..1d8549b72 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TimeOfDay.php @@ -0,0 +1,421 @@ + + */ +class TimeOfDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TimeOfDay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'end_time' => 'string', + 'start_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'end_time' => null, + 'start_time' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'end_time' => false, + 'start_time' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'end_time' => 'endTime', + 'start_time' => 'startTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'end_time' => 'setEndTime', + 'start_time' => 'setStartTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'end_time' => 'getEndTime', + 'start_time' => 'getStartTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('end_time', $data ?? [], null); + $this->setIfExists('start_time', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets end_time + * + * @return string|null + */ + public function getEndTime() + { + return $this->container['end_time']; + } + + /** + * Sets end_time + * + * @param string|null $end_time The end time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + * + * @return self + */ + public function setEndTime($end_time) + { + if (is_null($end_time)) { + throw new \InvalidArgumentException('non-nullable end_time cannot be null'); + } + $this->container['end_time'] = $end_time; + + return $this; + } + + /** + * Gets start_time + * + * @return string|null + */ + public function getStartTime() + { + return $this->container['start_time']; + } + + /** + * Sets start_time + * + * @param string|null $start_time The start time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + * + * @return self + */ + public function setStartTime($start_time) + { + if (is_null($start_time)) { + throw new \InvalidArgumentException('non-nullable start_time cannot be null'); + } + $this->container['start_time'] = $start_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php new file mode 100644 index 000000000..4ac8fed5e --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php @@ -0,0 +1,424 @@ + + */ +class TimeOfDayRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TimeOfDayRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => '\Adyen\Model\BalancePlatform\TimeOfDay' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return \Adyen\Model\BalancePlatform\TimeOfDay|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Adyen\Model\BalancePlatform\TimeOfDay|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php new file mode 100644 index 000000000..e579b2d2a --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php @@ -0,0 +1,424 @@ + + */ +class TotalAmountRestriction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TotalAmountRestriction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => '\Adyen\Model\BalancePlatform\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'operation' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Defines how the condition must be evaluated. + * + * @return self + */ + public function setOperation($operation) + { + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Adyen\Model\BalancePlatform\Amount|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php new file mode 100644 index 000000000..d9a58ef5b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -0,0 +1,983 @@ + + */ +class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'aggregation_level' => 'string', + 'description' => 'string', + 'end_date' => 'string', + 'entity_key' => '\Adyen\Model\BalancePlatform\TransactionRuleEntityKey', + 'id' => 'string', + 'interval' => '\Adyen\Model\BalancePlatform\TransactionRuleInterval', + 'outcome_type' => 'string', + 'reference' => 'string', + 'request_type' => 'string', + 'rule_restrictions' => '\Adyen\Model\BalancePlatform\TransactionRuleRestrictions', + 'score' => 'int', + 'start_date' => 'string', + 'status' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'aggregation_level' => null, + 'description' => null, + 'end_date' => null, + 'entity_key' => null, + 'id' => null, + 'interval' => null, + 'outcome_type' => null, + 'reference' => null, + 'request_type' => null, + 'rule_restrictions' => null, + 'score' => 'int32', + 'start_date' => null, + 'status' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'aggregation_level' => false, + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'id' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'aggregation_level' => 'aggregationLevel', + 'description' => 'description', + 'end_date' => 'endDate', + 'entity_key' => 'entityKey', + 'id' => 'id', + 'interval' => 'interval', + 'outcome_type' => 'outcomeType', + 'reference' => 'reference', + 'request_type' => 'requestType', + 'rule_restrictions' => 'ruleRestrictions', + 'score' => 'score', + 'start_date' => 'startDate', + 'status' => 'status', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'aggregation_level' => 'setAggregationLevel', + 'description' => 'setDescription', + 'end_date' => 'setEndDate', + 'entity_key' => 'setEntityKey', + 'id' => 'setId', + 'interval' => 'setInterval', + 'outcome_type' => 'setOutcomeType', + 'reference' => 'setReference', + 'request_type' => 'setRequestType', + 'rule_restrictions' => 'setRuleRestrictions', + 'score' => 'setScore', + 'start_date' => 'setStartDate', + 'status' => 'setStatus', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'aggregation_level' => 'getAggregationLevel', + 'description' => 'getDescription', + 'end_date' => 'getEndDate', + 'entity_key' => 'getEntityKey', + 'id' => 'getId', + 'interval' => 'getInterval', + 'outcome_type' => 'getOutcomeType', + 'reference' => 'getReference', + 'request_type' => 'getRequestType', + 'rule_restrictions' => 'getRuleRestrictions', + 'score' => 'getScore', + 'start_date' => 'getStartDate', + 'status' => 'getStatus', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const OUTCOME_TYPE_HARD_BLOCK = 'hardBlock'; + public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; + public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; + public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; + public const REQUEST_TYPE_TOKENIZATION = 'tokenization'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_ALLOW_LIST = 'allowList'; + public const TYPE_BLOCK_LIST = 'blockList'; + public const TYPE_MAX_USAGE = 'maxUsage'; + public const TYPE_VELOCITY = 'velocity'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOutcomeTypeAllowableValues() + { + return [ + self::OUTCOME_TYPE_HARD_BLOCK, + self::OUTCOME_TYPE_SCORE_BASED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequestTypeAllowableValues() + { + return [ + self::REQUEST_TYPE_AUTHENTICATION, + self::REQUEST_TYPE_AUTHORIZATION, + self::REQUEST_TYPE_TOKENIZATION, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ALLOW_LIST, + self::TYPE_BLOCK_LIST, + self::TYPE_MAX_USAGE, + self::TYPE_VELOCITY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('aggregation_level', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('entity_key', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('interval', $data ?? [], null); + $this->setIfExists('outcome_type', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('request_type', $data ?? [], null); + $this->setIfExists('rule_restrictions', $data ?? [], null); + $this->setIfExists('score', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['entity_key'] === null) { + $invalidProperties[] = "'entity_key' can't be null"; + } + if ($this->container['interval'] === null) { + $invalidProperties[] = "'interval' can't be null"; + } + $allowedValues = $this->getOutcomeTypeAllowableValues(); + if (!is_null($this->container['outcome_type']) && !in_array($this->container['outcome_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'outcome_type', must be one of '%s'", + $this->container['outcome_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + $allowedValues = $this->getRequestTypeAllowableValues(); + if (!is_null($this->container['request_type']) && !in_array($this->container['request_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'request_type', must be one of '%s'", + $this->container['request_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['rule_restrictions'] === null) { + $invalidProperties[] = "'rule_restrictions' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets aggregation_level + * + * @return string|null + */ + public function getAggregationLevel() + { + return $this->container['aggregation_level']; + } + + /** + * Sets aggregation_level + * + * @param string|null $aggregation_level The level at which data must be accumulated, used in rules with `type` **velocity** or **maxUsage**. The level must be the [same or lower in hierarchy](https://docs.adyen.com/issuing/transaction-rules#accumulate-data) than the `entityKey`. If not provided, by default, the rule will accumulate data at the **paymentInstrument** level. Possible values: **paymentInstrument**, **paymentInstrumentGroup**, **balanceAccount**, **accountHolder**, **balancePlatform**. + * + * @return self + */ + public function setAggregationLevel($aggregation_level) + { + if (is_null($aggregation_level)) { + throw new \InvalidArgumentException('non-nullable aggregation_level cannot be null'); + } + $this->container['aggregation_level'] = $aggregation_level; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description for the transaction rule, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets end_date + * + * @return string|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param string|null $end_date The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + throw new \InvalidArgumentException('non-nullable end_date cannot be null'); + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets entity_key + * + * @return \Adyen\Model\BalancePlatform\TransactionRuleEntityKey + */ + public function getEntityKey() + { + return $this->container['entity_key']; + } + + /** + * Sets entity_key + * + * @param \Adyen\Model\BalancePlatform\TransactionRuleEntityKey $entity_key entity_key + * + * @return self + */ + public function setEntityKey($entity_key) + { + if (is_null($entity_key)) { + throw new \InvalidArgumentException('non-nullable entity_key cannot be null'); + } + $this->container['entity_key'] = $entity_key; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the transaction rule. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets interval + * + * @return \Adyen\Model\BalancePlatform\TransactionRuleInterval + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param \Adyen\Model\BalancePlatform\TransactionRuleInterval $interval interval + * + * @return self + */ + public function setInterval($interval) + { + if (is_null($interval)) { + throw new \InvalidArgumentException('non-nullable interval cannot be null'); + } + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets outcome_type + * + * @return string|null + */ + public function getOutcomeType() + { + return $this->container['outcome_type']; + } + + /** + * Sets outcome_type + * + * @param string|null $outcome_type The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. + * + * @return self + */ + public function setOutcomeType($outcome_type) + { + if (is_null($outcome_type)) { + throw new \InvalidArgumentException('non-nullable outcome_type cannot be null'); + } + $allowedValues = $this->getOutcomeTypeAllowableValues(); + if (!in_array($outcome_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'outcome_type', must be one of '%s'", + $outcome_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['outcome_type'] = $outcome_type; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference Your reference for the transaction rule, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets request_type + * + * @return string|null + */ + public function getRequestType() + { + return $this->container['request_type']; + } + + /** + * Sets request_type + * + * @param string|null $request_type Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + * + * @return self + */ + public function setRequestType($request_type) + { + if (is_null($request_type)) { + throw new \InvalidArgumentException('non-nullable request_type cannot be null'); + } + $allowedValues = $this->getRequestTypeAllowableValues(); + if (!in_array($request_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'request_type', must be one of '%s'", + $request_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['request_type'] = $request_type; + + return $this; + } + + /** + * Gets rule_restrictions + * + * @return \Adyen\Model\BalancePlatform\TransactionRuleRestrictions + */ + public function getRuleRestrictions() + { + return $this->container['rule_restrictions']; + } + + /** + * Sets rule_restrictions + * + * @param \Adyen\Model\BalancePlatform\TransactionRuleRestrictions $rule_restrictions rule_restrictions + * + * @return self + */ + public function setRuleRestrictions($rule_restrictions) + { + if (is_null($rule_restrictions)) { + throw new \InvalidArgumentException('non-nullable rule_restrictions cannot be null'); + } + $this->container['rule_restrictions'] = $rule_restrictions; + + return $this; + } + + /** + * Gets score + * + * @return int|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int|null $score A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. + * + * @return self + */ + public function setScore($score) + { + // Do nothing for nullable integers + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets start_date + * + * @return string|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param string|null $start_date The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php new file mode 100644 index 000000000..70421f031 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php @@ -0,0 +1,421 @@ + + */ +class TransactionRuleEntityKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRuleEntityKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entity_reference' => 'string', + 'entity_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entity_reference' => null, + 'entity_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entity_reference' => false, + 'entity_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity_reference' => 'entityReference', + 'entity_type' => 'entityType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity_reference' => 'setEntityReference', + 'entity_type' => 'setEntityType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity_reference' => 'getEntityReference', + 'entity_type' => 'getEntityType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('entity_reference', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entity_reference + * + * @return string|null + */ + public function getEntityReference() + { + return $this->container['entity_reference']; + } + + /** + * Sets entity_reference + * + * @param string|null $entity_reference The unique identifier of the resource. + * + * @return self + */ + public function setEntityReference($entity_reference) + { + if (is_null($entity_reference)) { + throw new \InvalidArgumentException('non-nullable entity_reference cannot be null'); + } + $this->container['entity_reference'] = $entity_reference; + + return $this; + } + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type The type of resource. Possible values: **balancePlatform**, **paymentInstrumentGroup**, **accountHolder**, **balanceAccount**, or **paymentInstrument**. + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + throw new \InvalidArgumentException('non-nullable entity_type cannot be null'); + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php new file mode 100644 index 000000000..17c32c708 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -0,0 +1,949 @@ + + */ +class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRuleInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'aggregation_level' => 'string', + 'description' => 'string', + 'end_date' => 'string', + 'entity_key' => '\Adyen\Model\BalancePlatform\TransactionRuleEntityKey', + 'interval' => '\Adyen\Model\BalancePlatform\TransactionRuleInterval', + 'outcome_type' => 'string', + 'reference' => 'string', + 'request_type' => 'string', + 'rule_restrictions' => '\Adyen\Model\BalancePlatform\TransactionRuleRestrictions', + 'score' => 'int', + 'start_date' => 'string', + 'status' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'aggregation_level' => null, + 'description' => null, + 'end_date' => null, + 'entity_key' => null, + 'interval' => null, + 'outcome_type' => null, + 'reference' => null, + 'request_type' => null, + 'rule_restrictions' => null, + 'score' => 'int32', + 'start_date' => null, + 'status' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'aggregation_level' => false, + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'aggregation_level' => 'aggregationLevel', + 'description' => 'description', + 'end_date' => 'endDate', + 'entity_key' => 'entityKey', + 'interval' => 'interval', + 'outcome_type' => 'outcomeType', + 'reference' => 'reference', + 'request_type' => 'requestType', + 'rule_restrictions' => 'ruleRestrictions', + 'score' => 'score', + 'start_date' => 'startDate', + 'status' => 'status', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'aggregation_level' => 'setAggregationLevel', + 'description' => 'setDescription', + 'end_date' => 'setEndDate', + 'entity_key' => 'setEntityKey', + 'interval' => 'setInterval', + 'outcome_type' => 'setOutcomeType', + 'reference' => 'setReference', + 'request_type' => 'setRequestType', + 'rule_restrictions' => 'setRuleRestrictions', + 'score' => 'setScore', + 'start_date' => 'setStartDate', + 'status' => 'setStatus', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'aggregation_level' => 'getAggregationLevel', + 'description' => 'getDescription', + 'end_date' => 'getEndDate', + 'entity_key' => 'getEntityKey', + 'interval' => 'getInterval', + 'outcome_type' => 'getOutcomeType', + 'reference' => 'getReference', + 'request_type' => 'getRequestType', + 'rule_restrictions' => 'getRuleRestrictions', + 'score' => 'getScore', + 'start_date' => 'getStartDate', + 'status' => 'getStatus', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const OUTCOME_TYPE_HARD_BLOCK = 'hardBlock'; + public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; + public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; + public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; + public const REQUEST_TYPE_TOKENIZATION = 'tokenization'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_ALLOW_LIST = 'allowList'; + public const TYPE_BLOCK_LIST = 'blockList'; + public const TYPE_MAX_USAGE = 'maxUsage'; + public const TYPE_VELOCITY = 'velocity'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOutcomeTypeAllowableValues() + { + return [ + self::OUTCOME_TYPE_HARD_BLOCK, + self::OUTCOME_TYPE_SCORE_BASED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequestTypeAllowableValues() + { + return [ + self::REQUEST_TYPE_AUTHENTICATION, + self::REQUEST_TYPE_AUTHORIZATION, + self::REQUEST_TYPE_TOKENIZATION, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ALLOW_LIST, + self::TYPE_BLOCK_LIST, + self::TYPE_MAX_USAGE, + self::TYPE_VELOCITY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('aggregation_level', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('entity_key', $data ?? [], null); + $this->setIfExists('interval', $data ?? [], null); + $this->setIfExists('outcome_type', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('request_type', $data ?? [], null); + $this->setIfExists('rule_restrictions', $data ?? [], null); + $this->setIfExists('score', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['entity_key'] === null) { + $invalidProperties[] = "'entity_key' can't be null"; + } + if ($this->container['interval'] === null) { + $invalidProperties[] = "'interval' can't be null"; + } + $allowedValues = $this->getOutcomeTypeAllowableValues(); + if (!is_null($this->container['outcome_type']) && !in_array($this->container['outcome_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'outcome_type', must be one of '%s'", + $this->container['outcome_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + $allowedValues = $this->getRequestTypeAllowableValues(); + if (!is_null($this->container['request_type']) && !in_array($this->container['request_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'request_type', must be one of '%s'", + $this->container['request_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['rule_restrictions'] === null) { + $invalidProperties[] = "'rule_restrictions' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets aggregation_level + * + * @return string|null + */ + public function getAggregationLevel() + { + return $this->container['aggregation_level']; + } + + /** + * Sets aggregation_level + * + * @param string|null $aggregation_level The level at which data must be accumulated, used in rules with `type` **velocity** or **maxUsage**. The level must be the [same or lower in hierarchy](https://docs.adyen.com/issuing/transaction-rules#accumulate-data) than the `entityKey`. If not provided, by default, the rule will accumulate data at the **paymentInstrument** level. Possible values: **paymentInstrument**, **paymentInstrumentGroup**, **balanceAccount**, **accountHolder**, **balancePlatform**. + * + * @return self + */ + public function setAggregationLevel($aggregation_level) + { + if (is_null($aggregation_level)) { + throw new \InvalidArgumentException('non-nullable aggregation_level cannot be null'); + } + $this->container['aggregation_level'] = $aggregation_level; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description for the transaction rule, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets end_date + * + * @return string|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param string|null $end_date The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + throw new \InvalidArgumentException('non-nullable end_date cannot be null'); + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets entity_key + * + * @return \Adyen\Model\BalancePlatform\TransactionRuleEntityKey + */ + public function getEntityKey() + { + return $this->container['entity_key']; + } + + /** + * Sets entity_key + * + * @param \Adyen\Model\BalancePlatform\TransactionRuleEntityKey $entity_key entity_key + * + * @return self + */ + public function setEntityKey($entity_key) + { + if (is_null($entity_key)) { + throw new \InvalidArgumentException('non-nullable entity_key cannot be null'); + } + $this->container['entity_key'] = $entity_key; + + return $this; + } + + /** + * Gets interval + * + * @return \Adyen\Model\BalancePlatform\TransactionRuleInterval + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param \Adyen\Model\BalancePlatform\TransactionRuleInterval $interval interval + * + * @return self + */ + public function setInterval($interval) + { + if (is_null($interval)) { + throw new \InvalidArgumentException('non-nullable interval cannot be null'); + } + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets outcome_type + * + * @return string|null + */ + public function getOutcomeType() + { + return $this->container['outcome_type']; + } + + /** + * Sets outcome_type + * + * @param string|null $outcome_type The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. + * + * @return self + */ + public function setOutcomeType($outcome_type) + { + if (is_null($outcome_type)) { + throw new \InvalidArgumentException('non-nullable outcome_type cannot be null'); + } + $allowedValues = $this->getOutcomeTypeAllowableValues(); + if (!in_array($outcome_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'outcome_type', must be one of '%s'", + $outcome_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['outcome_type'] = $outcome_type; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference Your reference for the transaction rule, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets request_type + * + * @return string|null + */ + public function getRequestType() + { + return $this->container['request_type']; + } + + /** + * Sets request_type + * + * @param string|null $request_type Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + * + * @return self + */ + public function setRequestType($request_type) + { + if (is_null($request_type)) { + throw new \InvalidArgumentException('non-nullable request_type cannot be null'); + } + $allowedValues = $this->getRequestTypeAllowableValues(); + if (!in_array($request_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'request_type', must be one of '%s'", + $request_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['request_type'] = $request_type; + + return $this; + } + + /** + * Gets rule_restrictions + * + * @return \Adyen\Model\BalancePlatform\TransactionRuleRestrictions + */ + public function getRuleRestrictions() + { + return $this->container['rule_restrictions']; + } + + /** + * Sets rule_restrictions + * + * @param \Adyen\Model\BalancePlatform\TransactionRuleRestrictions $rule_restrictions rule_restrictions + * + * @return self + */ + public function setRuleRestrictions($rule_restrictions) + { + if (is_null($rule_restrictions)) { + throw new \InvalidArgumentException('non-nullable rule_restrictions cannot be null'); + } + $this->container['rule_restrictions'] = $rule_restrictions; + + return $this; + } + + /** + * Gets score + * + * @return int|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int|null $score A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. + * + * @return self + */ + public function setScore($score) + { + // Do nothing for nullable integers + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets start_date + * + * @return string|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param string|null $start_date The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php new file mode 100644 index 000000000..24e81f3c5 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php @@ -0,0 +1,644 @@ + + */ +class TransactionRuleInterval implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRuleInterval'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day_of_month' => 'int', + 'day_of_week' => 'string', + 'duration' => '\Adyen\Model\BalancePlatform\Duration', + 'time_of_day' => 'string', + 'time_zone' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day_of_month' => 'int32', + 'day_of_week' => null, + 'duration' => null, + 'time_of_day' => null, + 'time_zone' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'day_of_month' => true, + 'day_of_week' => false, + 'duration' => false, + 'time_of_day' => false, + 'time_zone' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'day_of_month' => 'dayOfMonth', + 'day_of_week' => 'dayOfWeek', + 'duration' => 'duration', + 'time_of_day' => 'timeOfDay', + 'time_zone' => 'timeZone', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day_of_month' => 'setDayOfMonth', + 'day_of_week' => 'setDayOfWeek', + 'duration' => 'setDuration', + 'time_of_day' => 'setTimeOfDay', + 'time_zone' => 'setTimeZone', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day_of_month' => 'getDayOfMonth', + 'day_of_week' => 'getDayOfWeek', + 'duration' => 'getDuration', + 'time_of_day' => 'getTimeOfDay', + 'time_zone' => 'getTimeZone', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const DAY_OF_WEEK_FRIDAY = 'friday'; + public const DAY_OF_WEEK_MONDAY = 'monday'; + public const DAY_OF_WEEK_SATURDAY = 'saturday'; + public const DAY_OF_WEEK_SUNDAY = 'sunday'; + public const DAY_OF_WEEK_THURSDAY = 'thursday'; + public const DAY_OF_WEEK_TUESDAY = 'tuesday'; + public const DAY_OF_WEEK_WEDNESDAY = 'wednesday'; + public const TYPE_DAILY = 'daily'; + public const TYPE_LIFETIME = 'lifetime'; + public const TYPE_MONTHLY = 'monthly'; + public const TYPE_PER_TRANSACTION = 'perTransaction'; + public const TYPE_ROLLING = 'rolling'; + public const TYPE_SLIDING = 'sliding'; + public const TYPE_WEEKLY = 'weekly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDayOfWeekAllowableValues() + { + return [ + self::DAY_OF_WEEK_FRIDAY, + self::DAY_OF_WEEK_MONDAY, + self::DAY_OF_WEEK_SATURDAY, + self::DAY_OF_WEEK_SUNDAY, + self::DAY_OF_WEEK_THURSDAY, + self::DAY_OF_WEEK_TUESDAY, + self::DAY_OF_WEEK_WEDNESDAY, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DAILY, + self::TYPE_LIFETIME, + self::TYPE_MONTHLY, + self::TYPE_PER_TRANSACTION, + self::TYPE_ROLLING, + self::TYPE_SLIDING, + self::TYPE_WEEKLY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('day_of_month', $data ?? [], null); + $this->setIfExists('day_of_week', $data ?? [], null); + $this->setIfExists('duration', $data ?? [], null); + $this->setIfExists('time_of_day', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getDayOfWeekAllowableValues(); + if (!is_null($this->container['day_of_week']) && !in_array($this->container['day_of_week'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'day_of_week', must be one of '%s'", + $this->container['day_of_week'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets day_of_month + * + * @return int|null + */ + public function getDayOfMonth() + { + return $this->container['day_of_month']; + } + + /** + * Sets day_of_month + * + * @param int|null $day_of_month The day of month, used when the `duration.unit` is **months**. If not provided, by default, this is set to **1**, the first day of the month. + * + * @return self + */ + public function setDayOfMonth($day_of_month) + { + // Do nothing for nullable integers + $this->container['day_of_month'] = $day_of_month; + + return $this; + } + + /** + * Gets day_of_week + * + * @return string|null + */ + public function getDayOfWeek() + { + return $this->container['day_of_week']; + } + + /** + * Sets day_of_week + * + * @param string|null $day_of_week The day of week, used when the `duration.unit` is **weeks**. If not provided, by default, this is set to **monday**. Possible values: **sunday**, **monday**, **tuesday**, **wednesday**, **thursday**, **friday**. + * + * @return self + */ + public function setDayOfWeek($day_of_week) + { + if (is_null($day_of_week)) { + throw new \InvalidArgumentException('non-nullable day_of_week cannot be null'); + } + $allowedValues = $this->getDayOfWeekAllowableValues(); + if (!in_array($day_of_week, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'day_of_week', must be one of '%s'", + $day_of_week, + implode("', '", $allowedValues) + ) + ); + } + $this->container['day_of_week'] = $day_of_week; + + return $this; + } + + /** + * Gets duration + * + * @return \Adyen\Model\BalancePlatform\Duration|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param \Adyen\Model\BalancePlatform\Duration|null $duration duration + * + * @return self + */ + public function setDuration($duration) + { + if (is_null($duration)) { + throw new \InvalidArgumentException('non-nullable duration cannot be null'); + } + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets time_of_day + * + * @return string|null + */ + public function getTimeOfDay() + { + return $this->container['time_of_day']; + } + + /** + * Sets time_of_day + * + * @param string|null $time_of_day The time of day, in **hh:mm:ss** format, used when the `duration.unit` is **hours**. If not provided, by default, this is set to **00:00:00**. + * + * @return self + */ + public function setTimeOfDay($time_of_day) + { + if (is_null($time_of_day)) { + throw new \InvalidArgumentException('non-nullable time_of_day cannot be null'); + } + $this->container['time_of_day'] = $time_of_day; + + return $this; + } + + /** + * Gets time_zone + * + * @return string|null + */ + public function getTimeZone() + { + return $this->container['time_zone']; + } + + /** + * Sets time_zone + * + * @param string|null $time_zone The [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For example, **Europe/Amsterdam**. By default, this is set to **UTC**. + * + * @return self + */ + public function setTimeZone($time_zone) + { + if (is_null($time_zone)) { + throw new \InvalidArgumentException('non-nullable time_zone cannot be null'); + } + $this->container['time_zone'] = $time_zone; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The [type of interval](https://docs.adyen.com/issuing/transaction-rules#time-intervals) during which the rule conditions and limits apply, and how often counters are reset. Possible values: * **perTransaction**: conditions are evaluated and the counters are reset for every transaction. * **daily**: the counters are reset daily at 00:00:00 UTC. * **weekly**: the counters are reset every Monday at 00:00:00 UTC. * **monthly**: the counters reset every first day of the month at 00:00:00 UTC. * **lifetime**: conditions are applied to the lifetime of the payment instrument. * **rolling**: conditions are applied and the counters are reset based on a `duration`. If the reset date and time are not provided, Adyen applies the default reset time similar to fixed intervals. For example, if the duration is every two weeks, the counter resets every third Monday at 00:00:00 UTC. * **sliding**: conditions are applied and the counters are reset based on the current time and a `duration` that you specify. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php new file mode 100644 index 000000000..3d761e342 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php @@ -0,0 +1,387 @@ + + */ +class TransactionRuleResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRuleResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transaction_rule' => '\Adyen\Model\BalancePlatform\TransactionRule' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transaction_rule' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transaction_rule' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transaction_rule' => 'transactionRule' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transaction_rule' => 'setTransactionRule' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transaction_rule' => 'getTransactionRule' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('transaction_rule', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets transaction_rule + * + * @return \Adyen\Model\BalancePlatform\TransactionRule|null + */ + public function getTransactionRule() + { + return $this->container['transaction_rule']; + } + + /** + * Sets transaction_rule + * + * @param \Adyen\Model\BalancePlatform\TransactionRule|null $transaction_rule transaction_rule + * + * @return self + */ + public function setTransactionRule($transaction_rule) + { + if (is_null($transaction_rule)) { + throw new \InvalidArgumentException('non-nullable transaction_rule cannot be null'); + } + $this->container['transaction_rule'] = $transaction_rule; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php new file mode 100644 index 000000000..bee041525 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -0,0 +1,829 @@ + + */ +class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRuleRestrictions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'active_network_tokens' => '\Adyen\Model\BalancePlatform\ActiveNetworkTokensRestriction', + 'brand_variants' => '\Adyen\Model\BalancePlatform\BrandVariantsRestriction', + 'countries' => '\Adyen\Model\BalancePlatform\CountriesRestriction', + 'day_of_week' => '\Adyen\Model\BalancePlatform\DayOfWeekRestriction', + 'different_currencies' => '\Adyen\Model\BalancePlatform\DifferentCurrenciesRestriction', + 'entry_modes' => '\Adyen\Model\BalancePlatform\EntryModesRestriction', + 'international_transaction' => '\Adyen\Model\BalancePlatform\InternationalTransactionRestriction', + 'matching_transactions' => '\Adyen\Model\BalancePlatform\MatchingTransactionsRestriction', + 'mccs' => '\Adyen\Model\BalancePlatform\MccsRestriction', + 'merchant_names' => '\Adyen\Model\BalancePlatform\MerchantNamesRestriction', + 'merchants' => '\Adyen\Model\BalancePlatform\MerchantsRestriction', + 'processing_types' => '\Adyen\Model\BalancePlatform\ProcessingTypesRestriction', + 'time_of_day' => '\Adyen\Model\BalancePlatform\TimeOfDayRestriction', + 'total_amount' => '\Adyen\Model\BalancePlatform\TotalAmountRestriction' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_network_tokens' => null, + 'brand_variants' => null, + 'countries' => null, + 'day_of_week' => null, + 'different_currencies' => null, + 'entry_modes' => null, + 'international_transaction' => null, + 'matching_transactions' => null, + 'mccs' => null, + 'merchant_names' => null, + 'merchants' => null, + 'processing_types' => null, + 'time_of_day' => null, + 'total_amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'active_network_tokens' => false, + 'brand_variants' => false, + 'countries' => false, + 'day_of_week' => false, + 'different_currencies' => false, + 'entry_modes' => false, + 'international_transaction' => false, + 'matching_transactions' => false, + 'mccs' => false, + 'merchant_names' => false, + 'merchants' => false, + 'processing_types' => false, + 'time_of_day' => false, + 'total_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_network_tokens' => 'activeNetworkTokens', + 'brand_variants' => 'brandVariants', + 'countries' => 'countries', + 'day_of_week' => 'dayOfWeek', + 'different_currencies' => 'differentCurrencies', + 'entry_modes' => 'entryModes', + 'international_transaction' => 'internationalTransaction', + 'matching_transactions' => 'matchingTransactions', + 'mccs' => 'mccs', + 'merchant_names' => 'merchantNames', + 'merchants' => 'merchants', + 'processing_types' => 'processingTypes', + 'time_of_day' => 'timeOfDay', + 'total_amount' => 'totalAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_network_tokens' => 'setActiveNetworkTokens', + 'brand_variants' => 'setBrandVariants', + 'countries' => 'setCountries', + 'day_of_week' => 'setDayOfWeek', + 'different_currencies' => 'setDifferentCurrencies', + 'entry_modes' => 'setEntryModes', + 'international_transaction' => 'setInternationalTransaction', + 'matching_transactions' => 'setMatchingTransactions', + 'mccs' => 'setMccs', + 'merchant_names' => 'setMerchantNames', + 'merchants' => 'setMerchants', + 'processing_types' => 'setProcessingTypes', + 'time_of_day' => 'setTimeOfDay', + 'total_amount' => 'setTotalAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_network_tokens' => 'getActiveNetworkTokens', + 'brand_variants' => 'getBrandVariants', + 'countries' => 'getCountries', + 'day_of_week' => 'getDayOfWeek', + 'different_currencies' => 'getDifferentCurrencies', + 'entry_modes' => 'getEntryModes', + 'international_transaction' => 'getInternationalTransaction', + 'matching_transactions' => 'getMatchingTransactions', + 'mccs' => 'getMccs', + 'merchant_names' => 'getMerchantNames', + 'merchants' => 'getMerchants', + 'processing_types' => 'getProcessingTypes', + 'time_of_day' => 'getTimeOfDay', + 'total_amount' => 'getTotalAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('active_network_tokens', $data ?? [], null); + $this->setIfExists('brand_variants', $data ?? [], null); + $this->setIfExists('countries', $data ?? [], null); + $this->setIfExists('day_of_week', $data ?? [], null); + $this->setIfExists('different_currencies', $data ?? [], null); + $this->setIfExists('entry_modes', $data ?? [], null); + $this->setIfExists('international_transaction', $data ?? [], null); + $this->setIfExists('matching_transactions', $data ?? [], null); + $this->setIfExists('mccs', $data ?? [], null); + $this->setIfExists('merchant_names', $data ?? [], null); + $this->setIfExists('merchants', $data ?? [], null); + $this->setIfExists('processing_types', $data ?? [], null); + $this->setIfExists('time_of_day', $data ?? [], null); + $this->setIfExists('total_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_network_tokens + * + * @return \Adyen\Model\BalancePlatform\ActiveNetworkTokensRestriction|null + */ + public function getActiveNetworkTokens() + { + return $this->container['active_network_tokens']; + } + + /** + * Sets active_network_tokens + * + * @param \Adyen\Model\BalancePlatform\ActiveNetworkTokensRestriction|null $active_network_tokens active_network_tokens + * + * @return self + */ + public function setActiveNetworkTokens($active_network_tokens) + { + if (is_null($active_network_tokens)) { + throw new \InvalidArgumentException('non-nullable active_network_tokens cannot be null'); + } + $this->container['active_network_tokens'] = $active_network_tokens; + + return $this; + } + + /** + * Gets brand_variants + * + * @return \Adyen\Model\BalancePlatform\BrandVariantsRestriction|null + */ + public function getBrandVariants() + { + return $this->container['brand_variants']; + } + + /** + * Sets brand_variants + * + * @param \Adyen\Model\BalancePlatform\BrandVariantsRestriction|null $brand_variants brand_variants + * + * @return self + */ + public function setBrandVariants($brand_variants) + { + if (is_null($brand_variants)) { + throw new \InvalidArgumentException('non-nullable brand_variants cannot be null'); + } + $this->container['brand_variants'] = $brand_variants; + + return $this; + } + + /** + * Gets countries + * + * @return \Adyen\Model\BalancePlatform\CountriesRestriction|null + */ + public function getCountries() + { + return $this->container['countries']; + } + + /** + * Sets countries + * + * @param \Adyen\Model\BalancePlatform\CountriesRestriction|null $countries countries + * + * @return self + */ + public function setCountries($countries) + { + if (is_null($countries)) { + throw new \InvalidArgumentException('non-nullable countries cannot be null'); + } + $this->container['countries'] = $countries; + + return $this; + } + + /** + * Gets day_of_week + * + * @return \Adyen\Model\BalancePlatform\DayOfWeekRestriction|null + */ + public function getDayOfWeek() + { + return $this->container['day_of_week']; + } + + /** + * Sets day_of_week + * + * @param \Adyen\Model\BalancePlatform\DayOfWeekRestriction|null $day_of_week day_of_week + * + * @return self + */ + public function setDayOfWeek($day_of_week) + { + if (is_null($day_of_week)) { + throw new \InvalidArgumentException('non-nullable day_of_week cannot be null'); + } + $this->container['day_of_week'] = $day_of_week; + + return $this; + } + + /** + * Gets different_currencies + * + * @return \Adyen\Model\BalancePlatform\DifferentCurrenciesRestriction|null + */ + public function getDifferentCurrencies() + { + return $this->container['different_currencies']; + } + + /** + * Sets different_currencies + * + * @param \Adyen\Model\BalancePlatform\DifferentCurrenciesRestriction|null $different_currencies different_currencies + * + * @return self + */ + public function setDifferentCurrencies($different_currencies) + { + if (is_null($different_currencies)) { + throw new \InvalidArgumentException('non-nullable different_currencies cannot be null'); + } + $this->container['different_currencies'] = $different_currencies; + + return $this; + } + + /** + * Gets entry_modes + * + * @return \Adyen\Model\BalancePlatform\EntryModesRestriction|null + */ + public function getEntryModes() + { + return $this->container['entry_modes']; + } + + /** + * Sets entry_modes + * + * @param \Adyen\Model\BalancePlatform\EntryModesRestriction|null $entry_modes entry_modes + * + * @return self + */ + public function setEntryModes($entry_modes) + { + if (is_null($entry_modes)) { + throw new \InvalidArgumentException('non-nullable entry_modes cannot be null'); + } + $this->container['entry_modes'] = $entry_modes; + + return $this; + } + + /** + * Gets international_transaction + * + * @return \Adyen\Model\BalancePlatform\InternationalTransactionRestriction|null + */ + public function getInternationalTransaction() + { + return $this->container['international_transaction']; + } + + /** + * Sets international_transaction + * + * @param \Adyen\Model\BalancePlatform\InternationalTransactionRestriction|null $international_transaction international_transaction + * + * @return self + */ + public function setInternationalTransaction($international_transaction) + { + if (is_null($international_transaction)) { + throw new \InvalidArgumentException('non-nullable international_transaction cannot be null'); + } + $this->container['international_transaction'] = $international_transaction; + + return $this; + } + + /** + * Gets matching_transactions + * + * @return \Adyen\Model\BalancePlatform\MatchingTransactionsRestriction|null + */ + public function getMatchingTransactions() + { + return $this->container['matching_transactions']; + } + + /** + * Sets matching_transactions + * + * @param \Adyen\Model\BalancePlatform\MatchingTransactionsRestriction|null $matching_transactions matching_transactions + * + * @return self + */ + public function setMatchingTransactions($matching_transactions) + { + if (is_null($matching_transactions)) { + throw new \InvalidArgumentException('non-nullable matching_transactions cannot be null'); + } + $this->container['matching_transactions'] = $matching_transactions; + + return $this; + } + + /** + * Gets mccs + * + * @return \Adyen\Model\BalancePlatform\MccsRestriction|null + */ + public function getMccs() + { + return $this->container['mccs']; + } + + /** + * Sets mccs + * + * @param \Adyen\Model\BalancePlatform\MccsRestriction|null $mccs mccs + * + * @return self + */ + public function setMccs($mccs) + { + if (is_null($mccs)) { + throw new \InvalidArgumentException('non-nullable mccs cannot be null'); + } + $this->container['mccs'] = $mccs; + + return $this; + } + + /** + * Gets merchant_names + * + * @return \Adyen\Model\BalancePlatform\MerchantNamesRestriction|null + */ + public function getMerchantNames() + { + return $this->container['merchant_names']; + } + + /** + * Sets merchant_names + * + * @param \Adyen\Model\BalancePlatform\MerchantNamesRestriction|null $merchant_names merchant_names + * + * @return self + */ + public function setMerchantNames($merchant_names) + { + if (is_null($merchant_names)) { + throw new \InvalidArgumentException('non-nullable merchant_names cannot be null'); + } + $this->container['merchant_names'] = $merchant_names; + + return $this; + } + + /** + * Gets merchants + * + * @return \Adyen\Model\BalancePlatform\MerchantsRestriction|null + */ + public function getMerchants() + { + return $this->container['merchants']; + } + + /** + * Sets merchants + * + * @param \Adyen\Model\BalancePlatform\MerchantsRestriction|null $merchants merchants + * + * @return self + */ + public function setMerchants($merchants) + { + if (is_null($merchants)) { + throw new \InvalidArgumentException('non-nullable merchants cannot be null'); + } + $this->container['merchants'] = $merchants; + + return $this; + } + + /** + * Gets processing_types + * + * @return \Adyen\Model\BalancePlatform\ProcessingTypesRestriction|null + */ + public function getProcessingTypes() + { + return $this->container['processing_types']; + } + + /** + * Sets processing_types + * + * @param \Adyen\Model\BalancePlatform\ProcessingTypesRestriction|null $processing_types processing_types + * + * @return self + */ + public function setProcessingTypes($processing_types) + { + if (is_null($processing_types)) { + throw new \InvalidArgumentException('non-nullable processing_types cannot be null'); + } + $this->container['processing_types'] = $processing_types; + + return $this; + } + + /** + * Gets time_of_day + * + * @return \Adyen\Model\BalancePlatform\TimeOfDayRestriction|null + */ + public function getTimeOfDay() + { + return $this->container['time_of_day']; + } + + /** + * Sets time_of_day + * + * @param \Adyen\Model\BalancePlatform\TimeOfDayRestriction|null $time_of_day time_of_day + * + * @return self + */ + public function setTimeOfDay($time_of_day) + { + if (is_null($time_of_day)) { + throw new \InvalidArgumentException('non-nullable time_of_day cannot be null'); + } + $this->container['time_of_day'] = $time_of_day; + + return $this; + } + + /** + * Gets total_amount + * + * @return \Adyen\Model\BalancePlatform\TotalAmountRestriction|null + */ + public function getTotalAmount() + { + return $this->container['total_amount']; + } + + /** + * Sets total_amount + * + * @param \Adyen\Model\BalancePlatform\TotalAmountRestriction|null $total_amount total_amount + * + * @return self + */ + public function setTotalAmount($total_amount) + { + if (is_null($total_amount)) { + throw new \InvalidArgumentException('non-nullable total_amount cannot be null'); + } + $this->container['total_amount'] = $total_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php new file mode 100644 index 000000000..56ad310c9 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php @@ -0,0 +1,387 @@ + + */ +class TransactionRulesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransactionRulesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transaction_rules' => '\Adyen\Model\BalancePlatform\TransactionRule[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transaction_rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transaction_rules' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transaction_rules' => 'transactionRules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transaction_rules' => 'setTransactionRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transaction_rules' => 'getTransactionRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('transaction_rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets transaction_rules + * + * @return \Adyen\Model\BalancePlatform\TransactionRule[]|null + */ + public function getTransactionRules() + { + return $this->container['transaction_rules']; + } + + /** + * Sets transaction_rules + * + * @param \Adyen\Model\BalancePlatform\TransactionRule[]|null $transaction_rules List of transaction rules. + * + * @return self + */ + public function setTransactionRules($transaction_rules) + { + if (is_null($transaction_rules)) { + throw new \InvalidArgumentException('non-nullable transaction_rules cannot be null'); + } + $this->container['transaction_rules'] = $transaction_rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php new file mode 100644 index 000000000..d27f1bb31 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php @@ -0,0 +1,495 @@ + + */ +class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UKLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'sort_code' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'sort_code' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'sort_code' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'sort_code' => 'sortCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'sort_code' => 'setSortCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'sort_code' => 'getSortCode', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_UK_LOCAL = 'ukLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UK_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('sort_code', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'ukLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['sort_code'] === null) { + $invalidProperties[] = "'sort_code' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The 8-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets sort_code + * + * @return string + */ + public function getSortCode() + { + return $this->container['sort_code']; + } + + /** + * Sets sort_code + * + * @param string $sort_code The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sort_code) + { + if (is_null($sort_code)) { + throw new \InvalidArgumentException('non-nullable sort_code cannot be null'); + } + $this->container['sort_code'] = $sort_code; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **ukLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php new file mode 100644 index 000000000..25f4f8e9d --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php @@ -0,0 +1,562 @@ + + */ +class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'USLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_number' => 'string', + 'account_type' => 'string', + 'routing_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_number' => null, + 'account_type' => null, + 'routing_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_number' => false, + 'account_type' => false, + 'routing_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_number' => 'accountNumber', + 'account_type' => 'accountType', + 'routing_number' => 'routingNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_number' => 'setAccountNumber', + 'account_type' => 'setAccountType', + 'routing_number' => 'setRoutingNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_number' => 'getAccountNumber', + 'account_type' => 'getAccountType', + 'routing_number' => 'getRoutingNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACCOUNT_TYPE_CHECKING = 'checking'; + public const ACCOUNT_TYPE_SAVINGS = 'savings'; + public const TYPE_US_LOCAL = 'usLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_CHECKING, + self::ACCOUNT_TYPE_SAVINGS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_US_LOCAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('account_type', $data ?? [], 'checking'); + $this->setIfExists('routing_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['account_type']) && !in_array($this->container['account_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_type', must be one of '%s'", + $this->container['account_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['routing_number'] === null) { + $invalidProperties[] = "'routing_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number The bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($account_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_type', must be one of '%s'", + $account_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets routing_number + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routing_number']; + } + + /** + * Sets routing_number + * + * @param string $routing_number The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routing_number) + { + if (is_null($routing_number)) { + throw new \InvalidArgumentException('non-nullable routing_number cannot be null'); + } + $this->container['routing_number'] = $routing_number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php new file mode 100644 index 000000000..d66b4e70d --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -0,0 +1,888 @@ + + */ +class UpdatePaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdatePaymentInstrument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_account_id' => 'string', + 'bank_account' => '\Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount', + 'card' => '\Adyen\Model\BalancePlatform\Card', + 'description' => 'string', + 'id' => 'string', + 'issuing_country_code' => 'string', + 'payment_instrument_group_id' => 'string', + 'reference' => 'string', + 'status' => 'string', + 'status_comment' => 'string', + 'status_reason' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_account_id' => null, + 'bank_account' => null, + 'card' => null, + 'description' => null, + 'id' => null, + 'issuing_country_code' => null, + 'payment_instrument_group_id' => null, + 'reference' => null, + 'status' => null, + 'status_comment' => null, + 'status_reason' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_account_id' => false, + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_account_id' => 'balanceAccountId', + 'bank_account' => 'bankAccount', + 'card' => 'card', + 'description' => 'description', + 'id' => 'id', + 'issuing_country_code' => 'issuingCountryCode', + 'payment_instrument_group_id' => 'paymentInstrumentGroupId', + 'reference' => 'reference', + 'status' => 'status', + 'status_comment' => 'statusComment', + 'status_reason' => 'statusReason', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_account_id' => 'setBalanceAccountId', + 'bank_account' => 'setBankAccount', + 'card' => 'setCard', + 'description' => 'setDescription', + 'id' => 'setId', + 'issuing_country_code' => 'setIssuingCountryCode', + 'payment_instrument_group_id' => 'setPaymentInstrumentGroupId', + 'reference' => 'setReference', + 'status' => 'setStatus', + 'status_comment' => 'setStatusComment', + 'status_reason' => 'setStatusReason', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_account_id' => 'getBalanceAccountId', + 'bank_account' => 'getBankAccount', + 'card' => 'getCard', + 'description' => 'getDescription', + 'id' => 'getId', + 'issuing_country_code' => 'getIssuingCountryCode', + 'payment_instrument_group_id' => 'getPaymentInstrumentGroupId', + 'reference' => 'getReference', + 'status' => 'getStatus', + 'status_comment' => 'getStatusComment', + 'status_reason' => 'getStatusReason', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + public const STATUS_SUSPENDED = 'suspended'; + public const STATUS_REASON_ACCOUNT_CLOSURE = 'accountClosure'; + public const STATUS_REASON_DAMAGED = 'damaged'; + public const STATUS_REASON_END_OF_LIFE = 'endOfLife'; + public const STATUS_REASON_EXPIRED = 'expired'; + public const STATUS_REASON_LOST = 'lost'; + public const STATUS_REASON_OTHER = 'other'; + public const STATUS_REASON_STOLEN = 'stolen'; + public const STATUS_REASON_SUSPECTED_FRAUD = 'suspectedFraud'; + public const TYPE_BANK_ACCOUNT = 'bankAccount'; + public const TYPE_CARD = 'card'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + self::STATUS_SUSPENDED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusReasonAllowableValues() + { + return [ + self::STATUS_REASON_ACCOUNT_CLOSURE, + self::STATUS_REASON_DAMAGED, + self::STATUS_REASON_END_OF_LIFE, + self::STATUS_REASON_EXPIRED, + self::STATUS_REASON_LOST, + self::STATUS_REASON_OTHER, + self::STATUS_REASON_STOLEN, + self::STATUS_REASON_SUSPECTED_FRAUD, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK_ACCOUNT, + self::TYPE_CARD, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_account_id', $data ?? [], null); + $this->setIfExists('bank_account', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('issuing_country_code', $data ?? [], null); + $this->setIfExists('payment_instrument_group_id', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('status_comment', $data ?? [], null); + $this->setIfExists('status_reason', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balance_account_id'] === null) { + $invalidProperties[] = "'balance_account_id' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['issuing_country_code'] === null) { + $invalidProperties[] = "'issuing_country_code' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!is_null($this->container['status_reason']) && !in_array($this->container['status_reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status_reason', must be one of '%s'", + $this->container['status_reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance_account_id + * + * @return string + */ + public function getBalanceAccountId() + { + return $this->container['balance_account_id']; + } + + /** + * Sets balance_account_id + * + * @param string $balance_account_id The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + * + * @return self + */ + public function setBalanceAccountId($balance_account_id) + { + if (is_null($balance_account_id)) { + throw new \InvalidArgumentException('non-nullable balance_account_id cannot be null'); + } + $this->container['balance_account_id'] = $balance_account_id; + + return $this; + } + + /** + * Gets bank_account + * + * @return \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null + */ + public function getBankAccount() + { + return $this->container['bank_account']; + } + + /** + * Sets bank_account + * + * @param \Adyen\Model\BalancePlatform\PaymentInstrumentBankAccount|null $bank_account bank_account + * + * @return self + */ + public function setBankAccount($bank_account) + { + if (is_null($bank_account)) { + throw new \InvalidArgumentException('non-nullable bank_account cannot be null'); + } + $this->container['bank_account'] = $bank_account; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\BalancePlatform\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\BalancePlatform\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the payment instrument, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the payment instrument. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets issuing_country_code + * + * @return string + */ + public function getIssuingCountryCode() + { + return $this->container['issuing_country_code']; + } + + /** + * Sets issuing_country_code + * + * @param string $issuing_country_code The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + * + * @return self + */ + public function setIssuingCountryCode($issuing_country_code) + { + if (is_null($issuing_country_code)) { + throw new \InvalidArgumentException('non-nullable issuing_country_code cannot be null'); + } + $this->container['issuing_country_code'] = $issuing_country_code; + + return $this; + } + + /** + * Gets payment_instrument_group_id + * + * @return string|null + */ + public function getPaymentInstrumentGroupId() + { + return $this->container['payment_instrument_group_id']; + } + + /** + * Sets payment_instrument_group_id + * + * @param string|null $payment_instrument_group_id The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + * + * @return self + */ + public function setPaymentInstrumentGroupId($payment_instrument_group_id) + { + if (is_null($payment_instrument_group_id)) { + throw new \InvalidArgumentException('non-nullable payment_instrument_group_id cannot be null'); + } + $this->container['payment_instrument_group_id'] = $payment_instrument_group_id; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment instrument, maximum 150 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets status_comment + * + * @return string|null + */ + public function getStatusComment() + { + return $this->container['status_comment']; + } + + /** + * Sets status_comment + * + * @param string|null $status_comment Comment for the status of the payment instrument. Required if `statusReason` is **other**. + * + * @return self + */ + public function setStatusComment($status_comment) + { + if (is_null($status_comment)) { + throw new \InvalidArgumentException('non-nullable status_comment cannot be null'); + } + $this->container['status_comment'] = $status_comment; + + return $this; + } + + /** + * Gets status_reason + * + * @return string|null + */ + public function getStatusReason() + { + return $this->container['status_reason']; + } + + /** + * Sets status_reason + * + * @param string|null $status_reason The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * + * @return self + */ + public function setStatusReason($status_reason) + { + if (is_null($status_reason)) { + throw new \InvalidArgumentException('non-nullable status_reason cannot be null'); + } + $allowedValues = $this->getStatusReasonAllowableValues(); + if (!in_array($status_reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status_reason', must be one of '%s'", + $status_reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status_reason'] = $status_reason; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of payment instrument. Possible value: **card**, **bankAccount**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php new file mode 100644 index 000000000..0b3449107 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -0,0 +1,546 @@ + + */ +class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VerificationDeadline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'capabilities' => 'string[]', + 'expires_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'capabilities' => null, + 'expires_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'capabilities' => false, + 'expires_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'capabilities' => 'capabilities', + 'expires_at' => 'expiresAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'capabilities' => 'setCapabilities', + 'expires_at' => 'setExpiresAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'capabilities' => 'getCapabilities', + 'expires_at' => 'getExpiresAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CAPABILITIES_ACCEPT_EXTERNAL_FUNDING = 'acceptExternalFunding'; + public const CAPABILITIES_ACCEPT_PSP_FUNDING = 'acceptPspFunding'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES = 'acceptTransactionInRestrictedCountries'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'acceptTransactionInRestrictedCountriesCommercial'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_CONSUMER = 'acceptTransactionInRestrictedCountriesConsumer'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES = 'acceptTransactionInRestrictedIndustries'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_COMMERCIAL = 'acceptTransactionInRestrictedIndustriesCommercial'; + public const CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_CONSUMER = 'acceptTransactionInRestrictedIndustriesConsumer'; + public const CAPABILITIES_ACQUIRING = 'acquiring'; + public const CAPABILITIES_ATM_WITHDRAWAL = 'atmWithdrawal'; + public const CAPABILITIES_ATM_WITHDRAWAL_COMMERCIAL = 'atmWithdrawalCommercial'; + public const CAPABILITIES_ATM_WITHDRAWAL_CONSUMER = 'atmWithdrawalConsumer'; + public const CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES = 'atmWithdrawalInRestrictedCountries'; + public const CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'atmWithdrawalInRestrictedCountriesCommercial'; + public const CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_CONSUMER = 'atmWithdrawalInRestrictedCountriesConsumer'; + public const CAPABILITIES_AUTHORISED_PAYMENT_INSTRUMENT_USER = 'authorisedPaymentInstrumentUser'; + public const CAPABILITIES_GET_GRANT_OFFERS = 'getGrantOffers'; + public const CAPABILITIES_ISSUE_BANK_ACCOUNT = 'issueBankAccount'; + public const CAPABILITIES_ISSUE_CARD = 'issueCard'; + public const CAPABILITIES_ISSUE_CARD_COMMERCIAL = 'issueCardCommercial'; + public const CAPABILITIES_ISSUE_CARD_CONSUMER = 'issueCardConsumer'; + public const CAPABILITIES_LOCAL_ACCEPTANCE = 'localAcceptance'; + public const CAPABILITIES_PAYOUT = 'payout'; + public const CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT = 'payoutToTransferInstrument'; + public const CAPABILITIES_PROCESSING = 'processing'; + public const CAPABILITIES_RECEIVE_FROM_BALANCE_ACCOUNT = 'receiveFromBalanceAccount'; + public const CAPABILITIES_RECEIVE_FROM_PLATFORM_PAYMENTS = 'receiveFromPlatformPayments'; + public const CAPABILITIES_RECEIVE_FROM_THIRD_PARTY = 'receiveFromThirdParty'; + public const CAPABILITIES_RECEIVE_FROM_TRANSFER_INSTRUMENT = 'receiveFromTransferInstrument'; + public const CAPABILITIES_RECEIVE_GRANTS = 'receiveGrants'; + public const CAPABILITIES_RECEIVE_PAYMENTS = 'receivePayments'; + public const CAPABILITIES_SEND_TO_BALANCE_ACCOUNT = 'sendToBalanceAccount'; + public const CAPABILITIES_SEND_TO_THIRD_PARTY = 'sendToThirdParty'; + public const CAPABILITIES_SEND_TO_TRANSFER_INSTRUMENT = 'sendToTransferInstrument'; + public const CAPABILITIES_THIRD_PARTY_FUNDING = 'thirdPartyFunding'; + public const CAPABILITIES_USE_CARD = 'useCard'; + public const CAPABILITIES_USE_CARD_COMMERCIAL = 'useCardCommercial'; + public const CAPABILITIES_USE_CARD_CONSUMER = 'useCardConsumer'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES = 'useCardInRestrictedCountries'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'useCardInRestrictedCountriesCommercial'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_CONSUMER = 'useCardInRestrictedCountriesConsumer'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES = 'useCardInRestrictedIndustries'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_COMMERCIAL = 'useCardInRestrictedIndustriesCommercial'; + public const CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_CONSUMER = 'useCardInRestrictedIndustriesConsumer'; + public const CAPABILITIES_WITHDRAW_FROM_ATM = 'withdrawFromAtm'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_COMMERCIAL = 'withdrawFromAtmCommercial'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_CONSUMER = 'withdrawFromAtmConsumer'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES = 'withdrawFromAtmInRestrictedCountries'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'withdrawFromAtmInRestrictedCountriesCommercial'; + public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER = 'withdrawFromAtmInRestrictedCountriesConsumer'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCapabilitiesAllowableValues() + { + return [ + self::CAPABILITIES_ACCEPT_EXTERNAL_FUNDING, + self::CAPABILITIES_ACCEPT_PSP_FUNDING, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_COUNTRIES_CONSUMER, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_COMMERCIAL, + self::CAPABILITIES_ACCEPT_TRANSACTION_IN_RESTRICTED_INDUSTRIES_CONSUMER, + self::CAPABILITIES_ACQUIRING, + self::CAPABILITIES_ATM_WITHDRAWAL, + self::CAPABILITIES_ATM_WITHDRAWAL_COMMERCIAL, + self::CAPABILITIES_ATM_WITHDRAWAL_CONSUMER, + self::CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_ATM_WITHDRAWAL_IN_RESTRICTED_COUNTRIES_CONSUMER, + self::CAPABILITIES_AUTHORISED_PAYMENT_INSTRUMENT_USER, + self::CAPABILITIES_GET_GRANT_OFFERS, + self::CAPABILITIES_ISSUE_BANK_ACCOUNT, + self::CAPABILITIES_ISSUE_CARD, + self::CAPABILITIES_ISSUE_CARD_COMMERCIAL, + self::CAPABILITIES_ISSUE_CARD_CONSUMER, + self::CAPABILITIES_LOCAL_ACCEPTANCE, + self::CAPABILITIES_PAYOUT, + self::CAPABILITIES_PAYOUT_TO_TRANSFER_INSTRUMENT, + self::CAPABILITIES_PROCESSING, + self::CAPABILITIES_RECEIVE_FROM_BALANCE_ACCOUNT, + self::CAPABILITIES_RECEIVE_FROM_PLATFORM_PAYMENTS, + self::CAPABILITIES_RECEIVE_FROM_THIRD_PARTY, + self::CAPABILITIES_RECEIVE_FROM_TRANSFER_INSTRUMENT, + self::CAPABILITIES_RECEIVE_GRANTS, + self::CAPABILITIES_RECEIVE_PAYMENTS, + self::CAPABILITIES_SEND_TO_BALANCE_ACCOUNT, + self::CAPABILITIES_SEND_TO_THIRD_PARTY, + self::CAPABILITIES_SEND_TO_TRANSFER_INSTRUMENT, + self::CAPABILITIES_THIRD_PARTY_FUNDING, + self::CAPABILITIES_USE_CARD, + self::CAPABILITIES_USE_CARD_COMMERCIAL, + self::CAPABILITIES_USE_CARD_CONSUMER, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_COUNTRIES_CONSUMER, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_COMMERCIAL, + self::CAPABILITIES_USE_CARD_IN_RESTRICTED_INDUSTRIES_CONSUMER, + self::CAPABILITIES_WITHDRAW_FROM_ATM, + self::CAPABILITIES_WITHDRAW_FROM_ATM_COMMERCIAL, + self::CAPABILITIES_WITHDRAW_FROM_ATM_CONSUMER, + self::CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES, + self::CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL, + self::CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('capabilities', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['capabilities'] === null) { + $invalidProperties[] = "'capabilities' can't be null"; + } + if ($this->container['expires_at'] === null) { + $invalidProperties[] = "'expires_at' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets capabilities + * + * @return string[] + */ + public function getCapabilities() + { + return $this->container['capabilities']; + } + + /** + * Sets capabilities + * + * @param string[] $capabilities The names of the capabilities to be disallowed. + * + * @return self + */ + public function setCapabilities($capabilities) + { + if (is_null($capabilities)) { + throw new \InvalidArgumentException('non-nullable capabilities cannot be null'); + } + $allowedValues = $this->getCapabilitiesAllowableValues(); + if (array_diff($capabilities, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'capabilities', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['capabilities'] = $capabilities; + + return $this; + } + + /** + * Gets expires_at + * + * @return \DateTime + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param \DateTime $expires_at The date that verification is due by before capabilities are disallowed. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_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 + ); + } +} diff --git a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php new file mode 100644 index 000000000..3bed473cc --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php @@ -0,0 +1,107 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get an account holder + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\AccountHolder + * @throws AdyenException + */ + public function getAccountHolder(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\AccountHolder + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/accountHolders/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\AccountHolder::class); + } + + /** + * Get all balance accounts of an account holder + * + * @param string $id + * @param int $offset + * @param int $limit + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaginatedBalanceAccountsResponse + * @throws AdyenException + */ + public function getAllBalanceAccountsOfAccountHolder(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaginatedBalanceAccountsResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/accountHolders/{id}/balanceAccounts"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaginatedBalanceAccountsResponse::class); + } + + /** + * Update an account holder + * + * @param string $id + * @param \Adyen\Model\BalancePlatform\AccountHolder $accountHolder + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\AccountHolder + * @throws AdyenException + */ + public function updateAccountHolder(string $id, \Adyen\Model\BalancePlatform\AccountHolder $accountHolder, array $requestOptions = null): \Adyen\Model\BalancePlatform\AccountHolder + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/accountHolders/{id}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $accountHolder->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\AccountHolder::class); + } + + /** + * Create an account holder + * + * @param \Adyen\Model\BalancePlatform\AccountHolderInfo $accountHolderInfo + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\AccountHolder + * @throws AdyenException + */ + public function createAccountHolder(\Adyen\Model\BalancePlatform\AccountHolderInfo $accountHolderInfo, array $requestOptions = null): \Adyen\Model\BalancePlatform\AccountHolder + { + $endpoint = $this->baseURL . "/accountHolders"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $accountHolderInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\AccountHolder::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php new file mode 100644 index 000000000..4268d536a --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -0,0 +1,189 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Delete a sweep + * + * @param string $balanceAccountId + * @param string $sweepId + * @param array $requestOptions + + * @throws AdyenException + */ + public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + + } + + /** + * Get all sweeps for a balance account + * + * @param string $balanceAccountId + * @param int $offset + * @param int $limit + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse + * @throws AdyenException + */ + public function getAllSweepsForBalanceAccount(string $balanceAccountId, array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/sweeps"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse::class); + } + + /** + * Get a sweep + * + * @param string $balanceAccountId + * @param string $sweepId + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 + * @throws AdyenException + */ + public function getSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); + } + + /** + * Get a balance account + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\BalanceAccount + * @throws AdyenException + */ + public function getBalanceAccount(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceAccount + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balanceAccounts/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccount::class); + } + + /** + * Get all payment instruments for a balance account + * + * @param string $id + * @param int $offset + * @param int $limit + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaginatedPaymentInstrumentsResponse + * @throws AdyenException + */ + public function getAllPaymentInstrumentsForBalanceAccount(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaginatedPaymentInstrumentsResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balanceAccounts/{id}/paymentInstruments"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaginatedPaymentInstrumentsResponse::class); + } + + /** + * Update a sweep + * + * @param string $balanceAccountId + * @param string $sweepId + * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 + * @throws AdyenException + */ + public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2, array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $sweepConfigurationV2->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); + } + + /** + * Update a balance account + * + * @param string $id + * @param \Adyen\Model\BalancePlatform\BalanceAccountUpdateRequest $balanceAccountUpdateRequest + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\BalanceAccount + * @throws AdyenException + */ + public function updateBalanceAccount(string $id, \Adyen\Model\BalancePlatform\BalanceAccountUpdateRequest $balanceAccountUpdateRequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceAccount + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balanceAccounts/{id}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $balanceAccountUpdateRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccount::class); + } + + /** + * Create a balance account + * + * @param \Adyen\Model\BalancePlatform\BalanceAccountInfo $balanceAccountInfo + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\BalanceAccount + * @throws AdyenException + */ + public function createBalanceAccount(\Adyen\Model\BalancePlatform\BalanceAccountInfo $balanceAccountInfo, array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceAccount + { + $endpoint = $this->baseURL . "/balanceAccounts"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $balanceAccountInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccount::class); + } + + /** + * Create a sweep + * + * @param string $balanceAccountId + * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 + * @throws AdyenException + */ + public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2, array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/sweeps"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $sweepConfigurationV2->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php new file mode 100644 index 000000000..afcf3f087 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -0,0 +1,59 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Validate a bank account + * + * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest + * @param array $requestOptions + * @return object + * @throws AdyenException + */ + public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null): object + { + $endpoint = $this->baseURL . "/validateBankAccountIdentification"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, object::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php new file mode 100644 index 000000000..6858d7500 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php @@ -0,0 +1,89 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a payment instrument group + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup + * @throws AdyenException + */ + public function getPaymentInstrumentGroup(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaymentInstrumentGroup + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/paymentInstrumentGroups/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaymentInstrumentGroup::class); + } + + /** + * Get all transaction rules for a payment instrument group + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse + * @throws AdyenException + */ + public function getAllTransactionRulesForPaymentInstrumentGroup(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRulesResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/paymentInstrumentGroups/{id}/transactionRules"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRulesResponse::class); + } + + /** + * Create a payment instrument group + * + * @param \Adyen\Model\BalancePlatform\PaymentInstrumentGroupInfo $paymentInstrumentGroupInfo + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup + * @throws AdyenException + */ + public function createPaymentInstrumentGroup(\Adyen\Model\BalancePlatform\PaymentInstrumentGroupInfo $paymentInstrumentGroupInfo, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaymentInstrumentGroup + { + $endpoint = $this->baseURL . "/paymentInstrumentGroups"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentInstrumentGroupInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaymentInstrumentGroup::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php new file mode 100644 index 000000000..e4373e22f --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php @@ -0,0 +1,120 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a payment instrument + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaymentInstrument + * @throws AdyenException + */ + public function getPaymentInstrument(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaymentInstrument + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/paymentInstruments/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaymentInstrument::class); + } + + /** + * Get the PAN of a payment instrument + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaymentInstrumentRevealInfo + * @throws AdyenException + */ + public function getPanOfPaymentInstrument(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaymentInstrumentRevealInfo + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/paymentInstruments/{id}/reveal"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaymentInstrumentRevealInfo::class); + } + + /** + * Get all transaction rules for a payment instrument + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse + * @throws AdyenException + */ + public function getAllTransactionRulesForPaymentInstrument(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRulesResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/paymentInstruments/{id}/transactionRules"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRulesResponse::class); + } + + /** + * Update a payment instrument + * + * @param string $id + * @param \Adyen\Model\BalancePlatform\PaymentInstrumentUpdateRequest $paymentInstrumentUpdateRequest + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\UpdatePaymentInstrument + * @throws AdyenException + */ + public function updatePaymentInstrument(string $id, \Adyen\Model\BalancePlatform\PaymentInstrumentUpdateRequest $paymentInstrumentUpdateRequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\UpdatePaymentInstrument + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/paymentInstruments/{id}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $paymentInstrumentUpdateRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\UpdatePaymentInstrument::class); + } + + /** + * Create a payment instrument + * + * @param \Adyen\Model\BalancePlatform\PaymentInstrumentInfo $paymentInstrumentInfo + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaymentInstrument + * @throws AdyenException + */ + public function createPaymentInstrument(\Adyen\Model\BalancePlatform\PaymentInstrumentInfo $paymentInstrumentInfo, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaymentInstrument + { + $endpoint = $this->baseURL . "/paymentInstruments"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentInstrumentInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaymentInstrument::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/PlatformApi.php b/src/Adyen/Service/BalancePlatform/PlatformApi.php new file mode 100644 index 000000000..80267a016 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/PlatformApi.php @@ -0,0 +1,76 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a balance platform + * + * @param string $id + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\BalancePlatform + * @throws AdyenException + */ + public function getBalancePlatform(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\BalancePlatform + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balancePlatforms/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalancePlatform::class); + } + + /** + * Get all account holders under a balance platform + * + * @param string $id + * @param int $offset + * @param int $limit + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\PaginatedAccountHoldersResponse + * @throws AdyenException + */ + public function getAllAccountHoldersUnderBalancePlatform(string $id, array $requestOptions = null): \Adyen\Model\BalancePlatform\PaginatedAccountHoldersResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balancePlatforms/{id}/accountHolders"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaginatedAccountHoldersResponse::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php new file mode 100644 index 000000000..076c7d4f7 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php @@ -0,0 +1,105 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Delete a transaction rule + * + * @param string $transactionRuleId + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRule + * @throws AdyenException + */ + public function deleteTransactionRule(string $transactionRuleId, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRule + { + $endpoint = $this->baseURL . str_replace(['{transactionRuleId}'], [$transactionRuleId], "/transactionRules/{transactionRuleId}"); + $response = $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRule::class); + } + + /** + * Get a transaction rule + * + * @param string $transactionRuleId + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRuleResponse + * @throws AdyenException + */ + public function getTransactionRule(string $transactionRuleId, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRuleResponse + { + $endpoint = $this->baseURL . str_replace(['{transactionRuleId}'], [$transactionRuleId], "/transactionRules/{transactionRuleId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRuleResponse::class); + } + + /** + * Update a transaction rule + * + * @param string $transactionRuleId + * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRule + * @throws AdyenException + */ + public function updateTransactionRule(string $transactionRuleId, \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRule + { + $endpoint = $this->baseURL . str_replace(['{transactionRuleId}'], [$transactionRuleId], "/transactionRules/{transactionRuleId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $transactionRuleInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRule::class); + } + + /** + * Create a transaction rule + * + * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo + * @param array $requestOptions + * @return \Adyen\Model\BalancePlatform\TransactionRule + * @throws AdyenException + */ + public function createTransactionRule(\Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransactionRule + { + $endpoint = $this->baseURL . "/transactionRules"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $transactionRuleInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransactionRule::class); + } +} diff --git a/templates/model.mustache b/templates/model.mustache index b13e596b0..f8f989b11 100644 --- a/templates/model.mustache +++ b/templates/model.mustache @@ -28,4 +28,4 @@ use {{modelPackage}}\ObjectSerializer; {{/isEnum}} */ {{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model_generic}}{{/isEnum}} -{{/model}}{{/models}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/templates/model_generic.mustache b/templates/model_generic.mustache index 51ea05b80..c7d73c0b1 100644 --- a/templates/model_generic.mustache +++ b/templates/model_generic.mustache @@ -192,6 +192,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par return self::$openAPIModelName; } + {{^oneOf}} {{#vars}} {{#isEnum}} {{#allowableValues}} @@ -216,9 +217,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par {{/-last}}{{/enumVars}}{{/allowableValues}} ]; } - {{/isEnum}} {{/vars}} + {{/oneOf}} {{^parentSchema}} /** * Associative array for storing property values @@ -290,6 +291,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par {{/required}} {{#isEnum}} {{^isContainer}} + {{^oneOf}} $allowedValues = $this->{{getter}}AllowableValues(); if (!is_null($this->container['{{name}}']) && !in_array($this->container['{{name}}'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -298,6 +300,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par implode("', '", $allowedValues) ); } + {{/oneOf}} {{/isContainer}} {{/isEnum}} @@ -367,6 +370,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par } {{/isInteger}} {{/isNullable}} + {{^oneOf}} {{#isEnum}} $allowedValues = $this->{{getter}}AllowableValues(); {{^isContainer}} @@ -391,6 +395,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par } {{/isContainer}} {{/isEnum}} + {{/oneOf}} $this->container['{{name}}'] = ${{name}}; return $this; @@ -475,4 +480,4 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par JSON_PRETTY_PRINT ); } -} +} \ No newline at end of file From b1cd8fb36bed6c15ca1a455db9b580f7cf711544 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 31 Mar 2023 13:42:11 +0200 Subject: [PATCH 03/33] added tests and a class to catch the service url creation --- src/Adyen/HttpClient/ClientInterface.php | 15 +++ .../AULocalAccountIdentification.php | 6 +- .../Model/BalancePlatform/AccountHolder.php | 22 ++-- .../AccountHolderCapability.php | 20 ++-- .../BalancePlatform/AccountHolderInfo.php | 14 +-- .../AccountSupportingEntityCapability.php | 14 +-- .../ActiveNetworkTokensRestriction.php | 4 +- .../AdditionalBankIdentification.php | 4 +- src/Adyen/Model/BalancePlatform/Address.php | 12 +- src/Adyen/Model/BalancePlatform/Address2.php | 14 +-- src/Adyen/Model/BalancePlatform/Amount.php | 4 +- .../Model/BalancePlatform/Authentication.php | 6 +- src/Adyen/Model/BalancePlatform/Balance.php | 8 +- .../Model/BalancePlatform/BalanceAccount.php | 16 +-- .../BalancePlatform/BalanceAccountInfo.php | 10 +- .../BalanceAccountUpdateRequest.php | 12 +- .../Model/BalancePlatform/BalancePlatform.php | 6 +- .../BalanceSweepConfigurationsResponse.php | 6 +- ...AccountIdentificationValidationRequest.php | 2 +- ...ValidationRequestAccountIdentification.php | 26 ++--- .../BrandVariantsRestriction.php | 4 +- .../Model/BalancePlatform/BulkAddress.php | 18 +-- .../CALocalAccountIdentification.php | 10 +- .../CZLocalAccountIdentification.php | 6 +- src/Adyen/Model/BalancePlatform/Card.php | 24 ++-- .../BalancePlatform/CardConfiguration.php | 28 ++--- src/Adyen/Model/BalancePlatform/CardInfo.php | 14 +-- .../Model/BalancePlatform/ContactDetails.php | 8 +- .../BalancePlatform/CountriesRestriction.php | 4 +- .../BalancePlatform/CronSweepSchedule.php | 4 +- .../BalancePlatform/DayOfWeekRestriction.php | 4 +- .../Model/BalancePlatform/DeliveryContact.php | 12 +- .../DifferentCurrenciesRestriction.php | 4 +- src/Adyen/Model/BalancePlatform/Duration.php | 4 +- .../BalancePlatform/EntryModesRestriction.php | 4 +- src/Adyen/Model/BalancePlatform/Expiry.php | 4 +- .../HULocalAccountIdentification.php | 4 +- .../IbanAccountIdentification.php | 4 +- .../InternationalTransactionRestriction.php | 4 +- .../Model/BalancePlatform/InvalidField.php | 6 +- .../Model/BalancePlatform/JSONObject.php | 4 +- src/Adyen/Model/BalancePlatform/JSONPath.php | 2 +- .../MatchingTransactionsRestriction.php | 4 +- .../Model/BalancePlatform/MccsRestriction.php | 4 +- .../BalancePlatform/MerchantAcquirerPair.php | 4 +- .../MerchantNamesRestriction.php | 4 +- .../BalancePlatform/MerchantsRestriction.php | 4 +- .../NOLocalAccountIdentification.php | 4 +- src/Adyen/Model/BalancePlatform/Name.php | 4 +- .../NumberAndBicAccountIdentification.php | 8 +- .../BalancePlatform/ObjectSerializer.php | 11 +- .../PLLocalAccountIdentification.php | 4 +- .../PaginatedAccountHoldersResponse.php | 6 +- .../PaginatedBalanceAccountsResponse.php | 6 +- .../PaginatedPaymentInstrumentsResponse.php | 6 +- .../BalancePlatform/PaymentInstrument.php | 22 ++-- .../PaymentInstrumentBankAccount.php | 10 +- .../PaymentInstrumentGroup.php | 12 +- .../PaymentInstrumentGroupInfo.php | 10 +- .../BalancePlatform/PaymentInstrumentInfo.php | 18 +-- .../PaymentInstrumentRevealInfo.php | 6 +- .../PaymentInstrumentUpdateRequest.php | 10 +- src/Adyen/Model/BalancePlatform/Phone.php | 4 +- .../Model/BalancePlatform/PhoneNumber.php | 6 +- .../ProcessingTypesRestriction.php | 4 +- .../BalancePlatform/RestServiceError.php | 18 +-- .../SELocalAccountIdentification.php | 6 +- .../SGLocalAccountIdentification.php | 6 +- .../Model/BalancePlatform/StringMatch.php | 4 +- .../BalancePlatform/SweepConfigurationV2.php | 26 ++--- .../SweepConfigurationV2Schedule.php | 4 +- .../BalancePlatform/SweepCounterparty.php | 6 +- .../Model/BalancePlatform/SweepSchedule.php | 2 +- src/Adyen/Model/BalancePlatform/TimeOfDay.php | 4 +- .../BalancePlatform/TimeOfDayRestriction.php | 4 +- .../TotalAmountRestriction.php | 4 +- .../Model/BalancePlatform/TransactionRule.php | 28 ++--- .../TransactionRuleEntityKey.php | 4 +- .../BalancePlatform/TransactionRuleInfo.php | 26 ++--- .../TransactionRuleInterval.php | 12 +- .../TransactionRuleResponse.php | 2 +- .../TransactionRuleRestrictions.php | 28 ++--- .../TransactionRulesResponse.php | 2 +- .../UKLocalAccountIdentification.php | 6 +- .../USLocalAccountIdentification.php | 8 +- .../UpdatePaymentInstrument.php | 24 ++-- .../BalancePlatform/VerificationDeadline.php | 4 +- .../BalancePlatform/BalanceAccountsApi.php | 3 +- .../BankAccountValidationApi.php | 12 +- .../get-all-account-holders.json | 27 +++++ .../payment-instruments-groups.json | 12 ++ .../BalancePlatform/update-accountholder.json | 16 +++ tests/Unit/BalancePlatformTest.php | 105 ++++++++++++++++++ tests/Unit/UrlCheckClient.php | 31 ++++++ 94 files changed, 605 insertions(+), 397 deletions(-) create mode 100644 tests/Resources/BalancePlatform/get-all-account-holders.json create mode 100644 tests/Resources/BalancePlatform/payment-instruments-groups.json create mode 100644 tests/Resources/BalancePlatform/update-accountholder.json create mode 100644 tests/Unit/BalancePlatformTest.php create mode 100644 tests/Unit/UrlCheckClient.php diff --git a/src/Adyen/HttpClient/ClientInterface.php b/src/Adyen/HttpClient/ClientInterface.php index 5e75ce2e3..cb24550e9 100644 --- a/src/Adyen/HttpClient/ClientInterface.php +++ b/src/Adyen/HttpClient/ClientInterface.php @@ -33,4 +33,19 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params); * @return mixed */ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $method, $requestOptions = null); + + /** + * @param \Adyen\Service $service + * @param $requestUrl + * @param $bodyParams + * @param $method + * @return mixed + */ + public function requestHttpRest( + \Adyen\Service $service, + string $requestUrl, + $bodyParams, + string $method, + $requestOptions = null + ); } diff --git a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php index 24d9ac505..a777a4d80 100644 --- a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php @@ -72,8 +72,8 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false + 'bsb_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 709dee5d1..14b41d64a 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -88,16 +88,16 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'id' => false, - 'legal_entity_id' => false, - 'primary_balance_account' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false, - 'verification_deadlines' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'id' => false, + 'legal_entity_id' => false, + 'primary_balance_account' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false, + 'verification_deadlines' => false ]; /** @@ -752,7 +752,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php index 3d71d1a50..e3ae79713 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php @@ -86,15 +86,15 @@ class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'allowed_settings' => false, - 'enabled' => false, - 'problems' => false, - 'requested' => false, - 'requested_level' => false, - 'requested_settings' => false, - 'transfer_instruments' => false, - 'verification_status' => false + 'allowed_level' => false, + 'allowed_settings' => false, + 'enabled' => false, + 'problems' => false, + 'requested' => false, + 'requested_level' => false, + 'requested_settings' => false, + 'transfer_instruments' => false, + 'verification_status' => false ]; /** @@ -786,7 +786,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index 193594ffa..7ce6a8547 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -80,12 +80,12 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'legal_entity_id' => false, - 'reference' => false, - 'time_zone' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'legal_entity_id' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php index 48d14a6cc..f9dedc7a8 100644 --- a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php @@ -80,12 +80,12 @@ class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'enabled' => false, - 'id' => false, - 'requested' => false, - 'requested_level' => false, - 'verification_status' => false + 'allowed_level' => false, + 'enabled' => false, + 'id' => false, + 'requested' => false, + 'requested_level' => false, + 'verification_status' => false ]; /** @@ -684,7 +684,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php index efa8cf26b..53fedef8d 100644 --- a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php @@ -70,7 +70,7 @@ class ActiveNetworkTokensRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php index 7ccc21434..f38ce5c88 100644 --- a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php @@ -70,7 +70,7 @@ class AdditionalBankIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'code' => false, - 'type' => false + 'type' => false ]; /** @@ -436,7 +436,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address.php b/src/Adyen/Model/BalancePlatform/Address.php index 94ec71f14..0e6d16c24 100644 --- a/src/Adyen/Model/BalancePlatform/Address.php +++ b/src/Adyen/Model/BalancePlatform/Address.php @@ -78,11 +78,11 @@ class Address implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'house_number_or_name' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -554,7 +554,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address2.php b/src/Adyen/Model/BalancePlatform/Address2.php index 7d6648f03..122f3756e 100644 --- a/src/Adyen/Model/BalancePlatform/Address2.php +++ b/src/Adyen/Model/BalancePlatform/Address2.php @@ -80,12 +80,12 @@ class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'line1' => false, - 'line2' => false, - 'line3' => false, - 'postal_code' => false, - 'state_or_province' => false + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php index 5bf62d874..e0161429c 100644 --- a/src/Adyen/Model/BalancePlatform/Amount.php +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -70,7 +70,7 @@ class Amount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'currency' => false, - 'value' => false + 'value' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Authentication.php b/src/Adyen/Model/BalancePlatform/Authentication.php index 5c7fdbb4f..a62b4e681 100644 --- a/src/Adyen/Model/BalancePlatform/Authentication.php +++ b/src/Adyen/Model/BalancePlatform/Authentication.php @@ -72,8 +72,8 @@ class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'email' => false, - 'password' => false, - 'phone' => false + 'password' => false, + 'phone' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 8ad88e526..52852c3fe 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -74,9 +74,9 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'available' => false, - 'balance' => false, - 'currency' => false, - 'reserved' => false + 'balance' => false, + 'currency' => false, + 'reserved' => false ]; /** @@ -483,7 +483,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php index 537594491..80117eb2e 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccount.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -82,13 +82,13 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'balances' => false, - 'default_currency_code' => false, - 'description' => false, - 'id' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'balances' => false, + 'default_currency_code' => false, + 'description' => false, + 'id' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -650,7 +650,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php index 5692fa378..b15f90c8b 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -76,10 +76,10 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -508,7 +508,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index 03c75d32d..6f82a2ea3 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -78,11 +78,11 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatform.php b/src/Adyen/Model/BalancePlatform/BalancePlatform.php index fe53ad778..4dcf14f06 100644 --- a/src/Adyen/Model/BalancePlatform/BalancePlatform.php +++ b/src/Adyen/Model/BalancePlatform/BalancePlatform.php @@ -72,8 +72,8 @@ class BalancePlatform implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'description' => false, - 'id' => false, - 'status' => false + 'id' => false, + 'status' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php index ee1614c42..2849548bf 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php +++ b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php @@ -72,8 +72,8 @@ class BalanceSweepConfigurationsResponse implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'sweeps' => false + 'has_previous' => false, + 'sweeps' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php index 53542da7c..b545b6948 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php @@ -372,7 +372,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index 319aa44b3..a866b671c 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -93,18 +93,18 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'bank_code' => false, - 'iban' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'clearing_number' => false, - 'sort_code' => false, - 'routing_number' => false + 'bsb_code' => false, + 'type' => false, + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'bank_code' => false, + 'iban' => false, + 'additional_bank_identification' => false, + 'bic' => false, + 'clearing_number' => false, + 'sort_code' => false, + 'routing_number' => false ]; /** @@ -812,7 +812,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php index dbc1b317a..0ed0914b1 100644 --- a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php @@ -70,7 +70,7 @@ class BrandVariantsRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BulkAddress.php b/src/Adyen/Model/BalancePlatform/BulkAddress.php index 21cb09b88..8b4f1e145 100644 --- a/src/Adyen/Model/BalancePlatform/BulkAddress.php +++ b/src/Adyen/Model/BalancePlatform/BulkAddress.php @@ -84,14 +84,14 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'company' => false, - 'country' => false, - 'email' => false, - 'house_number_or_name' => false, - 'mobile' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'company' => false, + 'country' => false, + 'email' => false, + 'house_number_or_name' => false, + 'mobile' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -644,7 +644,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php index cabb2a927..5c2782f99 100644 --- a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php @@ -76,10 +76,10 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'type' => false + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'type' => false ]; /** @@ -581,7 +581,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php index 7796cd397..7d5d1191e 100644 --- a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php @@ -72,8 +72,8 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bank_code' => false, - 'type' => false + 'bank_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php index a0f59f249..e10e5b036 100644 --- a/src/Adyen/Model/BalancePlatform/Card.php +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -90,17 +90,17 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'bin' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'cvc' => false, - 'delivery_contact' => false, - 'expiration' => false, - 'form_factor' => false, - 'last_four' => false, - 'number' => false + 'bin' => false, + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'cvc' => false, + 'delivery_contact' => false, + 'expiration' => false, + 'form_factor' => false, + 'last_four' => false, + 'number' => false ]; /** @@ -793,7 +793,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php index 407696741..0aa41d2fe 100644 --- a/src/Adyen/Model/BalancePlatform/CardConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -94,19 +94,19 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'activation' => false, - 'activation_url' => false, - 'bulk_address' => false, - 'card_image_id' => false, - 'carrier' => false, - 'carrier_image_id' => false, - 'configuration_profile_id' => false, - 'currency' => false, - 'envelope' => false, - 'insert' => false, - 'language' => false, - 'logo_image_id' => false, - 'pin_mailer' => false, - 'shipment_method' => false + 'activation_url' => false, + 'bulk_address' => false, + 'card_image_id' => false, + 'carrier' => false, + 'carrier_image_id' => false, + 'configuration_profile_id' => false, + 'currency' => false, + 'envelope' => false, + 'insert' => false, + 'language' => false, + 'logo_image_id' => false, + 'pin_mailer' => false, + 'shipment_method' => false ]; /** @@ -814,7 +814,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardInfo.php b/src/Adyen/Model/BalancePlatform/CardInfo.php index fbb7e9f66..b881f5538 100644 --- a/src/Adyen/Model/BalancePlatform/CardInfo.php +++ b/src/Adyen/Model/BalancePlatform/CardInfo.php @@ -80,12 +80,12 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'delivery_contact' => false, - 'form_factor' => false + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'delivery_contact' => false, + 'form_factor' => false ]; /** @@ -620,7 +620,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ContactDetails.php b/src/Adyen/Model/BalancePlatform/ContactDetails.php index ce4cb4855..aca2ef30a 100644 --- a/src/Adyen/Model/BalancePlatform/ContactDetails.php +++ b/src/Adyen/Model/BalancePlatform/ContactDetails.php @@ -74,9 +74,9 @@ class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'phone' => false, - 'web_address' => false + 'email' => false, + 'phone' => false, + 'web_address' => false ]; /** @@ -480,7 +480,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php index 49e127b4c..b89a73de4 100644 --- a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php @@ -70,7 +70,7 @@ class CountriesRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php index 0b2ab8a56..041e73359 100644 --- a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php @@ -70,7 +70,7 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -445,7 +445,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php index 13e248b8e..3b398fe34 100644 --- a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php @@ -70,7 +70,7 @@ class DayOfWeekRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -439,7 +439,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php index d1b5f5ec8..b4cb4408b 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryContact.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -78,11 +78,11 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'full_phone_number' => false, - 'name' => false, - 'phone_number' => false, - 'web_address' => false + 'email' => false, + 'full_phone_number' => false, + 'name' => false, + 'phone_number' => false, + 'web_address' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php index d99db659e..c39ce4d26 100644 --- a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php @@ -70,7 +70,7 @@ class DifferentCurrenciesRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Duration.php b/src/Adyen/Model/BalancePlatform/Duration.php index 9f5ffa4db..1e48335fc 100644 --- a/src/Adyen/Model/BalancePlatform/Duration.php +++ b/src/Adyen/Model/BalancePlatform/Duration.php @@ -70,7 +70,7 @@ class Duration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'unit' => false, - 'value' => true + 'value' => true ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php index 4a062c74d..0dba149d2 100644 --- a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php @@ -70,7 +70,7 @@ class EntryModesRestriction implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -443,7 +443,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Expiry.php b/src/Adyen/Model/BalancePlatform/Expiry.php index a713dfba3..010325c11 100644 --- a/src/Adyen/Model/BalancePlatform/Expiry.php +++ b/src/Adyen/Model/BalancePlatform/Expiry.php @@ -70,7 +70,7 @@ class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'month' => false, - 'year' => false + 'year' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php index 8ef664195..6df91ad46 100644 --- a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php @@ -70,7 +70,7 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php index efd00176f..74dfea5fd 100644 --- a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -70,7 +70,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php index 9b73c033d..1c7857b81 100644 --- a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php +++ b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php @@ -70,7 +70,7 @@ class InternationalTransactionRestriction implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InvalidField.php b/src/Adyen/Model/BalancePlatform/InvalidField.php index 79fd00ec0..63539a42c 100644 --- a/src/Adyen/Model/BalancePlatform/InvalidField.php +++ b/src/Adyen/Model/BalancePlatform/InvalidField.php @@ -72,8 +72,8 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'message' => false, - 'name' => false, - 'value' => false + 'name' => false, + 'value' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONObject.php b/src/Adyen/Model/BalancePlatform/JSONObject.php index e78daea48..90e72f965 100644 --- a/src/Adyen/Model/BalancePlatform/JSONObject.php +++ b/src/Adyen/Model/BalancePlatform/JSONObject.php @@ -70,7 +70,7 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'paths' => false, - 'root_path' => false + 'root_path' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONPath.php b/src/Adyen/Model/BalancePlatform/JSONPath.php index f577e9910..7b8ade787 100644 --- a/src/Adyen/Model/BalancePlatform/JSONPath.php +++ b/src/Adyen/Model/BalancePlatform/JSONPath.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php index 288965ca1..dd4e16b74 100644 --- a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php @@ -70,7 +70,7 @@ class MatchingTransactionsRestriction implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MccsRestriction.php b/src/Adyen/Model/BalancePlatform/MccsRestriction.php index c37bd3438..d4b8fcce5 100644 --- a/src/Adyen/Model/BalancePlatform/MccsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MccsRestriction.php @@ -70,7 +70,7 @@ class MccsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php index 02704cadf..43e34628f 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php +++ b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php @@ -70,7 +70,7 @@ class MerchantAcquirerPair implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'acquirer_id' => false, - 'merchant_id' => false + 'merchant_id' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php index 3cbf61ec0..fc9c8aacf 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php @@ -70,7 +70,7 @@ class MerchantNamesRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php index 071a8eb6f..f4a93f892 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php @@ -70,7 +70,7 @@ class MerchantsRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php index 57db6da40..6627a5429 100644 --- a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php @@ -70,7 +70,7 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Name.php b/src/Adyen/Model/BalancePlatform/Name.php index bab3c4994..d8b5dcb22 100644 --- a/src/Adyen/Model/BalancePlatform/Name.php +++ b/src/Adyen/Model/BalancePlatform/Name.php @@ -70,7 +70,7 @@ class Name implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'first_name' => false, - 'last_name' => false + 'last_name' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php index 0c35925fd..36c5319f8 100644 --- a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php @@ -74,9 +74,9 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'account_number' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'type' => false + 'additional_bank_identification' => false, + 'bic' => false, + 'type' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index c50681a56..52fd467a0 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -84,7 +84,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -120,7 +120,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -243,9 +245,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); diff --git a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php index f461856c9..c975a81ae 100644 --- a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php @@ -70,7 +70,7 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php index db123042f..6497854c7 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php @@ -72,8 +72,8 @@ class PaginatedAccountHoldersResponse implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'account_holders' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php index d6e4f5f24..89b95a24c 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php @@ -72,8 +72,8 @@ class PaginatedBalanceAccountsResponse implements ModelInterface, ArrayAccess, \ */ protected static $openAPINullables = [ 'balance_accounts' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php index 53fa5c833..6c98b3f16 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php @@ -72,8 +72,8 @@ class PaginatedPaymentInstrumentsResponse implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'payment_instruments' => false + 'has_previous' => false, + 'payment_instruments' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index 6e300bb5b..2ea57ca8d 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -88,16 +88,16 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -836,7 +836,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php index 3a941f5dd..3a6aa97f5 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php @@ -77,10 +77,10 @@ class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false, - 'account_number' => false, - 'account_type' => false, - 'routing_number' => false + 'type' => false, + 'account_number' => false, + 'account_type' => false, + 'routing_number' => false ]; /** @@ -519,7 +519,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php index a19088ee9..7b5e0f815 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php @@ -78,11 +78,11 @@ class PaymentInstrumentGroup implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'id' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'id' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php index 39e4fd53b..ff6c2c140 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php @@ -76,10 +76,10 @@ class PaymentInstrumentGroupInfo implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php index 558664dd3..7463a423f 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -84,14 +84,14 @@ class PaymentInstrumentInfo implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'description' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'card' => false, + 'description' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -765,7 +765,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php index 9c83b8108..2a5d0dd25 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php @@ -72,8 +72,8 @@ class PaymentInstrumentRevealInfo implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'cvc' => false, - 'expiration' => false, - 'pan' => false + 'expiration' => false, + 'pan' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php index 70861a974..bba8047ef 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php @@ -76,10 +76,10 @@ class PaymentInstrumentUpdateRequest implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false + 'card' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false ]; /** @@ -587,7 +587,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Phone.php b/src/Adyen/Model/BalancePlatform/Phone.php index 1677aa9b2..97fd7691f 100644 --- a/src/Adyen/Model/BalancePlatform/Phone.php +++ b/src/Adyen/Model/BalancePlatform/Phone.php @@ -70,7 +70,7 @@ class Phone implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'number' => false, - 'type' => false + 'type' => false ]; /** @@ -442,7 +442,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PhoneNumber.php b/src/Adyen/Model/BalancePlatform/PhoneNumber.php index 49ee0c287..d59dcabbe 100644 --- a/src/Adyen/Model/BalancePlatform/PhoneNumber.php +++ b/src/Adyen/Model/BalancePlatform/PhoneNumber.php @@ -72,8 +72,8 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'phone_country_code' => false, - 'phone_number' => false, - 'phone_type' => false + 'phone_number' => false, + 'phone_type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php index 22aec905d..a34e33a75 100644 --- a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php @@ -70,7 +70,7 @@ class ProcessingTypesRestriction implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -441,7 +441,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/RestServiceError.php b/src/Adyen/Model/BalancePlatform/RestServiceError.php index 3de3284ba..b74ba67fc 100644 --- a/src/Adyen/Model/BalancePlatform/RestServiceError.php +++ b/src/Adyen/Model/BalancePlatform/RestServiceError.php @@ -84,14 +84,14 @@ class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'detail' => false, - 'error_code' => false, - 'instance' => false, - 'invalid_fields' => false, - 'request_id' => false, - 'response' => false, - 'status' => true, - 'title' => false, - 'type' => false + 'error_code' => false, + 'instance' => false, + 'invalid_fields' => false, + 'request_id' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false ]; /** @@ -654,7 +654,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php index 30f219400..d8ddb1b0f 100644 --- a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php @@ -72,8 +72,8 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'clearing_number' => false, - 'type' => false + 'clearing_number' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php index 8322532bd..064dddc73 100644 --- a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php @@ -72,8 +72,8 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bic' => false, - 'type' => false + 'bic' => false, + 'type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/StringMatch.php b/src/Adyen/Model/BalancePlatform/StringMatch.php index 5e93be9ae..f66cb0a6b 100644 --- a/src/Adyen/Model/BalancePlatform/StringMatch.php +++ b/src/Adyen/Model/BalancePlatform/StringMatch.php @@ -70,7 +70,7 @@ class StringMatch implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index f89d8b96e..2860aee88 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -92,18 +92,18 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'category' => false, - 'counterparty' => false, - 'currency' => false, - 'description' => false, - 'id' => false, - 'priorities' => false, - 'reason' => false, - 'schedule' => false, - 'status' => false, - 'sweep_amount' => false, - 'target_amount' => false, - 'trigger_amount' => false, - 'type' => false + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweep_amount' => false, + 'target_amount' => false, + 'trigger_amount' => false, + 'type' => false ]; /** @@ -978,7 +978,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php index c07e6bb44..c5d5eb540 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php @@ -71,7 +71,7 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -407,7 +407,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php index b465f0ba0..ad023501f 100644 --- a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -72,8 +72,8 @@ class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'merchant_account' => false, - 'transfer_instrument_id' => false + 'merchant_account' => false, + 'transfer_instrument_id' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php index 0df075c54..defab0d3e 100644 --- a/src/Adyen/Model/BalancePlatform/SweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -408,7 +408,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDay.php b/src/Adyen/Model/BalancePlatform/TimeOfDay.php index 1d8549b72..2e6c0a36f 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDay.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDay.php @@ -70,7 +70,7 @@ class TimeOfDay implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'end_time' => false, - 'start_time' => false + 'start_time' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php index 4ac8fed5e..574fdb717 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php @@ -70,7 +70,7 @@ class TimeOfDayRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php index e579b2d2a..b2d7aee4f 100644 --- a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php @@ -70,7 +70,7 @@ class TotalAmountRestriction implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index d9a58ef5b..87b4b0631 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -94,19 +94,19 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'id' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'id' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -965,7 +965,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php index 70421f031..430fbc0f2 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php @@ -70,7 +70,7 @@ class TransactionRuleEntityKey implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'entity_reference' => false, - 'entity_type' => false + 'entity_type' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 17c32c708..154e09a23 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -92,18 +92,18 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -931,7 +931,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php index 24e81f3c5..d43f7cd2e 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php @@ -78,11 +78,11 @@ class TransactionRuleInterval implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'day_of_month' => true, - 'day_of_week' => false, - 'duration' => false, - 'time_of_day' => false, - 'time_zone' => false, - 'type' => false + 'day_of_week' => false, + 'duration' => false, + 'time_of_day' => false, + 'time_zone' => false, + 'type' => false ]; /** @@ -626,7 +626,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php index 3d761e342..d55dfd575 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php index bee041525..0e7b2b440 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -94,19 +94,19 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'active_network_tokens' => false, - 'brand_variants' => false, - 'countries' => false, - 'day_of_week' => false, - 'different_currencies' => false, - 'entry_modes' => false, - 'international_transaction' => false, - 'matching_transactions' => false, - 'mccs' => false, - 'merchant_names' => false, - 'merchants' => false, - 'processing_types' => false, - 'time_of_day' => false, - 'total_amount' => false + 'brand_variants' => false, + 'countries' => false, + 'day_of_week' => false, + 'different_currencies' => false, + 'entry_modes' => false, + 'international_transaction' => false, + 'matching_transactions' => false, + 'mccs' => false, + 'merchant_names' => false, + 'merchants' => false, + 'processing_types' => false, + 'time_of_day' => false, + 'total_amount' => false ]; /** @@ -811,7 +811,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php index 56ad310c9..384a8d754 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php index d27f1bb31..34158d198 100644 --- a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php @@ -72,8 +72,8 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'sort_code' => false, - 'type' => false + 'sort_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php index 25f4f8e9d..19a5b9daf 100644 --- a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php @@ -74,9 +74,9 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'routing_number' => false, - 'type' => false + 'account_type' => false, + 'routing_number' => false, + 'type' => false ]; /** @@ -544,7 +544,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index d66b4e70d..77ca4531d 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -90,17 +90,17 @@ class UpdatePaymentInstrument implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -870,7 +870,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php index 0b3449107..e014944f5 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -70,7 +70,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'capabilities' => false, - 'expires_at' => false + 'expires_at' => false ]; /** @@ -528,7 +528,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 4268d536a..17d65f0a4 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -48,14 +48,13 @@ public function __construct(Client $client) * @param string $balanceAccountId * @param string $sweepId * @param array $requestOptions - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index afcf3f087..a1c1b2d7a 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -47,13 +47,15 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array $requestOptions - * @return object + * @return void * @throws AdyenException */ - public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, array $requestOptions = null): object - { + public function validateBankAccountIdentification( + \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest + $bankAccountIdentificationValidationRequest, + array $requestOptions = null + ): void { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, object::class); + $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); } } diff --git a/tests/Resources/BalancePlatform/get-all-account-holders.json b/tests/Resources/BalancePlatform/get-all-account-holders.json new file mode 100644 index 000000000..be1201a7c --- /dev/null +++ b/tests/Resources/BalancePlatform/get-all-account-holders.json @@ -0,0 +1,27 @@ +{ + "accountHolders": [ + { + "description": "Test-305", + "legalEntityId": "LE3227C223222D5D8S5S33M4M", + "reference": "LegalEntity internal error test", + "id": "AH32272223222B5GFSNSXFFL9", + "status": "active" + }, + { + "description": "Test-751", + "legalEntityId": "LE3227C223222D5D8S5TT3SRX", + "reference": "LegalEntity internal error test", + "id": "AH32272223222B5GFSNVGFFM7", + "status": "active" + }, + { + "description": "Explorer Holder", + "legalEntityId": "LE3227C223222D5D8S5TT3SRX", + "reference": "Account from the Explorer Holder", + "id": "AH32272223222B5GFWNRFFVR6", + "status": "active" + } + ], + "hasNext": true, + "hasPrevious": true +} \ No newline at end of file diff --git a/tests/Resources/BalancePlatform/payment-instruments-groups.json b/tests/Resources/BalancePlatform/payment-instruments-groups.json new file mode 100644 index 000000000..3c6f699ff --- /dev/null +++ b/tests/Resources/BalancePlatform/payment-instruments-groups.json @@ -0,0 +1,12 @@ +{ + "balancePlatform": "balancePlatform", + "description": "string", + "id": "LE3227C223222D5D8S5S33M4M", + "properties": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "reference": "string", + "txVariant": "string" +} \ No newline at end of file diff --git a/tests/Resources/BalancePlatform/update-accountholder.json b/tests/Resources/BalancePlatform/update-accountholder.json new file mode 100644 index 000000000..af4671a32 --- /dev/null +++ b/tests/Resources/BalancePlatform/update-accountholder.json @@ -0,0 +1,16 @@ +{ + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "description": "Liable account holder used for international payments and payouts", + "legalEntityId": "LE322JV223222F5GKQZZ9DS99", + "reference": "S.Eller-001", + "capabilities": { + "receivePayments": { + "enabled": false, + "requested": true, + "allowed": false, + "verificationStatus": "pending" + } + }, + "id": "AH3227C223222C5GKR23686TF", + "status": "active" +} \ No newline at end of file diff --git a/tests/Unit/BalancePlatformTest.php b/tests/Unit/BalancePlatformTest.php new file mode 100644 index 000000000..d101c4f22 --- /dev/null +++ b/tests/Unit/BalancePlatformTest.php @@ -0,0 +1,105 @@ +createMockClient('tests/Resources/BalancePlatform/get-all-account-holders.json', 200); + $service = new PlatformApi($client); + $response = $service->getAllAccountHoldersUnderBalancePlatform("id", array(''=> 100)); + $accountHolder = $response->getAccountHolders()[0]; + self::assertEquals('LE3227C223222D5D8S5S33M4M', $accountHolder->getLegalEntityId()); + self::assertEquals(AccountHolder::STATUS_ACTIVE, $accountHolder->getStatus()); + } + + /** + * @throws AdyenException + */ + public function testPaymentInstrumentGroups() + { + // create Checkout client + $client = $this->createMockClient('tests/Resources/BalancePlatform/payment-instruments-groups.json', 200); + $service = new PaymentInstrumentGroupsApi($client); + $response = $service->createPaymentInstrumentGroup(new PaymentInstrumentGroupInfo()); + self::assertEquals('LE3227C223222D5D8S5S33M4M', $response->getId()); + self::assertEquals('balancePlatform', $response->getBalancePlatform()); + } + + /** + * @throws AdyenException + */ + public function testUpdateAccountHolder() + { + // create Checkout client + $client = $this->createMockClient('tests/Resources/BalancePlatform/update-accountholder.json', 200); + $service = new AccountHoldersApi($client); + $response = $service->updateAccountHolder("id", new AccountHolder()); + self::assertEquals('AH3227C223222C5GKR23686TF', $response->getId()); + self::assertEquals('LE322JV223222F5GKQZZ9DS99', $response->getLegalEntityId()); + self::assertEquals(AccountHolder::STATUS_ACTIVE, $response->getStatus()); + } + + /** + * @throws AdyenException + */ + public function testValidateBankAccount() + { + // create Checkout client + $client = $this->createMockClient('tests/Resources/BalancePlatform/update-accountholder.json', 200); + $service = new BankAccountValidationApi($client); + $service->validateBankAccountIdentification(new BankAccountIdentificationValidationRequest()); + $this->assertTrue(true); + } + + /** + * @throws AdyenException + */ + public function testDeleteSweep() + { + // create Checkout client + $client = $this->createMockClient('tests/Resources/BalancePlatform/update-accountholder.json', 200); + $service = new BalanceAccountsApi($client); + $service->deleteSweep("balanceAccountId", "sweepId"); + $this->assertTrue(true); + } + + public function testGetSweepUrlCheckTest() + { + $client = new Client(); + $client->setEnvironment(Environment::TEST); + $urlclient = new UrlCheckClient(); + $client->setHttpClient($urlclient); + $service = new BalanceAccountsApi($client); + $service->getSweep('balanceAccountId', 'sweepId'); + self::assertEquals('https://balanceplatform-api-test.adyen.com/bcl/v2/balanceAccounts/balanceAccountId/sweeps/sweepId', $urlclient->url); + } + + public function testGetSweepUrlCheckLive() + { + $client = new Client(); + $client->setEnvironment(Environment::LIVE); + $urlclient = new UrlCheckClient(); + $client->setHttpClient($urlclient); + $service = new BalanceAccountsApi($client); + $service->getSweep('balanceAccountId', 'sweepId'); + self::assertEquals('https://balanceplatform-api-live.adyen.com/bcl/v2/balanceAccounts/balanceAccountId/sweeps/sweepId', $urlclient->url); + } +} diff --git a/tests/Unit/UrlCheckClient.php b/tests/Unit/UrlCheckClient.php new file mode 100644 index 000000000..dbdbd1527 --- /dev/null +++ b/tests/Unit/UrlCheckClient.php @@ -0,0 +1,31 @@ +url = $requestUrl; + return array(); + } +} From e59f2f288b9b37445f43e29a8dc56144be17ddb8 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 31 Mar 2023 13:59:18 +0200 Subject: [PATCH 04/33] Moved query param construct to Service class and create file to test the url --- sonar-project.properties | 2 +- src/Adyen/HttpClient/ClientInterface.php | 2 +- src/Adyen/HttpClient/CurlClient.php | 12 ++++-------- src/Adyen/Service.php | 10 +++++++++- tests/Unit/BalancePlatformTest.php | 19 ++++++++++++++++++- tests/Unit/UrlCheckClient.php | 4 +++- 6 files changed, 36 insertions(+), 13 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 196c0bb2e..fbabdb501 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,4 +3,4 @@ sonar.projectKey=Adyen_adyen-php-api-library sonar.sources=. sonar.php.coverage.reportPaths=build/clover.xml sonar.php.tests.reportPath=build/tests-log.xml -sonar.exclusions=src/Adyen/Model/**, src/Adyen/Service/Checkout/**, src/Adyen/Service/Payments/**, src/Adyen/Service/Management/** \ No newline at end of file +sonar.exclusions=src/Adyen/Model/**, src/Adyen/Service/Checkout/**, src/Adyen/Service/Payments/**, src/Adyen/Service/Management/**, src/Adyen/Service/BalancePlatform/** \ No newline at end of file diff --git a/src/Adyen/HttpClient/ClientInterface.php b/src/Adyen/HttpClient/ClientInterface.php index cb24550e9..cff6ce68e 100644 --- a/src/Adyen/HttpClient/ClientInterface.php +++ b/src/Adyen/HttpClient/ClientInterface.php @@ -46,6 +46,6 @@ public function requestHttpRest( string $requestUrl, $bodyParams, string $method, - $requestOptions = null + string $idempotencyKey = null ); } diff --git a/src/Adyen/HttpClient/CurlClient.php b/src/Adyen/HttpClient/CurlClient.php index ac5e718a5..294ffcf57 100644 --- a/src/Adyen/HttpClient/CurlClient.php +++ b/src/Adyen/HttpClient/CurlClient.php @@ -464,7 +464,7 @@ public function requestHttpRest( string $requestUrl, $bodyParams, string $method, - $requestOptions = null + string $idempotencyKey = null ): array { $client = $service->getClient(); $config = $client->getConfig(); @@ -481,11 +481,7 @@ public function requestHttpRest( $this->logRequest($logger, $requestUrl, $environment, $bodyParams); //Check if there are url query params to construct the url - $queryParams = $requestOptions; - unset($queryParams['idempotencyKey']); - if (!empty($queryParams)) { - $requestUrl .= '?' . http_build_query($queryParams); - } + //Initiate cURL. $ch = curl_init($requestUrl); @@ -518,8 +514,8 @@ public function requestHttpRest( ); // if idempotency key is provided as option include into request - if (!empty($requestOptions['idempotencyKey'])) { - $headers[] = 'Idempotency-Key: ' . $requestOptions['idempotencyKey']; + if (!$idempotencyKey) { + $headers[] = 'Idempotency-Key: ' . $idempotencyKey; } // set authorisation credentials according to support & availability diff --git a/src/Adyen/Service.php b/src/Adyen/Service.php index 2418f26fb..f2cc000d1 100644 --- a/src/Adyen/Service.php +++ b/src/Adyen/Service.php @@ -67,7 +67,15 @@ protected function requestHttp( throw new AdyenException($msg); } $curlClient = $this->getClient()->getHttpClient(); - return $curlClient->requestHttpRest($this, $url, $bodyParams, $method, $requestOptions); + + // Create query params and retrieve idempotency + $idempotencyKey = $requestOptions['idempotencyKey'] ?? null; + unset($requestOptions['idempotencyKey']); + if (!empty($requestOptions)) { + $url .= '?' . http_build_query($requestOptions); + } + + return $curlClient->requestHttpRest($this, $url, $bodyParams, $method, $idempotencyKey); } /** diff --git a/tests/Unit/BalancePlatformTest.php b/tests/Unit/BalancePlatformTest.php index d101c4f22..9d2838421 100644 --- a/tests/Unit/BalancePlatformTest.php +++ b/tests/Unit/BalancePlatformTest.php @@ -13,6 +13,8 @@ use Adyen\Service\BalancePlatform\BankAccountValidationApi; use Adyen\Service\BalancePlatform\PaymentInstrumentGroupsApi; use Adyen\Service\BalancePlatform\PlatformApi; +use PharIo\Manifest\Url; +use function PHPUnit\Framework\assertEquals; class BalancePlatformTest extends TestCaseMock { @@ -24,12 +26,27 @@ public function testgetAllAccountHolders() // create Checkout client $client = $this->createMockClient('tests/Resources/BalancePlatform/get-all-account-holders.json', 200); $service = new PlatformApi($client); - $response = $service->getAllAccountHoldersUnderBalancePlatform("id", array(''=> 100)); + $response = $service->getAllAccountHoldersUnderBalancePlatform("id", array('offset'=> 1, 'limit'=>10)); $accountHolder = $response->getAccountHolders()[0]; self::assertEquals('LE3227C223222D5D8S5S33M4M', $accountHolder->getLegalEntityId()); self::assertEquals(AccountHolder::STATUS_ACTIVE, $accountHolder->getStatus()); } + /** + * @throws AdyenException + */ + public function testgetAllAccountHoldersUrlCheck() + { + // create Checkout client + $urlClient = new UrlCheckClient(); + $client = $this->createMockClient('tests/Resources/BalancePlatform/get-all-account-holders.json', 200); + $client->setHttpClient($urlClient); + $service = new PlatformApi($client); + $service->getAllAccountHoldersUnderBalancePlatform("id", array('offset'=> 1, 'limit'=>10, 'idempotencyKey'=> '0192837450917834')); + $this->assertEquals('https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/id/accountHolders?offset=1&limit=10', $urlClient->url); + $this->assertEquals('0192837450917834', $urlClient->idempotencyKey); + } + /** * @throws AdyenException */ diff --git a/tests/Unit/UrlCheckClient.php b/tests/Unit/UrlCheckClient.php index dbdbd1527..783b3ed76 100644 --- a/tests/Unit/UrlCheckClient.php +++ b/tests/Unit/UrlCheckClient.php @@ -7,6 +7,7 @@ class UrlCheckClient implements ClientInterface { public $url; + public $idempotencyKey; public function requestJson(\Adyen\Service $service, $requestUrl, $params) { @@ -23,9 +24,10 @@ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $meth // TODO: Implement requestHttp() method. } - public function requestHttpRest(\Adyen\Service $service, string $requestUrl, $bodyParams, string $method, $requestOptions = null) + public function requestHttpRest(\Adyen\Service $service, string $requestUrl, $bodyParams, string $method, $idempotencyKey = null) { $this->url = $requestUrl; + $this->idempotencyKey = $idempotencyKey; return array(); } } From 463a1add4a2415d84295127fa8089c247029f835 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 3 Apr 2023 09:30:16 +0200 Subject: [PATCH 05/33] write better mock client for url checker --- tests/Unit/BalancePlatformTest.php | 72 +++++++++++++++++++++--------- tests/Unit/TestCaseMock.php | 34 ++++++++++++++ tests/Unit/UrlCheckClient.php | 33 -------------- 3 files changed, 85 insertions(+), 54 deletions(-) delete mode 100644 tests/Unit/UrlCheckClient.php diff --git a/tests/Unit/BalancePlatformTest.php b/tests/Unit/BalancePlatformTest.php index 9d2838421..a77ab0525 100644 --- a/tests/Unit/BalancePlatformTest.php +++ b/tests/Unit/BalancePlatformTest.php @@ -13,6 +13,7 @@ use Adyen\Service\BalancePlatform\BankAccountValidationApi; use Adyen\Service\BalancePlatform\PaymentInstrumentGroupsApi; use Adyen\Service\BalancePlatform\PlatformApi; +use http\Env; use PharIo\Manifest\Url; use function PHPUnit\Framework\assertEquals; @@ -24,7 +25,10 @@ class BalancePlatformTest extends TestCaseMock public function testgetAllAccountHolders() { // create Checkout client - $client = $this->createMockClient('tests/Resources/BalancePlatform/get-all-account-holders.json', 200); + $client = $this->createMockClient( + 'tests/Resources/BalancePlatform/get-all-account-holders.json', + 200 + ); $service = new PlatformApi($client); $response = $service->getAllAccountHoldersUnderBalancePlatform("id", array('offset'=> 1, 'limit'=>10)); $accountHolder = $response->getAccountHolders()[0]; @@ -38,13 +42,20 @@ public function testgetAllAccountHolders() public function testgetAllAccountHoldersUrlCheck() { // create Checkout client - $urlClient = new UrlCheckClient(); - $client = $this->createMockClient('tests/Resources/BalancePlatform/get-all-account-holders.json', 200); - $client->setHttpClient($urlClient); + $client = $this->createMockClientUrl( + 'tests/Resources/BalancePlatform/get-all-account-holders.json', + 200 + ); $service = new PlatformApi($client); - $service->getAllAccountHoldersUnderBalancePlatform("id", array('offset'=> 1, 'limit'=>10, 'idempotencyKey'=> '0192837450917834')); - $this->assertEquals('https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/id/accountHolders?offset=1&limit=10', $urlClient->url); - $this->assertEquals('0192837450917834', $urlClient->idempotencyKey); + $response = $service->getAllAccountHoldersUnderBalancePlatform( + "id", + array('offset'=> 1, 'limit'=>10, 'idempotencyKey'=> '0192837450917834') + ); + $this->assertEquals( + 'https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/id/accountHolders?offset=1&limit=10', + $this->requestUrl + ); + $this->assertEquals('Test-751', $response->getAccountHolders()[1]->getDescription()); } /** @@ -53,7 +64,10 @@ public function testgetAllAccountHoldersUrlCheck() public function testPaymentInstrumentGroups() { // create Checkout client - $client = $this->createMockClient('tests/Resources/BalancePlatform/payment-instruments-groups.json', 200); + $client = $this->createMockClient( + 'tests/Resources/BalancePlatform/payment-instruments-groups.json', + 200 + ); $service = new PaymentInstrumentGroupsApi($client); $response = $service->createPaymentInstrumentGroup(new PaymentInstrumentGroupInfo()); self::assertEquals('LE3227C223222D5D8S5S33M4M', $response->getId()); @@ -66,7 +80,10 @@ public function testPaymentInstrumentGroups() public function testUpdateAccountHolder() { // create Checkout client - $client = $this->createMockClient('tests/Resources/BalancePlatform/update-accountholder.json', 200); + $client = $this->createMockClient( + 'tests/Resources/BalancePlatform/update-accountholder.json', + 200 + ); $service = new AccountHoldersApi($client); $response = $service->updateAccountHolder("id", new AccountHolder()); self::assertEquals('AH3227C223222C5GKR23686TF', $response->getId()); @@ -80,7 +97,10 @@ public function testUpdateAccountHolder() public function testValidateBankAccount() { // create Checkout client - $client = $this->createMockClient('tests/Resources/BalancePlatform/update-accountholder.json', 200); + $client = $this->createMockClient( + 'tests/Resources/BalancePlatform/update-accountholder.json', + 200 + ); $service = new BankAccountValidationApi($client); $service->validateBankAccountIdentification(new BankAccountIdentificationValidationRequest()); $this->assertTrue(true); @@ -92,7 +112,10 @@ public function testValidateBankAccount() public function testDeleteSweep() { // create Checkout client - $client = $this->createMockClient('tests/Resources/BalancePlatform/update-accountholder.json', 200); + $client = $this->createMockClient( + 'tests/Resources/BalancePlatform/update-accountholder.json', + 200 + ); $service = new BalanceAccountsApi($client); $service->deleteSweep("balanceAccountId", "sweepId"); $this->assertTrue(true); @@ -100,23 +123,30 @@ public function testDeleteSweep() public function testGetSweepUrlCheckTest() { - $client = new Client(); - $client->setEnvironment(Environment::TEST); - $urlclient = new UrlCheckClient(); - $client->setHttpClient($urlclient); + $client = $this->createMockClientUrl( + 'tests/Resources/BalancePlatform/update-accountholder.json', + 200 + ); $service = new BalanceAccountsApi($client); $service->getSweep('balanceAccountId', 'sweepId'); - self::assertEquals('https://balanceplatform-api-test.adyen.com/bcl/v2/balanceAccounts/balanceAccountId/sweeps/sweepId', $urlclient->url); + self::assertEquals( + 'https://balanceplatform-api-test.adyen.com/bcl/v2/balanceAccounts/balanceAccountId/sweeps/sweepId', + $this->requestUrl + ); } public function testGetSweepUrlCheckLive() { - $client = new Client(); - $client->setEnvironment(Environment::LIVE); - $urlclient = new UrlCheckClient(); - $client->setHttpClient($urlclient); + $client = $this->createMockClientUrl( + 'tests/Resources/BalancePlatform/update-accountholder.json', + 200, + Environment::LIVE + ); $service = new BalanceAccountsApi($client); $service->getSweep('balanceAccountId', 'sweepId'); - self::assertEquals('https://balanceplatform-api-live.adyen.com/bcl/v2/balanceAccounts/balanceAccountId/sweeps/sweepId', $urlclient->url); + self::assertEquals( + 'https://balanceplatform-api-live.adyen.com/bcl/v2/balanceAccounts/balanceAccountId/sweeps/sweepId', + $this->requestUrl + ); } } diff --git a/tests/Unit/TestCaseMock.php b/tests/Unit/TestCaseMock.php index 5fb95d7e2..26559cdc8 100644 --- a/tests/Unit/TestCaseMock.php +++ b/tests/Unit/TestCaseMock.php @@ -80,4 +80,38 @@ protected function createMockClient($jsonFile, $httpStatus, $errno = null, $envi $client->setHttpClient($curlClient); return $client; } + + protected $requestUrl; + + protected function createMockClientUrl($jsonFile, $httpStatus, $environment = Environment::TEST) + { + $client = new Client(); + $client->setApplicationName("My Test Application"); + $client->setEnvironment($environment); + $client->setXApiKey("MockAPIKey"); + + $json = null; + if ($jsonFile != null) { + $json = file_get_contents($jsonFile, true); + } + + $curlClient = $this->getMockBuilder(get_class(new CurlClient())) + ->onlyMethods(array('requestHttpRest')) + ->getMock(); + $curlClient->method('requestHttpRest') + ->willReturnCallback(function (Service $service, $requestUrl, $params) use ($json) { + + $this->requestUrl = $requestUrl; + + if (!is_null($json)) { + $result = json_decode($json, true); + } else { + $result = null; + } + return $result; + }); + + $client->setHttpClient($curlClient); + return $client; + } } diff --git a/tests/Unit/UrlCheckClient.php b/tests/Unit/UrlCheckClient.php deleted file mode 100644 index 783b3ed76..000000000 --- a/tests/Unit/UrlCheckClient.php +++ /dev/null @@ -1,33 +0,0 @@ -url = $requestUrl; - $this->idempotencyKey = $idempotencyKey; - return array(); - } -} From 2a2b1d4a1e0a041e5d5106f31829c496edb22934 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:14:16 +0200 Subject: [PATCH 06/33] refactored to prevent extending the interface and reusing the requestHttp method --- src/Adyen/HttpClient/ClientInterface.php | 15 --- src/Adyen/HttpClient/CurlClient.php | 118 +----------------- .../AULocalAccountIdentification.php | 6 +- .../Model/BalancePlatform/AccountHolder.php | 22 ++-- .../AccountHolderCapability.php | 20 +-- .../BalancePlatform/AccountHolderInfo.php | 14 +-- .../AccountSupportingEntityCapability.php | 14 +-- .../ActiveNetworkTokensRestriction.php | 4 +- .../AdditionalBankIdentification.php | 4 +- src/Adyen/Model/BalancePlatform/Address.php | 12 +- src/Adyen/Model/BalancePlatform/Address2.php | 14 +-- src/Adyen/Model/BalancePlatform/Amount.php | 4 +- .../Model/BalancePlatform/Authentication.php | 6 +- src/Adyen/Model/BalancePlatform/Balance.php | 8 +- .../Model/BalancePlatform/BalanceAccount.php | 16 +-- .../BalancePlatform/BalanceAccountInfo.php | 10 +- .../BalanceAccountUpdateRequest.php | 12 +- .../Model/BalancePlatform/BalancePlatform.php | 6 +- .../BalanceSweepConfigurationsResponse.php | 6 +- ...AccountIdentificationValidationRequest.php | 2 +- ...ValidationRequestAccountIdentification.php | 26 ++-- .../BrandVariantsRestriction.php | 4 +- .../Model/BalancePlatform/BulkAddress.php | 18 +-- .../CALocalAccountIdentification.php | 10 +- .../CZLocalAccountIdentification.php | 6 +- src/Adyen/Model/BalancePlatform/Card.php | 24 ++-- .../BalancePlatform/CardConfiguration.php | 28 ++--- src/Adyen/Model/BalancePlatform/CardInfo.php | 14 +-- .../Model/BalancePlatform/ContactDetails.php | 8 +- .../BalancePlatform/CountriesRestriction.php | 4 +- .../BalancePlatform/CronSweepSchedule.php | 4 +- .../BalancePlatform/DayOfWeekRestriction.php | 4 +- .../Model/BalancePlatform/DeliveryContact.php | 12 +- .../DifferentCurrenciesRestriction.php | 4 +- src/Adyen/Model/BalancePlatform/Duration.php | 4 +- .../BalancePlatform/EntryModesRestriction.php | 4 +- src/Adyen/Model/BalancePlatform/Expiry.php | 4 +- .../HULocalAccountIdentification.php | 4 +- .../IbanAccountIdentification.php | 4 +- .../InternationalTransactionRestriction.php | 4 +- .../Model/BalancePlatform/InvalidField.php | 6 +- .../Model/BalancePlatform/JSONObject.php | 4 +- src/Adyen/Model/BalancePlatform/JSONPath.php | 2 +- .../MatchingTransactionsRestriction.php | 4 +- .../Model/BalancePlatform/MccsRestriction.php | 4 +- .../BalancePlatform/MerchantAcquirerPair.php | 4 +- .../MerchantNamesRestriction.php | 4 +- .../BalancePlatform/MerchantsRestriction.php | 4 +- .../NOLocalAccountIdentification.php | 4 +- src/Adyen/Model/BalancePlatform/Name.php | 4 +- .../NumberAndBicAccountIdentification.php | 8 +- .../BalancePlatform/ObjectSerializer.php | 11 +- .../PLLocalAccountIdentification.php | 4 +- .../PaginatedAccountHoldersResponse.php | 6 +- .../PaginatedBalanceAccountsResponse.php | 6 +- .../PaginatedPaymentInstrumentsResponse.php | 6 +- .../BalancePlatform/PaymentInstrument.php | 22 ++-- .../PaymentInstrumentBankAccount.php | 10 +- .../PaymentInstrumentGroup.php | 12 +- .../PaymentInstrumentGroupInfo.php | 10 +- .../BalancePlatform/PaymentInstrumentInfo.php | 18 +-- .../PaymentInstrumentRevealInfo.php | 6 +- .../PaymentInstrumentUpdateRequest.php | 10 +- src/Adyen/Model/BalancePlatform/Phone.php | 4 +- .../Model/BalancePlatform/PhoneNumber.php | 6 +- .../ProcessingTypesRestriction.php | 4 +- .../BalancePlatform/RestServiceError.php | 18 +-- .../SELocalAccountIdentification.php | 6 +- .../SGLocalAccountIdentification.php | 6 +- .../Model/BalancePlatform/StringMatch.php | 4 +- .../BalancePlatform/SweepConfigurationV2.php | 26 ++-- .../SweepConfigurationV2Schedule.php | 4 +- .../BalancePlatform/SweepCounterparty.php | 6 +- .../Model/BalancePlatform/SweepSchedule.php | 2 +- src/Adyen/Model/BalancePlatform/TimeOfDay.php | 4 +- .../BalancePlatform/TimeOfDayRestriction.php | 4 +- .../TotalAmountRestriction.php | 4 +- .../Model/BalancePlatform/TransactionRule.php | 28 ++--- .../TransactionRuleEntityKey.php | 4 +- .../BalancePlatform/TransactionRuleInfo.php | 26 ++-- .../TransactionRuleInterval.php | 12 +- .../TransactionRuleResponse.php | 2 +- .../TransactionRuleRestrictions.php | 28 ++--- .../TransactionRulesResponse.php | 2 +- .../UKLocalAccountIdentification.php | 6 +- .../USLocalAccountIdentification.php | 8 +- .../UpdatePaymentInstrument.php | 24 ++-- .../BalancePlatform/VerificationDeadline.php | 4 +- src/Adyen/Service.php | 10 +- src/Adyen/Service/AbstractResource.php | 5 + .../BalancePlatform/AccountHoldersApi.php | 10 +- .../BalancePlatform/BalanceAccountsApi.php | 25 ++-- .../BankAccountValidationApi.php | 11 +- .../PaymentInstrumentGroupsApi.php | 6 +- .../BalancePlatform/PaymentInstrumentsApi.php | 10 +- .../Service/BalancePlatform/PlatformApi.php | 6 +- .../BalancePlatform/TransactionRulesApi.php | 8 +- templates/api.mustache | 9 +- tests/Unit/BalancePlatformTest.php | 13 +- tests/Unit/TestCaseMock.php | 6 +- 100 files changed, 449 insertions(+), 584 deletions(-) diff --git a/src/Adyen/HttpClient/ClientInterface.php b/src/Adyen/HttpClient/ClientInterface.php index cff6ce68e..5e75ce2e3 100644 --- a/src/Adyen/HttpClient/ClientInterface.php +++ b/src/Adyen/HttpClient/ClientInterface.php @@ -33,19 +33,4 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params); * @return mixed */ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $method, $requestOptions = null); - - /** - * @param \Adyen\Service $service - * @param $requestUrl - * @param $bodyParams - * @param $method - * @return mixed - */ - public function requestHttpRest( - \Adyen\Service $service, - string $requestUrl, - $bodyParams, - string $method, - string $idempotencyKey = null - ); } diff --git a/src/Adyen/HttpClient/CurlClient.php b/src/Adyen/HttpClient/CurlClient.php index 294ffcf57..3e01bbfb3 100644 --- a/src/Adyen/HttpClient/CurlClient.php +++ b/src/Adyen/HttpClient/CurlClient.php @@ -365,10 +365,7 @@ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $meth // log the request $this->logRequest($logger, $requestUrl, $environment, $params); - //Check if there are url query params to construct the url - if (in_array($method, [self::HTTP_METHOD_GET, self::HTTP_METHOD_DELETE]) && !empty($params)) { - $requestUrl .= '?' . http_build_query($params); - } + //Initiate cURL. $ch = curl_init($requestUrl); @@ -457,117 +454,4 @@ public function requestHttp(\Adyen\Service $service, $requestUrl, $params, $meth return $result; } - - // This method implements Restfull requests where the query params are stored in requestOptions as an array. - public function requestHttpRest( - \Adyen\Service $service, - string $requestUrl, - $bodyParams, - string $method, - string $idempotencyKey = null - ): array { - $client = $service->getClient(); - $config = $client->getConfig(); - $logger = $client->getLogger(); - $username = $config->getUsername(); - $password = $config->getPassword(); - $xApiKey = $config->getXApiKey(); - $httpProxy = $config->getHttpProxy(); - $environment = $config->getEnvironment(); - - $jsonRequest = json_encode($bodyParams); - - // Log the request - $this->logRequest($logger, $requestUrl, $environment, $bodyParams); - - //Check if there are url query params to construct the url - - //Initiate cURL. - $ch = curl_init($requestUrl); - - if ($method === self::HTTP_METHOD_GET) { - curl_setopt($ch, CURLOPT_HTTPGET, 1); - } elseif ($method === self::HTTP_METHOD_POST) { - //Tell cURL that we want to send a POST request. - curl_setopt($ch, CURLOPT_POST, 1); - //Attach our encoded JSON string to the POST fields. - curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonRequest); - } elseif ($method === self::HTTP_METHOD_PATCH) { - //Tell cURL that we want to send a PATCH request. - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); - //Attach our encoded JSON string to the PATCH fields. - curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonRequest); - } elseif ($method === self::HTTP_METHOD_DELETE) { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); - } - - $this->curlSetHttpProxy($ch, $httpProxy); - - //create a custom User-Agent - $userAgent = $config->get('applicationName') . " " . - \Adyen\Client::USER_AGENT_SUFFIX . $client->getLibraryVersion(); - - //Set the content type to application/json and use the defined userAgent - $headers = array( - self::CONTENT_TYPE, - self::USER_AGENT . $userAgent - ); - - // if idempotency key is provided as option include into request - if (!$idempotencyKey) { - $headers[] = 'Idempotency-Key: ' . $idempotencyKey; - } - - // set authorisation credentials according to support & availability - if (!empty($xApiKey)) { - //Set the content type to application/json and use the defined userAgent along with the x-api-key - $headers[] = 'x-api-key: ' . $xApiKey; - } elseif ($service->requiresApiKey()) { - $msg = "Please provide a valid Checkout API Key"; - throw new AdyenException($msg); - } else { - //Set the basic auth credentials - curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password); - } - - //Set the timeout - if ($config->getTimeout() != null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $config->getTimeout()); - } - - //Set the headers - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - - // return the result - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - - //Execute the request - list($result, $httpStatus) = $this->curlRequest($ch); - - // log the response - $decodedResult = json_decode($result, true); - $this->logResponse($logger, $environment, $decodedResult); - - // Get errors - list($errno, $message) = $this->curlError($ch); - - curl_close($ch); - - $resultOKHttpStatusCodes = array(200, 201, 202, 204); - - if (!in_array($httpStatus, $resultOKHttpStatusCodes) && $result) { - $this->handleResultError($result, $logger); - } elseif (!$result) { - $this->handleCurlError($requestUrl, $errno, $message, $logger); - } - - // result in array or json - if ($config->getOutputType() == 'array') { - // transform to PHP Array - $result = json_decode($result, true); - } - - return $result; - } } diff --git a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php index a777a4d80..24d9ac505 100644 --- a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php @@ -72,8 +72,8 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false + 'bsb_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 14b41d64a..709dee5d1 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -88,16 +88,16 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'id' => false, - 'legal_entity_id' => false, - 'primary_balance_account' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false, - 'verification_deadlines' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'id' => false, + 'legal_entity_id' => false, + 'primary_balance_account' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false, + 'verification_deadlines' => false ]; /** @@ -752,7 +752,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php index e3ae79713..3d71d1a50 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php @@ -86,15 +86,15 @@ class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'allowed_settings' => false, - 'enabled' => false, - 'problems' => false, - 'requested' => false, - 'requested_level' => false, - 'requested_settings' => false, - 'transfer_instruments' => false, - 'verification_status' => false + 'allowed_level' => false, + 'allowed_settings' => false, + 'enabled' => false, + 'problems' => false, + 'requested' => false, + 'requested_level' => false, + 'requested_settings' => false, + 'transfer_instruments' => false, + 'verification_status' => false ]; /** @@ -786,7 +786,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index 7ce6a8547..193594ffa 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -80,12 +80,12 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'legal_entity_id' => false, - 'reference' => false, - 'time_zone' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'legal_entity_id' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php index f9dedc7a8..48d14a6cc 100644 --- a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php @@ -80,12 +80,12 @@ class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'enabled' => false, - 'id' => false, - 'requested' => false, - 'requested_level' => false, - 'verification_status' => false + 'allowed_level' => false, + 'enabled' => false, + 'id' => false, + 'requested' => false, + 'requested_level' => false, + 'verification_status' => false ]; /** @@ -684,7 +684,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php index 53fedef8d..efa8cf26b 100644 --- a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php @@ -70,7 +70,7 @@ class ActiveNetworkTokensRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php index f38ce5c88..7ccc21434 100644 --- a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php @@ -70,7 +70,7 @@ class AdditionalBankIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'code' => false, - 'type' => false + 'type' => false ]; /** @@ -436,7 +436,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address.php b/src/Adyen/Model/BalancePlatform/Address.php index 0e6d16c24..94ec71f14 100644 --- a/src/Adyen/Model/BalancePlatform/Address.php +++ b/src/Adyen/Model/BalancePlatform/Address.php @@ -78,11 +78,11 @@ class Address implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'house_number_or_name' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -554,7 +554,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address2.php b/src/Adyen/Model/BalancePlatform/Address2.php index 122f3756e..7d6648f03 100644 --- a/src/Adyen/Model/BalancePlatform/Address2.php +++ b/src/Adyen/Model/BalancePlatform/Address2.php @@ -80,12 +80,12 @@ class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'line1' => false, - 'line2' => false, - 'line3' => false, - 'postal_code' => false, - 'state_or_province' => false + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php index e0161429c..5bf62d874 100644 --- a/src/Adyen/Model/BalancePlatform/Amount.php +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -70,7 +70,7 @@ class Amount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'currency' => false, - 'value' => false + 'value' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Authentication.php b/src/Adyen/Model/BalancePlatform/Authentication.php index a62b4e681..5c7fdbb4f 100644 --- a/src/Adyen/Model/BalancePlatform/Authentication.php +++ b/src/Adyen/Model/BalancePlatform/Authentication.php @@ -72,8 +72,8 @@ class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'email' => false, - 'password' => false, - 'phone' => false + 'password' => false, + 'phone' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 52852c3fe..8ad88e526 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -74,9 +74,9 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'available' => false, - 'balance' => false, - 'currency' => false, - 'reserved' => false + 'balance' => false, + 'currency' => false, + 'reserved' => false ]; /** @@ -483,7 +483,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php index 80117eb2e..537594491 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccount.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -82,13 +82,13 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'balances' => false, - 'default_currency_code' => false, - 'description' => false, - 'id' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'balances' => false, + 'default_currency_code' => false, + 'description' => false, + 'id' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -650,7 +650,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php index b15f90c8b..5692fa378 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -76,10 +76,10 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -508,7 +508,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index 6f82a2ea3..03c75d32d 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -78,11 +78,11 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatform.php b/src/Adyen/Model/BalancePlatform/BalancePlatform.php index 4dcf14f06..fe53ad778 100644 --- a/src/Adyen/Model/BalancePlatform/BalancePlatform.php +++ b/src/Adyen/Model/BalancePlatform/BalancePlatform.php @@ -72,8 +72,8 @@ class BalancePlatform implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'description' => false, - 'id' => false, - 'status' => false + 'id' => false, + 'status' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php index 2849548bf..ee1614c42 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php +++ b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php @@ -72,8 +72,8 @@ class BalanceSweepConfigurationsResponse implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'sweeps' => false + 'has_previous' => false, + 'sweeps' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php index b545b6948..53542da7c 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php @@ -372,7 +372,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index a866b671c..319aa44b3 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -93,18 +93,18 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'bank_code' => false, - 'iban' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'clearing_number' => false, - 'sort_code' => false, - 'routing_number' => false + 'bsb_code' => false, + 'type' => false, + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'bank_code' => false, + 'iban' => false, + 'additional_bank_identification' => false, + 'bic' => false, + 'clearing_number' => false, + 'sort_code' => false, + 'routing_number' => false ]; /** @@ -812,7 +812,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php index 0ed0914b1..dbc1b317a 100644 --- a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php @@ -70,7 +70,7 @@ class BrandVariantsRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BulkAddress.php b/src/Adyen/Model/BalancePlatform/BulkAddress.php index 8b4f1e145..21cb09b88 100644 --- a/src/Adyen/Model/BalancePlatform/BulkAddress.php +++ b/src/Adyen/Model/BalancePlatform/BulkAddress.php @@ -84,14 +84,14 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'company' => false, - 'country' => false, - 'email' => false, - 'house_number_or_name' => false, - 'mobile' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'company' => false, + 'country' => false, + 'email' => false, + 'house_number_or_name' => false, + 'mobile' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -644,7 +644,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php index 5c2782f99..cabb2a927 100644 --- a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php @@ -76,10 +76,10 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'type' => false + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'type' => false ]; /** @@ -581,7 +581,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php index 7d5d1191e..7796cd397 100644 --- a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php @@ -72,8 +72,8 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bank_code' => false, - 'type' => false + 'bank_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php index e10e5b036..a0f59f249 100644 --- a/src/Adyen/Model/BalancePlatform/Card.php +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -90,17 +90,17 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'bin' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'cvc' => false, - 'delivery_contact' => false, - 'expiration' => false, - 'form_factor' => false, - 'last_four' => false, - 'number' => false + 'bin' => false, + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'cvc' => false, + 'delivery_contact' => false, + 'expiration' => false, + 'form_factor' => false, + 'last_four' => false, + 'number' => false ]; /** @@ -793,7 +793,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php index 0aa41d2fe..407696741 100644 --- a/src/Adyen/Model/BalancePlatform/CardConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -94,19 +94,19 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'activation' => false, - 'activation_url' => false, - 'bulk_address' => false, - 'card_image_id' => false, - 'carrier' => false, - 'carrier_image_id' => false, - 'configuration_profile_id' => false, - 'currency' => false, - 'envelope' => false, - 'insert' => false, - 'language' => false, - 'logo_image_id' => false, - 'pin_mailer' => false, - 'shipment_method' => false + 'activation_url' => false, + 'bulk_address' => false, + 'card_image_id' => false, + 'carrier' => false, + 'carrier_image_id' => false, + 'configuration_profile_id' => false, + 'currency' => false, + 'envelope' => false, + 'insert' => false, + 'language' => false, + 'logo_image_id' => false, + 'pin_mailer' => false, + 'shipment_method' => false ]; /** @@ -814,7 +814,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardInfo.php b/src/Adyen/Model/BalancePlatform/CardInfo.php index b881f5538..fbb7e9f66 100644 --- a/src/Adyen/Model/BalancePlatform/CardInfo.php +++ b/src/Adyen/Model/BalancePlatform/CardInfo.php @@ -80,12 +80,12 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'delivery_contact' => false, - 'form_factor' => false + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'delivery_contact' => false, + 'form_factor' => false ]; /** @@ -620,7 +620,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ContactDetails.php b/src/Adyen/Model/BalancePlatform/ContactDetails.php index aca2ef30a..ce4cb4855 100644 --- a/src/Adyen/Model/BalancePlatform/ContactDetails.php +++ b/src/Adyen/Model/BalancePlatform/ContactDetails.php @@ -74,9 +74,9 @@ class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'phone' => false, - 'web_address' => false + 'email' => false, + 'phone' => false, + 'web_address' => false ]; /** @@ -480,7 +480,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php index b89a73de4..49e127b4c 100644 --- a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php @@ -70,7 +70,7 @@ class CountriesRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php index 041e73359..0b2ab8a56 100644 --- a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php @@ -70,7 +70,7 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -445,7 +445,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php index 3b398fe34..13e248b8e 100644 --- a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php @@ -70,7 +70,7 @@ class DayOfWeekRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -439,7 +439,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php index b4cb4408b..d1b5f5ec8 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryContact.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -78,11 +78,11 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'full_phone_number' => false, - 'name' => false, - 'phone_number' => false, - 'web_address' => false + 'email' => false, + 'full_phone_number' => false, + 'name' => false, + 'phone_number' => false, + 'web_address' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php index c39ce4d26..d99db659e 100644 --- a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php @@ -70,7 +70,7 @@ class DifferentCurrenciesRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Duration.php b/src/Adyen/Model/BalancePlatform/Duration.php index 1e48335fc..9f5ffa4db 100644 --- a/src/Adyen/Model/BalancePlatform/Duration.php +++ b/src/Adyen/Model/BalancePlatform/Duration.php @@ -70,7 +70,7 @@ class Duration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'unit' => false, - 'value' => true + 'value' => true ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php index 0dba149d2..4a062c74d 100644 --- a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php @@ -70,7 +70,7 @@ class EntryModesRestriction implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -443,7 +443,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Expiry.php b/src/Adyen/Model/BalancePlatform/Expiry.php index 010325c11..a713dfba3 100644 --- a/src/Adyen/Model/BalancePlatform/Expiry.php +++ b/src/Adyen/Model/BalancePlatform/Expiry.php @@ -70,7 +70,7 @@ class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'month' => false, - 'year' => false + 'year' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php index 6df91ad46..8ef664195 100644 --- a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php @@ -70,7 +70,7 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php index 74dfea5fd..efd00176f 100644 --- a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -70,7 +70,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php index 1c7857b81..9b73c033d 100644 --- a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php +++ b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php @@ -70,7 +70,7 @@ class InternationalTransactionRestriction implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InvalidField.php b/src/Adyen/Model/BalancePlatform/InvalidField.php index 63539a42c..79fd00ec0 100644 --- a/src/Adyen/Model/BalancePlatform/InvalidField.php +++ b/src/Adyen/Model/BalancePlatform/InvalidField.php @@ -72,8 +72,8 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'message' => false, - 'name' => false, - 'value' => false + 'name' => false, + 'value' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONObject.php b/src/Adyen/Model/BalancePlatform/JSONObject.php index 90e72f965..e78daea48 100644 --- a/src/Adyen/Model/BalancePlatform/JSONObject.php +++ b/src/Adyen/Model/BalancePlatform/JSONObject.php @@ -70,7 +70,7 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'paths' => false, - 'root_path' => false + 'root_path' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONPath.php b/src/Adyen/Model/BalancePlatform/JSONPath.php index 7b8ade787..f577e9910 100644 --- a/src/Adyen/Model/BalancePlatform/JSONPath.php +++ b/src/Adyen/Model/BalancePlatform/JSONPath.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php index dd4e16b74..288965ca1 100644 --- a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php @@ -70,7 +70,7 @@ class MatchingTransactionsRestriction implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MccsRestriction.php b/src/Adyen/Model/BalancePlatform/MccsRestriction.php index d4b8fcce5..c37bd3438 100644 --- a/src/Adyen/Model/BalancePlatform/MccsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MccsRestriction.php @@ -70,7 +70,7 @@ class MccsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php index 43e34628f..02704cadf 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php +++ b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php @@ -70,7 +70,7 @@ class MerchantAcquirerPair implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'acquirer_id' => false, - 'merchant_id' => false + 'merchant_id' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php index fc9c8aacf..3cbf61ec0 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php @@ -70,7 +70,7 @@ class MerchantNamesRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php index f4a93f892..071a8eb6f 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php @@ -70,7 +70,7 @@ class MerchantsRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php index 6627a5429..57db6da40 100644 --- a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php @@ -70,7 +70,7 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Name.php b/src/Adyen/Model/BalancePlatform/Name.php index d8b5dcb22..bab3c4994 100644 --- a/src/Adyen/Model/BalancePlatform/Name.php +++ b/src/Adyen/Model/BalancePlatform/Name.php @@ -70,7 +70,7 @@ class Name implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'first_name' => false, - 'last_name' => false + 'last_name' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php index 36c5319f8..0c35925fd 100644 --- a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php @@ -74,9 +74,9 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'account_number' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'type' => false + 'additional_bank_identification' => false, + 'bic' => false, + 'type' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index 52fd467a0..c50681a56 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -84,7 +84,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -120,9 +120,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -245,8 +243,9 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); diff --git a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php index c975a81ae..f461856c9 100644 --- a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php @@ -70,7 +70,7 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php index 6497854c7..db123042f 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php @@ -72,8 +72,8 @@ class PaginatedAccountHoldersResponse implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'account_holders' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php index 89b95a24c..d6e4f5f24 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php @@ -72,8 +72,8 @@ class PaginatedBalanceAccountsResponse implements ModelInterface, ArrayAccess, \ */ protected static $openAPINullables = [ 'balance_accounts' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php index 6c98b3f16..53fa5c833 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php @@ -72,8 +72,8 @@ class PaginatedPaymentInstrumentsResponse implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'payment_instruments' => false + 'has_previous' => false, + 'payment_instruments' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index 2ea57ca8d..6e300bb5b 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -88,16 +88,16 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -836,7 +836,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php index 3a6aa97f5..3a941f5dd 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php @@ -77,10 +77,10 @@ class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false, - 'account_number' => false, - 'account_type' => false, - 'routing_number' => false + 'type' => false, + 'account_number' => false, + 'account_type' => false, + 'routing_number' => false ]; /** @@ -519,7 +519,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php index 7b5e0f815..a19088ee9 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php @@ -78,11 +78,11 @@ class PaymentInstrumentGroup implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'id' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'id' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php index ff6c2c140..39e4fd53b 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php @@ -76,10 +76,10 @@ class PaymentInstrumentGroupInfo implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php index 7463a423f..558664dd3 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -84,14 +84,14 @@ class PaymentInstrumentInfo implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'description' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'card' => false, + 'description' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -765,7 +765,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php index 2a5d0dd25..9c83b8108 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php @@ -72,8 +72,8 @@ class PaymentInstrumentRevealInfo implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'cvc' => false, - 'expiration' => false, - 'pan' => false + 'expiration' => false, + 'pan' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php index bba8047ef..70861a974 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php @@ -76,10 +76,10 @@ class PaymentInstrumentUpdateRequest implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false + 'card' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false ]; /** @@ -587,7 +587,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Phone.php b/src/Adyen/Model/BalancePlatform/Phone.php index 97fd7691f..1677aa9b2 100644 --- a/src/Adyen/Model/BalancePlatform/Phone.php +++ b/src/Adyen/Model/BalancePlatform/Phone.php @@ -70,7 +70,7 @@ class Phone implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'number' => false, - 'type' => false + 'type' => false ]; /** @@ -442,7 +442,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PhoneNumber.php b/src/Adyen/Model/BalancePlatform/PhoneNumber.php index d59dcabbe..49ee0c287 100644 --- a/src/Adyen/Model/BalancePlatform/PhoneNumber.php +++ b/src/Adyen/Model/BalancePlatform/PhoneNumber.php @@ -72,8 +72,8 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'phone_country_code' => false, - 'phone_number' => false, - 'phone_type' => false + 'phone_number' => false, + 'phone_type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php index a34e33a75..22aec905d 100644 --- a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php @@ -70,7 +70,7 @@ class ProcessingTypesRestriction implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -441,7 +441,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/RestServiceError.php b/src/Adyen/Model/BalancePlatform/RestServiceError.php index b74ba67fc..3de3284ba 100644 --- a/src/Adyen/Model/BalancePlatform/RestServiceError.php +++ b/src/Adyen/Model/BalancePlatform/RestServiceError.php @@ -84,14 +84,14 @@ class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'detail' => false, - 'error_code' => false, - 'instance' => false, - 'invalid_fields' => false, - 'request_id' => false, - 'response' => false, - 'status' => true, - 'title' => false, - 'type' => false + 'error_code' => false, + 'instance' => false, + 'invalid_fields' => false, + 'request_id' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false ]; /** @@ -654,7 +654,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php index d8ddb1b0f..30f219400 100644 --- a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php @@ -72,8 +72,8 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'clearing_number' => false, - 'type' => false + 'clearing_number' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php index 064dddc73..8322532bd 100644 --- a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php @@ -72,8 +72,8 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bic' => false, - 'type' => false + 'bic' => false, + 'type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/StringMatch.php b/src/Adyen/Model/BalancePlatform/StringMatch.php index f66cb0a6b..5e93be9ae 100644 --- a/src/Adyen/Model/BalancePlatform/StringMatch.php +++ b/src/Adyen/Model/BalancePlatform/StringMatch.php @@ -70,7 +70,7 @@ class StringMatch implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index 2860aee88..f89d8b96e 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -92,18 +92,18 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'category' => false, - 'counterparty' => false, - 'currency' => false, - 'description' => false, - 'id' => false, - 'priorities' => false, - 'reason' => false, - 'schedule' => false, - 'status' => false, - 'sweep_amount' => false, - 'target_amount' => false, - 'trigger_amount' => false, - 'type' => false + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweep_amount' => false, + 'target_amount' => false, + 'trigger_amount' => false, + 'type' => false ]; /** @@ -978,7 +978,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php index c5d5eb540..c07e6bb44 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php @@ -71,7 +71,7 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -407,7 +407,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php index ad023501f..b465f0ba0 100644 --- a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -72,8 +72,8 @@ class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'merchant_account' => false, - 'transfer_instrument_id' => false + 'merchant_account' => false, + 'transfer_instrument_id' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php index defab0d3e..0df075c54 100644 --- a/src/Adyen/Model/BalancePlatform/SweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -408,7 +408,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDay.php b/src/Adyen/Model/BalancePlatform/TimeOfDay.php index 2e6c0a36f..1d8549b72 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDay.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDay.php @@ -70,7 +70,7 @@ class TimeOfDay implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'end_time' => false, - 'start_time' => false + 'start_time' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php index 574fdb717..4ac8fed5e 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php @@ -70,7 +70,7 @@ class TimeOfDayRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php index b2d7aee4f..e579b2d2a 100644 --- a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php @@ -70,7 +70,7 @@ class TotalAmountRestriction implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 87b4b0631..d9a58ef5b 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -94,19 +94,19 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'id' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'id' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -965,7 +965,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php index 430fbc0f2..70421f031 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php @@ -70,7 +70,7 @@ class TransactionRuleEntityKey implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'entity_reference' => false, - 'entity_type' => false + 'entity_type' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 154e09a23..17c32c708 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -92,18 +92,18 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -931,7 +931,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php index d43f7cd2e..24e81f3c5 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php @@ -78,11 +78,11 @@ class TransactionRuleInterval implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'day_of_month' => true, - 'day_of_week' => false, - 'duration' => false, - 'time_of_day' => false, - 'time_zone' => false, - 'type' => false + 'day_of_week' => false, + 'duration' => false, + 'time_of_day' => false, + 'time_zone' => false, + 'type' => false ]; /** @@ -626,7 +626,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php index d55dfd575..3d761e342 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php index 0e7b2b440..bee041525 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -94,19 +94,19 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'active_network_tokens' => false, - 'brand_variants' => false, - 'countries' => false, - 'day_of_week' => false, - 'different_currencies' => false, - 'entry_modes' => false, - 'international_transaction' => false, - 'matching_transactions' => false, - 'mccs' => false, - 'merchant_names' => false, - 'merchants' => false, - 'processing_types' => false, - 'time_of_day' => false, - 'total_amount' => false + 'brand_variants' => false, + 'countries' => false, + 'day_of_week' => false, + 'different_currencies' => false, + 'entry_modes' => false, + 'international_transaction' => false, + 'matching_transactions' => false, + 'mccs' => false, + 'merchant_names' => false, + 'merchants' => false, + 'processing_types' => false, + 'time_of_day' => false, + 'total_amount' => false ]; /** @@ -811,7 +811,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php index 384a8d754..56ad310c9 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php index 34158d198..d27f1bb31 100644 --- a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php @@ -72,8 +72,8 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'sort_code' => false, - 'type' => false + 'sort_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php index 19a5b9daf..25f4f8e9d 100644 --- a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php @@ -74,9 +74,9 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'routing_number' => false, - 'type' => false + 'account_type' => false, + 'routing_number' => false, + 'type' => false ]; /** @@ -544,7 +544,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index 77ca4531d..d66b4e70d 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -90,17 +90,17 @@ class UpdatePaymentInstrument implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -870,7 +870,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php index e014944f5..0b3449107 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -70,7 +70,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'capabilities' => false, - 'expires_at' => false + 'expires_at' => false ]; /** @@ -528,7 +528,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Service.php b/src/Adyen/Service.php index f2cc000d1..8dc411ad2 100644 --- a/src/Adyen/Service.php +++ b/src/Adyen/Service.php @@ -68,14 +68,12 @@ protected function requestHttp( } $curlClient = $this->getClient()->getHttpClient(); - // Create query params and retrieve idempotency - $idempotencyKey = $requestOptions['idempotencyKey'] ?? null; - unset($requestOptions['idempotencyKey']); - if (!empty($requestOptions)) { - $url .= '?' . http_build_query($requestOptions); + // Retrieve queryParams from requestOptions and add to URL + if (!empty($requestOptions['queryParams'])) { + $url .= '?' . http_build_query($requestOptions['queryParams']); } - return $curlClient->requestHttpRest($this, $url, $bodyParams, $method, $idempotencyKey); + return $curlClient->requestHttp($this, $url, $bodyParams, $method, $requestOptions); } /** diff --git a/src/Adyen/Service/AbstractResource.php b/src/Adyen/Service/AbstractResource.php index 4218f6a5e..7c7a7e6e7 100644 --- a/src/Adyen/Service/AbstractResource.php +++ b/src/Adyen/Service/AbstractResource.php @@ -267,6 +267,11 @@ public function requestHttp($url, $method = 'get', array $params = null) $this->service->getClient()->getLogger()->error($msg); throw new AdyenException($msg); } + // build query param in url for get/delete + if (in_array($method, ['get', 'delete']) && !empty($params)) { + $url .= '?' . http_build_query($params); + } + $curlClient = $this->service->getClient()->getHttpClient(); return $curlClient->requestHttp($this->service, $url, $params, $method); } diff --git a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php index 3bed473cc..d604f4e31 100644 --- a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php +++ b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get an account holder * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ @@ -61,9 +61,7 @@ public function getAccountHolder(string $id, array $requestOptions = null): \Ady * Get all balance accounts of an account holder * * @param string $id - * @param int $offset - * @param int $limit - * @param array $requestOptions + * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaginatedBalanceAccountsResponse * @throws AdyenException */ @@ -79,7 +77,7 @@ public function getAllBalanceAccountsOfAccountHolder(string $id, array $requestO * * @param string $id * @param \Adyen\Model\BalancePlatform\AccountHolder $accountHolder - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ @@ -94,7 +92,7 @@ public function updateAccountHolder(string $id, \Adyen\Model\BalancePlatform\Acc * Create an account holder * * @param \Adyen\Model\BalancePlatform\AccountHolderInfo $accountHolderInfo - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 17d65f0a4..5cefd6d37 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -47,23 +47,22 @@ public function __construct(Client $client) * * @param string $balanceAccountId * @param string $sweepId - * @param array $requestOptions - + * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** * Get all sweeps for a balance account * * @param string $balanceAccountId - * @param int $offset - * @param int $limit - * @param array $requestOptions + * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse * @throws AdyenException */ @@ -79,7 +78,7 @@ public function getAllSweepsForBalanceAccount(string $balanceAccountId, array $r * * @param string $balanceAccountId * @param string $sweepId - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ @@ -94,7 +93,7 @@ public function getSweep(string $balanceAccountId, string $sweepId, array $reque * Get a balance account * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -109,9 +108,7 @@ public function getBalanceAccount(string $id, array $requestOptions = null): \Ad * Get all payment instruments for a balance account * * @param string $id - * @param int $offset - * @param int $limit - * @param array $requestOptions + * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaginatedPaymentInstrumentsResponse * @throws AdyenException */ @@ -128,7 +125,7 @@ public function getAllPaymentInstrumentsForBalanceAccount(string $id, array $req * @param string $balanceAccountId * @param string $sweepId * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ @@ -144,7 +141,7 @@ public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Mo * * @param string $id * @param \Adyen\Model\BalancePlatform\BalanceAccountUpdateRequest $balanceAccountUpdateRequest - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -159,7 +156,7 @@ public function updateBalanceAccount(string $id, \Adyen\Model\BalancePlatform\Ba * Create a balance account * * @param \Adyen\Model\BalancePlatform\BalanceAccountInfo $balanceAccountInfo - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -175,7 +172,7 @@ public function createBalanceAccount(\Adyen\Model\BalancePlatform\BalanceAccount * * @param string $balanceAccountId * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index a1c1b2d7a..6917e1397 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -46,15 +46,14 @@ public function __construct(Client $client) * Validate a bank account * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return void * @throws AdyenException */ - public function validateBankAccountIdentification( - \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest - $bankAccountIdentificationValidationRequest, - array $requestOptions = null - ): void { + public function validateBankAccountIdentification + (\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest + $bankAccountIdentificationValidationRequest, array $requestOptions = null): void + { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); } diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php index 6858d7500..97c9af2b9 100644 --- a/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a payment instrument group * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getPaymentInstrumentGroup(string $id, array $requestOptions = nu * Get all transaction rules for a payment instrument group * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse * @throws AdyenException */ @@ -76,7 +76,7 @@ public function getAllTransactionRulesForPaymentInstrumentGroup(string $id, arra * Create a payment instrument group * * @param \Adyen\Model\BalancePlatform\PaymentInstrumentGroupInfo $paymentInstrumentGroupInfo - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php index e4373e22f..6bbda0ca1 100644 --- a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a payment instrument * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaymentInstrument * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getPaymentInstrument(string $id, array $requestOptions = null): * Get the PAN of a payment instrument * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaymentInstrumentRevealInfo * @throws AdyenException */ @@ -76,7 +76,7 @@ public function getPanOfPaymentInstrument(string $id, array $requestOptions = nu * Get all transaction rules for a payment instrument * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse * @throws AdyenException */ @@ -92,7 +92,7 @@ public function getAllTransactionRulesForPaymentInstrument(string $id, array $re * * @param string $id * @param \Adyen\Model\BalancePlatform\PaymentInstrumentUpdateRequest $paymentInstrumentUpdateRequest - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\UpdatePaymentInstrument * @throws AdyenException */ @@ -107,7 +107,7 @@ public function updatePaymentInstrument(string $id, \Adyen\Model\BalancePlatform * Create a payment instrument * * @param \Adyen\Model\BalancePlatform\PaymentInstrumentInfo $paymentInstrumentInfo - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaymentInstrument * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/PlatformApi.php b/src/Adyen/Service/BalancePlatform/PlatformApi.php index 80267a016..a76a12f5f 100644 --- a/src/Adyen/Service/BalancePlatform/PlatformApi.php +++ b/src/Adyen/Service/BalancePlatform/PlatformApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a balance platform * * @param string $id - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\BalancePlatform * @throws AdyenException */ @@ -61,9 +61,7 @@ public function getBalancePlatform(string $id, array $requestOptions = null): \A * Get all account holders under a balance platform * * @param string $id - * @param int $offset - * @param int $limit - * @param array $requestOptions + * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\PaginatedAccountHoldersResponse * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php index 076c7d4f7..0ba29b039 100644 --- a/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php +++ b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Delete a transaction rule * * @param string $transactionRuleId - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ @@ -61,7 +61,7 @@ public function deleteTransactionRule(string $transactionRuleId, array $requestO * Get a transaction rule * * @param string $transactionRuleId - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\TransactionRuleResponse * @throws AdyenException */ @@ -77,7 +77,7 @@ public function getTransactionRule(string $transactionRuleId, array $requestOpti * * @param string $transactionRuleId * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ @@ -92,7 +92,7 @@ public function updateTransactionRule(string $transactionRuleId, \Adyen\Model\Ba * Create a transaction rule * * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo - * @param array $requestOptions + * @param array|null $requestOptions ['idempotencyKey' => 'v'] * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ diff --git a/templates/api.mustache b/templates/api.mustache index d3415fe55..f097b9500 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -39,8 +39,13 @@ class {{classname}} extends Service * Description: {{.}} * {{/description}} - {{#allParams}}* @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} - {{/allParams}}* @param array $requestOptions + {{#pathParams}} + * @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} + {{/pathParams}} + {{#bodyParams}} + * @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} + {{/bodyParams}} + * @param array|null $requestOptions [{{#hasQueryParams}}'queryParams' => [{{#queryParams}}'{{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}'=> 'v'{{^-last}}, {{/-last}}{{/queryParams}}], {{/hasQueryParams}}'idempotencyKey' => 'v'] {{#returnType}}* @return {{returnType}}{{/returnType}} * @throws AdyenException */ diff --git a/tests/Unit/BalancePlatformTest.php b/tests/Unit/BalancePlatformTest.php index a77ab0525..41463f6af 100644 --- a/tests/Unit/BalancePlatformTest.php +++ b/tests/Unit/BalancePlatformTest.php @@ -30,7 +30,8 @@ public function testgetAllAccountHolders() 200 ); $service = new PlatformApi($client); - $response = $service->getAllAccountHoldersUnderBalancePlatform("id", array('offset'=> 1, 'limit'=>10)); + $response = $service->getAllAccountHoldersUnderBalancePlatform("id", ['queryParams' => array('offset'=> 1, + 'limit'=>10)]); $accountHolder = $response->getAccountHolders()[0]; self::assertEquals('LE3227C223222D5D8S5S33M4M', $accountHolder->getLegalEntityId()); self::assertEquals(AccountHolder::STATUS_ACTIVE, $accountHolder->getStatus()); @@ -43,13 +44,12 @@ public function testgetAllAccountHoldersUrlCheck() { // create Checkout client $client = $this->createMockClientUrl( - 'tests/Resources/BalancePlatform/get-all-account-holders.json', - 200 + 'tests/Resources/BalancePlatform/get-all-account-holders.json' ); $service = new PlatformApi($client); $response = $service->getAllAccountHoldersUnderBalancePlatform( "id", - array('offset'=> 1, 'limit'=>10, 'idempotencyKey'=> '0192837450917834') + ['queryParams' => array('offset'=> 1, 'limit'=>10), 'idempotencyKey' => '01928734'] ); $this->assertEquals( 'https://balanceplatform-api-test.adyen.com/bcl/v2/balancePlatforms/id/accountHolders?offset=1&limit=10', @@ -124,9 +124,7 @@ public function testDeleteSweep() public function testGetSweepUrlCheckTest() { $client = $this->createMockClientUrl( - 'tests/Resources/BalancePlatform/update-accountholder.json', - 200 - ); + 'tests/Resources/BalancePlatform/update-accountholder.json'); $service = new BalanceAccountsApi($client); $service->getSweep('balanceAccountId', 'sweepId'); self::assertEquals( @@ -139,7 +137,6 @@ public function testGetSweepUrlCheckLive() { $client = $this->createMockClientUrl( 'tests/Resources/BalancePlatform/update-accountholder.json', - 200, Environment::LIVE ); $service = new BalanceAccountsApi($client); diff --git a/tests/Unit/TestCaseMock.php b/tests/Unit/TestCaseMock.php index 26559cdc8..feb18e1f7 100644 --- a/tests/Unit/TestCaseMock.php +++ b/tests/Unit/TestCaseMock.php @@ -83,7 +83,7 @@ protected function createMockClient($jsonFile, $httpStatus, $errno = null, $envi protected $requestUrl; - protected function createMockClientUrl($jsonFile, $httpStatus, $environment = Environment::TEST) + protected function createMockClientUrl($jsonFile, $environment = Environment::TEST) { $client = new Client(); $client->setApplicationName("My Test Application"); @@ -96,9 +96,9 @@ protected function createMockClientUrl($jsonFile, $httpStatus, $environment = En } $curlClient = $this->getMockBuilder(get_class(new CurlClient())) - ->onlyMethods(array('requestHttpRest')) + ->onlyMethods(array('requestHttp')) ->getMock(); - $curlClient->method('requestHttpRest') + $curlClient->method('requestHttp') ->willReturnCallback(function (Service $service, $requestUrl, $params) use ($json) { $this->requestUrl = $requestUrl; From 1658aaf9587aaa1a774e58ba8e394cc35c293f38 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:15:25 +0200 Subject: [PATCH 07/33] ran codebeautifier --- .../AULocalAccountIdentification.php | 6 ++-- .../Model/BalancePlatform/AccountHolder.php | 22 +++++++-------- .../AccountHolderCapability.php | 20 ++++++------- .../BalancePlatform/AccountHolderInfo.php | 14 +++++----- .../AccountSupportingEntityCapability.php | 14 +++++----- .../ActiveNetworkTokensRestriction.php | 4 +-- .../AdditionalBankIdentification.php | 4 +-- src/Adyen/Model/BalancePlatform/Address.php | 12 ++++---- src/Adyen/Model/BalancePlatform/Address2.php | 14 +++++----- src/Adyen/Model/BalancePlatform/Amount.php | 4 +-- .../Model/BalancePlatform/Authentication.php | 6 ++-- src/Adyen/Model/BalancePlatform/Balance.php | 8 +++--- .../Model/BalancePlatform/BalanceAccount.php | 16 +++++------ .../BalancePlatform/BalanceAccountInfo.php | 10 +++---- .../BalanceAccountUpdateRequest.php | 12 ++++---- .../Model/BalancePlatform/BalancePlatform.php | 6 ++-- .../BalanceSweepConfigurationsResponse.php | 6 ++-- ...AccountIdentificationValidationRequest.php | 2 +- ...ValidationRequestAccountIdentification.php | 26 ++++++++--------- .../BrandVariantsRestriction.php | 4 +-- .../Model/BalancePlatform/BulkAddress.php | 18 ++++++------ .../CALocalAccountIdentification.php | 10 +++---- .../CZLocalAccountIdentification.php | 6 ++-- src/Adyen/Model/BalancePlatform/Card.php | 24 ++++++++-------- .../BalancePlatform/CardConfiguration.php | 28 +++++++++---------- src/Adyen/Model/BalancePlatform/CardInfo.php | 14 +++++----- .../Model/BalancePlatform/ContactDetails.php | 8 +++--- .../BalancePlatform/CountriesRestriction.php | 4 +-- .../BalancePlatform/CronSweepSchedule.php | 4 +-- .../BalancePlatform/DayOfWeekRestriction.php | 4 +-- .../Model/BalancePlatform/DeliveryContact.php | 12 ++++---- .../DifferentCurrenciesRestriction.php | 4 +-- src/Adyen/Model/BalancePlatform/Duration.php | 4 +-- .../BalancePlatform/EntryModesRestriction.php | 4 +-- src/Adyen/Model/BalancePlatform/Expiry.php | 4 +-- .../HULocalAccountIdentification.php | 4 +-- .../IbanAccountIdentification.php | 4 +-- .../InternationalTransactionRestriction.php | 4 +-- .../Model/BalancePlatform/InvalidField.php | 6 ++-- .../Model/BalancePlatform/JSONObject.php | 4 +-- src/Adyen/Model/BalancePlatform/JSONPath.php | 2 +- .../MatchingTransactionsRestriction.php | 4 +-- .../Model/BalancePlatform/MccsRestriction.php | 4 +-- .../BalancePlatform/MerchantAcquirerPair.php | 4 +-- .../MerchantNamesRestriction.php | 4 +-- .../BalancePlatform/MerchantsRestriction.php | 4 +-- .../NOLocalAccountIdentification.php | 4 +-- src/Adyen/Model/BalancePlatform/Name.php | 4 +-- .../NumberAndBicAccountIdentification.php | 8 +++--- .../BalancePlatform/ObjectSerializer.php | 11 ++++---- .../PLLocalAccountIdentification.php | 4 +-- .../PaginatedAccountHoldersResponse.php | 6 ++-- .../PaginatedBalanceAccountsResponse.php | 6 ++-- .../PaginatedPaymentInstrumentsResponse.php | 6 ++-- .../BalancePlatform/PaymentInstrument.php | 22 +++++++-------- .../PaymentInstrumentBankAccount.php | 10 +++---- .../PaymentInstrumentGroup.php | 12 ++++---- .../PaymentInstrumentGroupInfo.php | 10 +++---- .../BalancePlatform/PaymentInstrumentInfo.php | 18 ++++++------ .../PaymentInstrumentRevealInfo.php | 6 ++-- .../PaymentInstrumentUpdateRequest.php | 10 +++---- src/Adyen/Model/BalancePlatform/Phone.php | 4 +-- .../Model/BalancePlatform/PhoneNumber.php | 6 ++-- .../ProcessingTypesRestriction.php | 4 +-- .../BalancePlatform/RestServiceError.php | 18 ++++++------ .../SELocalAccountIdentification.php | 6 ++-- .../SGLocalAccountIdentification.php | 6 ++-- .../Model/BalancePlatform/StringMatch.php | 4 +-- .../BalancePlatform/SweepConfigurationV2.php | 26 ++++++++--------- .../SweepConfigurationV2Schedule.php | 4 +-- .../BalancePlatform/SweepCounterparty.php | 6 ++-- .../Model/BalancePlatform/SweepSchedule.php | 2 +- src/Adyen/Model/BalancePlatform/TimeOfDay.php | 4 +-- .../BalancePlatform/TimeOfDayRestriction.php | 4 +-- .../TotalAmountRestriction.php | 4 +-- .../Model/BalancePlatform/TransactionRule.php | 28 +++++++++---------- .../TransactionRuleEntityKey.php | 4 +-- .../BalancePlatform/TransactionRuleInfo.php | 26 ++++++++--------- .../TransactionRuleInterval.php | 12 ++++---- .../TransactionRuleResponse.php | 2 +- .../TransactionRuleRestrictions.php | 28 +++++++++---------- .../TransactionRulesResponse.php | 2 +- .../UKLocalAccountIdentification.php | 6 ++-- .../USLocalAccountIdentification.php | 8 +++--- .../UpdatePaymentInstrument.php | 24 ++++++++-------- .../BalancePlatform/VerificationDeadline.php | 4 +-- .../BalancePlatform/BalanceAccountsApi.php | 3 +- .../BankAccountValidationApi.php | 9 +++--- tests/Unit/BalancePlatformTest.php | 3 +- 89 files changed, 399 insertions(+), 397 deletions(-) diff --git a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php index 24d9ac505..a777a4d80 100644 --- a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php @@ -72,8 +72,8 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false + 'bsb_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 709dee5d1..14b41d64a 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -88,16 +88,16 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'id' => false, - 'legal_entity_id' => false, - 'primary_balance_account' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false, - 'verification_deadlines' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'id' => false, + 'legal_entity_id' => false, + 'primary_balance_account' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false, + 'verification_deadlines' => false ]; /** @@ -752,7 +752,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php index 3d71d1a50..e3ae79713 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php @@ -86,15 +86,15 @@ class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'allowed_settings' => false, - 'enabled' => false, - 'problems' => false, - 'requested' => false, - 'requested_level' => false, - 'requested_settings' => false, - 'transfer_instruments' => false, - 'verification_status' => false + 'allowed_level' => false, + 'allowed_settings' => false, + 'enabled' => false, + 'problems' => false, + 'requested' => false, + 'requested_level' => false, + 'requested_settings' => false, + 'transfer_instruments' => false, + 'verification_status' => false ]; /** @@ -786,7 +786,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index 193594ffa..7ce6a8547 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -80,12 +80,12 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'legal_entity_id' => false, - 'reference' => false, - 'time_zone' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'legal_entity_id' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php index 48d14a6cc..f9dedc7a8 100644 --- a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php @@ -80,12 +80,12 @@ class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'enabled' => false, - 'id' => false, - 'requested' => false, - 'requested_level' => false, - 'verification_status' => false + 'allowed_level' => false, + 'enabled' => false, + 'id' => false, + 'requested' => false, + 'requested_level' => false, + 'verification_status' => false ]; /** @@ -684,7 +684,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php index efa8cf26b..53fedef8d 100644 --- a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php @@ -70,7 +70,7 @@ class ActiveNetworkTokensRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php index 7ccc21434..f38ce5c88 100644 --- a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php @@ -70,7 +70,7 @@ class AdditionalBankIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'code' => false, - 'type' => false + 'type' => false ]; /** @@ -436,7 +436,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address.php b/src/Adyen/Model/BalancePlatform/Address.php index 94ec71f14..0e6d16c24 100644 --- a/src/Adyen/Model/BalancePlatform/Address.php +++ b/src/Adyen/Model/BalancePlatform/Address.php @@ -78,11 +78,11 @@ class Address implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'house_number_or_name' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -554,7 +554,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address2.php b/src/Adyen/Model/BalancePlatform/Address2.php index 7d6648f03..122f3756e 100644 --- a/src/Adyen/Model/BalancePlatform/Address2.php +++ b/src/Adyen/Model/BalancePlatform/Address2.php @@ -80,12 +80,12 @@ class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'line1' => false, - 'line2' => false, - 'line3' => false, - 'postal_code' => false, - 'state_or_province' => false + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php index 5bf62d874..e0161429c 100644 --- a/src/Adyen/Model/BalancePlatform/Amount.php +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -70,7 +70,7 @@ class Amount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'currency' => false, - 'value' => false + 'value' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Authentication.php b/src/Adyen/Model/BalancePlatform/Authentication.php index 5c7fdbb4f..a62b4e681 100644 --- a/src/Adyen/Model/BalancePlatform/Authentication.php +++ b/src/Adyen/Model/BalancePlatform/Authentication.php @@ -72,8 +72,8 @@ class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'email' => false, - 'password' => false, - 'phone' => false + 'password' => false, + 'phone' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 8ad88e526..52852c3fe 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -74,9 +74,9 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'available' => false, - 'balance' => false, - 'currency' => false, - 'reserved' => false + 'balance' => false, + 'currency' => false, + 'reserved' => false ]; /** @@ -483,7 +483,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php index 537594491..80117eb2e 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccount.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -82,13 +82,13 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'balances' => false, - 'default_currency_code' => false, - 'description' => false, - 'id' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'balances' => false, + 'default_currency_code' => false, + 'description' => false, + 'id' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -650,7 +650,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php index 5692fa378..b15f90c8b 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -76,10 +76,10 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -508,7 +508,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index 03c75d32d..6f82a2ea3 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -78,11 +78,11 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatform.php b/src/Adyen/Model/BalancePlatform/BalancePlatform.php index fe53ad778..4dcf14f06 100644 --- a/src/Adyen/Model/BalancePlatform/BalancePlatform.php +++ b/src/Adyen/Model/BalancePlatform/BalancePlatform.php @@ -72,8 +72,8 @@ class BalancePlatform implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'description' => false, - 'id' => false, - 'status' => false + 'id' => false, + 'status' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php index ee1614c42..2849548bf 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php +++ b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php @@ -72,8 +72,8 @@ class BalanceSweepConfigurationsResponse implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'sweeps' => false + 'has_previous' => false, + 'sweeps' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php index 53542da7c..b545b6948 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php @@ -372,7 +372,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index 319aa44b3..a866b671c 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -93,18 +93,18 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'bank_code' => false, - 'iban' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'clearing_number' => false, - 'sort_code' => false, - 'routing_number' => false + 'bsb_code' => false, + 'type' => false, + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'bank_code' => false, + 'iban' => false, + 'additional_bank_identification' => false, + 'bic' => false, + 'clearing_number' => false, + 'sort_code' => false, + 'routing_number' => false ]; /** @@ -812,7 +812,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php index dbc1b317a..0ed0914b1 100644 --- a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php @@ -70,7 +70,7 @@ class BrandVariantsRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BulkAddress.php b/src/Adyen/Model/BalancePlatform/BulkAddress.php index 21cb09b88..8b4f1e145 100644 --- a/src/Adyen/Model/BalancePlatform/BulkAddress.php +++ b/src/Adyen/Model/BalancePlatform/BulkAddress.php @@ -84,14 +84,14 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'company' => false, - 'country' => false, - 'email' => false, - 'house_number_or_name' => false, - 'mobile' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'company' => false, + 'country' => false, + 'email' => false, + 'house_number_or_name' => false, + 'mobile' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -644,7 +644,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php index cabb2a927..5c2782f99 100644 --- a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php @@ -76,10 +76,10 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'type' => false + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'type' => false ]; /** @@ -581,7 +581,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php index 7796cd397..7d5d1191e 100644 --- a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php @@ -72,8 +72,8 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bank_code' => false, - 'type' => false + 'bank_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php index a0f59f249..e10e5b036 100644 --- a/src/Adyen/Model/BalancePlatform/Card.php +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -90,17 +90,17 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'bin' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'cvc' => false, - 'delivery_contact' => false, - 'expiration' => false, - 'form_factor' => false, - 'last_four' => false, - 'number' => false + 'bin' => false, + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'cvc' => false, + 'delivery_contact' => false, + 'expiration' => false, + 'form_factor' => false, + 'last_four' => false, + 'number' => false ]; /** @@ -793,7 +793,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php index 407696741..0aa41d2fe 100644 --- a/src/Adyen/Model/BalancePlatform/CardConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -94,19 +94,19 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'activation' => false, - 'activation_url' => false, - 'bulk_address' => false, - 'card_image_id' => false, - 'carrier' => false, - 'carrier_image_id' => false, - 'configuration_profile_id' => false, - 'currency' => false, - 'envelope' => false, - 'insert' => false, - 'language' => false, - 'logo_image_id' => false, - 'pin_mailer' => false, - 'shipment_method' => false + 'activation_url' => false, + 'bulk_address' => false, + 'card_image_id' => false, + 'carrier' => false, + 'carrier_image_id' => false, + 'configuration_profile_id' => false, + 'currency' => false, + 'envelope' => false, + 'insert' => false, + 'language' => false, + 'logo_image_id' => false, + 'pin_mailer' => false, + 'shipment_method' => false ]; /** @@ -814,7 +814,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardInfo.php b/src/Adyen/Model/BalancePlatform/CardInfo.php index fbb7e9f66..b881f5538 100644 --- a/src/Adyen/Model/BalancePlatform/CardInfo.php +++ b/src/Adyen/Model/BalancePlatform/CardInfo.php @@ -80,12 +80,12 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'delivery_contact' => false, - 'form_factor' => false + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'delivery_contact' => false, + 'form_factor' => false ]; /** @@ -620,7 +620,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ContactDetails.php b/src/Adyen/Model/BalancePlatform/ContactDetails.php index ce4cb4855..aca2ef30a 100644 --- a/src/Adyen/Model/BalancePlatform/ContactDetails.php +++ b/src/Adyen/Model/BalancePlatform/ContactDetails.php @@ -74,9 +74,9 @@ class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'phone' => false, - 'web_address' => false + 'email' => false, + 'phone' => false, + 'web_address' => false ]; /** @@ -480,7 +480,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php index 49e127b4c..b89a73de4 100644 --- a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php @@ -70,7 +70,7 @@ class CountriesRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php index 0b2ab8a56..041e73359 100644 --- a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php @@ -70,7 +70,7 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -445,7 +445,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php index 13e248b8e..3b398fe34 100644 --- a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php @@ -70,7 +70,7 @@ class DayOfWeekRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -439,7 +439,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php index d1b5f5ec8..b4cb4408b 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryContact.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -78,11 +78,11 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'full_phone_number' => false, - 'name' => false, - 'phone_number' => false, - 'web_address' => false + 'email' => false, + 'full_phone_number' => false, + 'name' => false, + 'phone_number' => false, + 'web_address' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php index d99db659e..c39ce4d26 100644 --- a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php @@ -70,7 +70,7 @@ class DifferentCurrenciesRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Duration.php b/src/Adyen/Model/BalancePlatform/Duration.php index 9f5ffa4db..1e48335fc 100644 --- a/src/Adyen/Model/BalancePlatform/Duration.php +++ b/src/Adyen/Model/BalancePlatform/Duration.php @@ -70,7 +70,7 @@ class Duration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'unit' => false, - 'value' => true + 'value' => true ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php index 4a062c74d..0dba149d2 100644 --- a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php @@ -70,7 +70,7 @@ class EntryModesRestriction implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -443,7 +443,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Expiry.php b/src/Adyen/Model/BalancePlatform/Expiry.php index a713dfba3..010325c11 100644 --- a/src/Adyen/Model/BalancePlatform/Expiry.php +++ b/src/Adyen/Model/BalancePlatform/Expiry.php @@ -70,7 +70,7 @@ class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'month' => false, - 'year' => false + 'year' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php index 8ef664195..6df91ad46 100644 --- a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php @@ -70,7 +70,7 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php index efd00176f..74dfea5fd 100644 --- a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -70,7 +70,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php index 9b73c033d..1c7857b81 100644 --- a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php +++ b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php @@ -70,7 +70,7 @@ class InternationalTransactionRestriction implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InvalidField.php b/src/Adyen/Model/BalancePlatform/InvalidField.php index 79fd00ec0..63539a42c 100644 --- a/src/Adyen/Model/BalancePlatform/InvalidField.php +++ b/src/Adyen/Model/BalancePlatform/InvalidField.php @@ -72,8 +72,8 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'message' => false, - 'name' => false, - 'value' => false + 'name' => false, + 'value' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONObject.php b/src/Adyen/Model/BalancePlatform/JSONObject.php index e78daea48..90e72f965 100644 --- a/src/Adyen/Model/BalancePlatform/JSONObject.php +++ b/src/Adyen/Model/BalancePlatform/JSONObject.php @@ -70,7 +70,7 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'paths' => false, - 'root_path' => false + 'root_path' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONPath.php b/src/Adyen/Model/BalancePlatform/JSONPath.php index f577e9910..7b8ade787 100644 --- a/src/Adyen/Model/BalancePlatform/JSONPath.php +++ b/src/Adyen/Model/BalancePlatform/JSONPath.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php index 288965ca1..dd4e16b74 100644 --- a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php @@ -70,7 +70,7 @@ class MatchingTransactionsRestriction implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MccsRestriction.php b/src/Adyen/Model/BalancePlatform/MccsRestriction.php index c37bd3438..d4b8fcce5 100644 --- a/src/Adyen/Model/BalancePlatform/MccsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MccsRestriction.php @@ -70,7 +70,7 @@ class MccsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php index 02704cadf..43e34628f 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php +++ b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php @@ -70,7 +70,7 @@ class MerchantAcquirerPair implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'acquirer_id' => false, - 'merchant_id' => false + 'merchant_id' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php index 3cbf61ec0..fc9c8aacf 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php @@ -70,7 +70,7 @@ class MerchantNamesRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php index 071a8eb6f..f4a93f892 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php @@ -70,7 +70,7 @@ class MerchantsRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php index 57db6da40..6627a5429 100644 --- a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php @@ -70,7 +70,7 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Name.php b/src/Adyen/Model/BalancePlatform/Name.php index bab3c4994..d8b5dcb22 100644 --- a/src/Adyen/Model/BalancePlatform/Name.php +++ b/src/Adyen/Model/BalancePlatform/Name.php @@ -70,7 +70,7 @@ class Name implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'first_name' => false, - 'last_name' => false + 'last_name' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php index 0c35925fd..36c5319f8 100644 --- a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php @@ -74,9 +74,9 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'account_number' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'type' => false + 'additional_bank_identification' => false, + 'bic' => false, + 'type' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index c50681a56..52fd467a0 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -84,7 +84,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -120,7 +120,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -243,9 +245,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); diff --git a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php index f461856c9..c975a81ae 100644 --- a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php @@ -70,7 +70,7 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php index db123042f..6497854c7 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php @@ -72,8 +72,8 @@ class PaginatedAccountHoldersResponse implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'account_holders' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php index d6e4f5f24..89b95a24c 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php @@ -72,8 +72,8 @@ class PaginatedBalanceAccountsResponse implements ModelInterface, ArrayAccess, \ */ protected static $openAPINullables = [ 'balance_accounts' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php index 53fa5c833..6c98b3f16 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php @@ -72,8 +72,8 @@ class PaginatedPaymentInstrumentsResponse implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'payment_instruments' => false + 'has_previous' => false, + 'payment_instruments' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index 6e300bb5b..2ea57ca8d 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -88,16 +88,16 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -836,7 +836,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php index 3a941f5dd..3a6aa97f5 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php @@ -77,10 +77,10 @@ class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false, - 'account_number' => false, - 'account_type' => false, - 'routing_number' => false + 'type' => false, + 'account_number' => false, + 'account_type' => false, + 'routing_number' => false ]; /** @@ -519,7 +519,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php index a19088ee9..7b5e0f815 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php @@ -78,11 +78,11 @@ class PaymentInstrumentGroup implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'id' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'id' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php index 39e4fd53b..ff6c2c140 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php @@ -76,10 +76,10 @@ class PaymentInstrumentGroupInfo implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php index 558664dd3..7463a423f 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -84,14 +84,14 @@ class PaymentInstrumentInfo implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'description' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'card' => false, + 'description' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -765,7 +765,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php index 9c83b8108..2a5d0dd25 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php @@ -72,8 +72,8 @@ class PaymentInstrumentRevealInfo implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'cvc' => false, - 'expiration' => false, - 'pan' => false + 'expiration' => false, + 'pan' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php index 70861a974..bba8047ef 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php @@ -76,10 +76,10 @@ class PaymentInstrumentUpdateRequest implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false + 'card' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false ]; /** @@ -587,7 +587,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Phone.php b/src/Adyen/Model/BalancePlatform/Phone.php index 1677aa9b2..97fd7691f 100644 --- a/src/Adyen/Model/BalancePlatform/Phone.php +++ b/src/Adyen/Model/BalancePlatform/Phone.php @@ -70,7 +70,7 @@ class Phone implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'number' => false, - 'type' => false + 'type' => false ]; /** @@ -442,7 +442,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PhoneNumber.php b/src/Adyen/Model/BalancePlatform/PhoneNumber.php index 49ee0c287..d59dcabbe 100644 --- a/src/Adyen/Model/BalancePlatform/PhoneNumber.php +++ b/src/Adyen/Model/BalancePlatform/PhoneNumber.php @@ -72,8 +72,8 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'phone_country_code' => false, - 'phone_number' => false, - 'phone_type' => false + 'phone_number' => false, + 'phone_type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php index 22aec905d..a34e33a75 100644 --- a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php @@ -70,7 +70,7 @@ class ProcessingTypesRestriction implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -441,7 +441,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/RestServiceError.php b/src/Adyen/Model/BalancePlatform/RestServiceError.php index 3de3284ba..b74ba67fc 100644 --- a/src/Adyen/Model/BalancePlatform/RestServiceError.php +++ b/src/Adyen/Model/BalancePlatform/RestServiceError.php @@ -84,14 +84,14 @@ class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'detail' => false, - 'error_code' => false, - 'instance' => false, - 'invalid_fields' => false, - 'request_id' => false, - 'response' => false, - 'status' => true, - 'title' => false, - 'type' => false + 'error_code' => false, + 'instance' => false, + 'invalid_fields' => false, + 'request_id' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false ]; /** @@ -654,7 +654,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php index 30f219400..d8ddb1b0f 100644 --- a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php @@ -72,8 +72,8 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'clearing_number' => false, - 'type' => false + 'clearing_number' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php index 8322532bd..064dddc73 100644 --- a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php @@ -72,8 +72,8 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bic' => false, - 'type' => false + 'bic' => false, + 'type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/StringMatch.php b/src/Adyen/Model/BalancePlatform/StringMatch.php index 5e93be9ae..f66cb0a6b 100644 --- a/src/Adyen/Model/BalancePlatform/StringMatch.php +++ b/src/Adyen/Model/BalancePlatform/StringMatch.php @@ -70,7 +70,7 @@ class StringMatch implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index f89d8b96e..2860aee88 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -92,18 +92,18 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'category' => false, - 'counterparty' => false, - 'currency' => false, - 'description' => false, - 'id' => false, - 'priorities' => false, - 'reason' => false, - 'schedule' => false, - 'status' => false, - 'sweep_amount' => false, - 'target_amount' => false, - 'trigger_amount' => false, - 'type' => false + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweep_amount' => false, + 'target_amount' => false, + 'trigger_amount' => false, + 'type' => false ]; /** @@ -978,7 +978,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php index c07e6bb44..c5d5eb540 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php @@ -71,7 +71,7 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -407,7 +407,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php index b465f0ba0..ad023501f 100644 --- a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -72,8 +72,8 @@ class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'merchant_account' => false, - 'transfer_instrument_id' => false + 'merchant_account' => false, + 'transfer_instrument_id' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php index 0df075c54..defab0d3e 100644 --- a/src/Adyen/Model/BalancePlatform/SweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -408,7 +408,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDay.php b/src/Adyen/Model/BalancePlatform/TimeOfDay.php index 1d8549b72..2e6c0a36f 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDay.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDay.php @@ -70,7 +70,7 @@ class TimeOfDay implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'end_time' => false, - 'start_time' => false + 'start_time' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php index 4ac8fed5e..574fdb717 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php @@ -70,7 +70,7 @@ class TimeOfDayRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php index e579b2d2a..b2d7aee4f 100644 --- a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php @@ -70,7 +70,7 @@ class TotalAmountRestriction implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index d9a58ef5b..87b4b0631 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -94,19 +94,19 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'id' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'id' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -965,7 +965,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php index 70421f031..430fbc0f2 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php @@ -70,7 +70,7 @@ class TransactionRuleEntityKey implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'entity_reference' => false, - 'entity_type' => false + 'entity_type' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 17c32c708..154e09a23 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -92,18 +92,18 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -931,7 +931,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php index 24e81f3c5..d43f7cd2e 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php @@ -78,11 +78,11 @@ class TransactionRuleInterval implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'day_of_month' => true, - 'day_of_week' => false, - 'duration' => false, - 'time_of_day' => false, - 'time_zone' => false, - 'type' => false + 'day_of_week' => false, + 'duration' => false, + 'time_of_day' => false, + 'time_zone' => false, + 'type' => false ]; /** @@ -626,7 +626,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php index 3d761e342..d55dfd575 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php index bee041525..0e7b2b440 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -94,19 +94,19 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'active_network_tokens' => false, - 'brand_variants' => false, - 'countries' => false, - 'day_of_week' => false, - 'different_currencies' => false, - 'entry_modes' => false, - 'international_transaction' => false, - 'matching_transactions' => false, - 'mccs' => false, - 'merchant_names' => false, - 'merchants' => false, - 'processing_types' => false, - 'time_of_day' => false, - 'total_amount' => false + 'brand_variants' => false, + 'countries' => false, + 'day_of_week' => false, + 'different_currencies' => false, + 'entry_modes' => false, + 'international_transaction' => false, + 'matching_transactions' => false, + 'mccs' => false, + 'merchant_names' => false, + 'merchants' => false, + 'processing_types' => false, + 'time_of_day' => false, + 'total_amount' => false ]; /** @@ -811,7 +811,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php index 56ad310c9..384a8d754 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php index d27f1bb31..34158d198 100644 --- a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php @@ -72,8 +72,8 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'sort_code' => false, - 'type' => false + 'sort_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php index 25f4f8e9d..19a5b9daf 100644 --- a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php @@ -74,9 +74,9 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'routing_number' => false, - 'type' => false + 'account_type' => false, + 'routing_number' => false, + 'type' => false ]; /** @@ -544,7 +544,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index d66b4e70d..77ca4531d 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -90,17 +90,17 @@ class UpdatePaymentInstrument implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -870,7 +870,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php index 0b3449107..e014944f5 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -70,7 +70,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'capabilities' => false, - 'expires_at' => false + 'expires_at' => false ]; /** @@ -528,7 +528,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 5cefd6d37..e17db0889 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -48,14 +48,13 @@ public function __construct(Client $client) * @param string $balanceAccountId * @param string $sweepId * @param array|null $requestOptions ['idempotencyKey' => 'v'] - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index 6917e1397..f5bfac7ba 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -50,10 +50,11 @@ public function __construct(Client $client) * @return void * @throws AdyenException */ - public function validateBankAccountIdentification - (\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest - $bankAccountIdentificationValidationRequest, array $requestOptions = null): void - { + public function validateBankAccountIdentification( + \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest + $bankAccountIdentificationValidationRequest, + array $requestOptions = null + ): void { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); } diff --git a/tests/Unit/BalancePlatformTest.php b/tests/Unit/BalancePlatformTest.php index 41463f6af..8c5c78bd6 100644 --- a/tests/Unit/BalancePlatformTest.php +++ b/tests/Unit/BalancePlatformTest.php @@ -124,7 +124,8 @@ public function testDeleteSweep() public function testGetSweepUrlCheckTest() { $client = $this->createMockClientUrl( - 'tests/Resources/BalancePlatform/update-accountholder.json'); + 'tests/Resources/BalancePlatform/update-accountholder.json' + ); $service = new BalanceAccountsApi($client); $service->getSweep('balanceAccountId', 'sweepId'); self::assertEquals( From 5f0cdaa88d0639ba7e0256a433d11462211ae742 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:22:04 +0200 Subject: [PATCH 08/33] add type in queryparam annotation --- .../AULocalAccountIdentification.php | 6 ++-- .../Model/BalancePlatform/AccountHolder.php | 22 +++++++-------- .../AccountHolderCapability.php | 20 ++++++------- .../BalancePlatform/AccountHolderInfo.php | 14 +++++----- .../AccountSupportingEntityCapability.php | 14 +++++----- .../ActiveNetworkTokensRestriction.php | 4 +-- .../AdditionalBankIdentification.php | 4 +-- src/Adyen/Model/BalancePlatform/Address.php | 12 ++++---- src/Adyen/Model/BalancePlatform/Address2.php | 14 +++++----- src/Adyen/Model/BalancePlatform/Amount.php | 4 +-- .../Model/BalancePlatform/Authentication.php | 6 ++-- src/Adyen/Model/BalancePlatform/Balance.php | 8 +++--- .../Model/BalancePlatform/BalanceAccount.php | 16 +++++------ .../BalancePlatform/BalanceAccountInfo.php | 10 +++---- .../BalanceAccountUpdateRequest.php | 12 ++++---- .../Model/BalancePlatform/BalancePlatform.php | 6 ++-- .../BalanceSweepConfigurationsResponse.php | 6 ++-- ...AccountIdentificationValidationRequest.php | 2 +- ...ValidationRequestAccountIdentification.php | 26 ++++++++--------- .../BrandVariantsRestriction.php | 4 +-- .../Model/BalancePlatform/BulkAddress.php | 18 ++++++------ .../CALocalAccountIdentification.php | 10 +++---- .../CZLocalAccountIdentification.php | 6 ++-- src/Adyen/Model/BalancePlatform/Card.php | 24 ++++++++-------- .../BalancePlatform/CardConfiguration.php | 28 +++++++++---------- src/Adyen/Model/BalancePlatform/CardInfo.php | 14 +++++----- .../Model/BalancePlatform/ContactDetails.php | 8 +++--- .../BalancePlatform/CountriesRestriction.php | 4 +-- .../BalancePlatform/CronSweepSchedule.php | 4 +-- .../BalancePlatform/DayOfWeekRestriction.php | 4 +-- .../Model/BalancePlatform/DeliveryContact.php | 12 ++++---- .../DifferentCurrenciesRestriction.php | 4 +-- src/Adyen/Model/BalancePlatform/Duration.php | 4 +-- .../BalancePlatform/EntryModesRestriction.php | 4 +-- src/Adyen/Model/BalancePlatform/Expiry.php | 4 +-- .../HULocalAccountIdentification.php | 4 +-- .../IbanAccountIdentification.php | 4 +-- .../InternationalTransactionRestriction.php | 4 +-- .../Model/BalancePlatform/InvalidField.php | 6 ++-- .../Model/BalancePlatform/JSONObject.php | 4 +-- src/Adyen/Model/BalancePlatform/JSONPath.php | 2 +- .../MatchingTransactionsRestriction.php | 4 +-- .../Model/BalancePlatform/MccsRestriction.php | 4 +-- .../BalancePlatform/MerchantAcquirerPair.php | 4 +-- .../MerchantNamesRestriction.php | 4 +-- .../BalancePlatform/MerchantsRestriction.php | 4 +-- .../NOLocalAccountIdentification.php | 4 +-- src/Adyen/Model/BalancePlatform/Name.php | 4 +-- .../NumberAndBicAccountIdentification.php | 8 +++--- .../BalancePlatform/ObjectSerializer.php | 11 ++++---- .../PLLocalAccountIdentification.php | 4 +-- .../PaginatedAccountHoldersResponse.php | 6 ++-- .../PaginatedBalanceAccountsResponse.php | 6 ++-- .../PaginatedPaymentInstrumentsResponse.php | 6 ++-- .../BalancePlatform/PaymentInstrument.php | 22 +++++++-------- .../PaymentInstrumentBankAccount.php | 10 +++---- .../PaymentInstrumentGroup.php | 12 ++++---- .../PaymentInstrumentGroupInfo.php | 10 +++---- .../BalancePlatform/PaymentInstrumentInfo.php | 18 ++++++------ .../PaymentInstrumentRevealInfo.php | 6 ++-- .../PaymentInstrumentUpdateRequest.php | 10 +++---- src/Adyen/Model/BalancePlatform/Phone.php | 4 +-- .../Model/BalancePlatform/PhoneNumber.php | 6 ++-- .../ProcessingTypesRestriction.php | 4 +-- .../BalancePlatform/RestServiceError.php | 18 ++++++------ .../SELocalAccountIdentification.php | 6 ++-- .../SGLocalAccountIdentification.php | 6 ++-- .../Model/BalancePlatform/StringMatch.php | 4 +-- .../BalancePlatform/SweepConfigurationV2.php | 26 ++++++++--------- .../SweepConfigurationV2Schedule.php | 4 +-- .../BalancePlatform/SweepCounterparty.php | 6 ++-- .../Model/BalancePlatform/SweepSchedule.php | 2 +- src/Adyen/Model/BalancePlatform/TimeOfDay.php | 4 +-- .../BalancePlatform/TimeOfDayRestriction.php | 4 +-- .../TotalAmountRestriction.php | 4 +-- .../Model/BalancePlatform/TransactionRule.php | 28 +++++++++---------- .../TransactionRuleEntityKey.php | 4 +-- .../BalancePlatform/TransactionRuleInfo.php | 26 ++++++++--------- .../TransactionRuleInterval.php | 12 ++++---- .../TransactionRuleResponse.php | 2 +- .../TransactionRuleRestrictions.php | 28 +++++++++---------- .../TransactionRulesResponse.php | 2 +- .../UKLocalAccountIdentification.php | 6 ++-- .../USLocalAccountIdentification.php | 8 +++--- .../UpdatePaymentInstrument.php | 24 ++++++++-------- .../BalancePlatform/VerificationDeadline.php | 4 +-- .../BalancePlatform/AccountHoldersApi.php | 8 +++--- .../BalancePlatform/BalanceAccountsApi.php | 21 +++++++------- .../BankAccountValidationApi.php | 11 ++++---- .../PaymentInstrumentGroupsApi.php | 6 ++-- .../BalancePlatform/PaymentInstrumentsApi.php | 10 +++---- .../Service/BalancePlatform/PlatformApi.php | 4 +-- .../BalancePlatform/TransactionRulesApi.php | 8 +++--- templates/api.mustache | 2 +- 94 files changed, 425 insertions(+), 426 deletions(-) diff --git a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php index a777a4d80..24d9ac505 100644 --- a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php @@ -72,8 +72,8 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false + 'bsb_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 14b41d64a..709dee5d1 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -88,16 +88,16 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'id' => false, - 'legal_entity_id' => false, - 'primary_balance_account' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false, - 'verification_deadlines' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'id' => false, + 'legal_entity_id' => false, + 'primary_balance_account' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false, + 'verification_deadlines' => false ]; /** @@ -752,7 +752,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php index e3ae79713..3d71d1a50 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php @@ -86,15 +86,15 @@ class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'allowed_settings' => false, - 'enabled' => false, - 'problems' => false, - 'requested' => false, - 'requested_level' => false, - 'requested_settings' => false, - 'transfer_instruments' => false, - 'verification_status' => false + 'allowed_level' => false, + 'allowed_settings' => false, + 'enabled' => false, + 'problems' => false, + 'requested' => false, + 'requested_level' => false, + 'requested_settings' => false, + 'transfer_instruments' => false, + 'verification_status' => false ]; /** @@ -786,7 +786,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index 7ce6a8547..193594ffa 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -80,12 +80,12 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'legal_entity_id' => false, - 'reference' => false, - 'time_zone' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'legal_entity_id' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php index f9dedc7a8..48d14a6cc 100644 --- a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php @@ -80,12 +80,12 @@ class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'enabled' => false, - 'id' => false, - 'requested' => false, - 'requested_level' => false, - 'verification_status' => false + 'allowed_level' => false, + 'enabled' => false, + 'id' => false, + 'requested' => false, + 'requested_level' => false, + 'verification_status' => false ]; /** @@ -684,7 +684,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php index 53fedef8d..efa8cf26b 100644 --- a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php @@ -70,7 +70,7 @@ class ActiveNetworkTokensRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php index f38ce5c88..7ccc21434 100644 --- a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php @@ -70,7 +70,7 @@ class AdditionalBankIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'code' => false, - 'type' => false + 'type' => false ]; /** @@ -436,7 +436,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address.php b/src/Adyen/Model/BalancePlatform/Address.php index 0e6d16c24..94ec71f14 100644 --- a/src/Adyen/Model/BalancePlatform/Address.php +++ b/src/Adyen/Model/BalancePlatform/Address.php @@ -78,11 +78,11 @@ class Address implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'house_number_or_name' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -554,7 +554,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address2.php b/src/Adyen/Model/BalancePlatform/Address2.php index 122f3756e..7d6648f03 100644 --- a/src/Adyen/Model/BalancePlatform/Address2.php +++ b/src/Adyen/Model/BalancePlatform/Address2.php @@ -80,12 +80,12 @@ class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'line1' => false, - 'line2' => false, - 'line3' => false, - 'postal_code' => false, - 'state_or_province' => false + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php index e0161429c..5bf62d874 100644 --- a/src/Adyen/Model/BalancePlatform/Amount.php +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -70,7 +70,7 @@ class Amount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'currency' => false, - 'value' => false + 'value' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Authentication.php b/src/Adyen/Model/BalancePlatform/Authentication.php index a62b4e681..5c7fdbb4f 100644 --- a/src/Adyen/Model/BalancePlatform/Authentication.php +++ b/src/Adyen/Model/BalancePlatform/Authentication.php @@ -72,8 +72,8 @@ class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'email' => false, - 'password' => false, - 'phone' => false + 'password' => false, + 'phone' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 52852c3fe..8ad88e526 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -74,9 +74,9 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'available' => false, - 'balance' => false, - 'currency' => false, - 'reserved' => false + 'balance' => false, + 'currency' => false, + 'reserved' => false ]; /** @@ -483,7 +483,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php index 80117eb2e..537594491 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccount.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -82,13 +82,13 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'balances' => false, - 'default_currency_code' => false, - 'description' => false, - 'id' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'balances' => false, + 'default_currency_code' => false, + 'description' => false, + 'id' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -650,7 +650,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php index b15f90c8b..5692fa378 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -76,10 +76,10 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -508,7 +508,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index 6f82a2ea3..03c75d32d 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -78,11 +78,11 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatform.php b/src/Adyen/Model/BalancePlatform/BalancePlatform.php index 4dcf14f06..fe53ad778 100644 --- a/src/Adyen/Model/BalancePlatform/BalancePlatform.php +++ b/src/Adyen/Model/BalancePlatform/BalancePlatform.php @@ -72,8 +72,8 @@ class BalancePlatform implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'description' => false, - 'id' => false, - 'status' => false + 'id' => false, + 'status' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php index 2849548bf..ee1614c42 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php +++ b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php @@ -72,8 +72,8 @@ class BalanceSweepConfigurationsResponse implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'sweeps' => false + 'has_previous' => false, + 'sweeps' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php index b545b6948..53542da7c 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php @@ -372,7 +372,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index a866b671c..319aa44b3 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -93,18 +93,18 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'bank_code' => false, - 'iban' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'clearing_number' => false, - 'sort_code' => false, - 'routing_number' => false + 'bsb_code' => false, + 'type' => false, + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'bank_code' => false, + 'iban' => false, + 'additional_bank_identification' => false, + 'bic' => false, + 'clearing_number' => false, + 'sort_code' => false, + 'routing_number' => false ]; /** @@ -812,7 +812,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php index 0ed0914b1..dbc1b317a 100644 --- a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php @@ -70,7 +70,7 @@ class BrandVariantsRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BulkAddress.php b/src/Adyen/Model/BalancePlatform/BulkAddress.php index 8b4f1e145..21cb09b88 100644 --- a/src/Adyen/Model/BalancePlatform/BulkAddress.php +++ b/src/Adyen/Model/BalancePlatform/BulkAddress.php @@ -84,14 +84,14 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'company' => false, - 'country' => false, - 'email' => false, - 'house_number_or_name' => false, - 'mobile' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'company' => false, + 'country' => false, + 'email' => false, + 'house_number_or_name' => false, + 'mobile' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -644,7 +644,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php index 5c2782f99..cabb2a927 100644 --- a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php @@ -76,10 +76,10 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'type' => false + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'type' => false ]; /** @@ -581,7 +581,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php index 7d5d1191e..7796cd397 100644 --- a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php @@ -72,8 +72,8 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bank_code' => false, - 'type' => false + 'bank_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php index e10e5b036..a0f59f249 100644 --- a/src/Adyen/Model/BalancePlatform/Card.php +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -90,17 +90,17 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'bin' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'cvc' => false, - 'delivery_contact' => false, - 'expiration' => false, - 'form_factor' => false, - 'last_four' => false, - 'number' => false + 'bin' => false, + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'cvc' => false, + 'delivery_contact' => false, + 'expiration' => false, + 'form_factor' => false, + 'last_four' => false, + 'number' => false ]; /** @@ -793,7 +793,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php index 0aa41d2fe..407696741 100644 --- a/src/Adyen/Model/BalancePlatform/CardConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -94,19 +94,19 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'activation' => false, - 'activation_url' => false, - 'bulk_address' => false, - 'card_image_id' => false, - 'carrier' => false, - 'carrier_image_id' => false, - 'configuration_profile_id' => false, - 'currency' => false, - 'envelope' => false, - 'insert' => false, - 'language' => false, - 'logo_image_id' => false, - 'pin_mailer' => false, - 'shipment_method' => false + 'activation_url' => false, + 'bulk_address' => false, + 'card_image_id' => false, + 'carrier' => false, + 'carrier_image_id' => false, + 'configuration_profile_id' => false, + 'currency' => false, + 'envelope' => false, + 'insert' => false, + 'language' => false, + 'logo_image_id' => false, + 'pin_mailer' => false, + 'shipment_method' => false ]; /** @@ -814,7 +814,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardInfo.php b/src/Adyen/Model/BalancePlatform/CardInfo.php index b881f5538..fbb7e9f66 100644 --- a/src/Adyen/Model/BalancePlatform/CardInfo.php +++ b/src/Adyen/Model/BalancePlatform/CardInfo.php @@ -80,12 +80,12 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'delivery_contact' => false, - 'form_factor' => false + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'delivery_contact' => false, + 'form_factor' => false ]; /** @@ -620,7 +620,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ContactDetails.php b/src/Adyen/Model/BalancePlatform/ContactDetails.php index aca2ef30a..ce4cb4855 100644 --- a/src/Adyen/Model/BalancePlatform/ContactDetails.php +++ b/src/Adyen/Model/BalancePlatform/ContactDetails.php @@ -74,9 +74,9 @@ class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'phone' => false, - 'web_address' => false + 'email' => false, + 'phone' => false, + 'web_address' => false ]; /** @@ -480,7 +480,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php index b89a73de4..49e127b4c 100644 --- a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php @@ -70,7 +70,7 @@ class CountriesRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php index 041e73359..0b2ab8a56 100644 --- a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php @@ -70,7 +70,7 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -445,7 +445,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php index 3b398fe34..13e248b8e 100644 --- a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php @@ -70,7 +70,7 @@ class DayOfWeekRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -439,7 +439,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php index b4cb4408b..d1b5f5ec8 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryContact.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -78,11 +78,11 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'full_phone_number' => false, - 'name' => false, - 'phone_number' => false, - 'web_address' => false + 'email' => false, + 'full_phone_number' => false, + 'name' => false, + 'phone_number' => false, + 'web_address' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php index c39ce4d26..d99db659e 100644 --- a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php @@ -70,7 +70,7 @@ class DifferentCurrenciesRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Duration.php b/src/Adyen/Model/BalancePlatform/Duration.php index 1e48335fc..9f5ffa4db 100644 --- a/src/Adyen/Model/BalancePlatform/Duration.php +++ b/src/Adyen/Model/BalancePlatform/Duration.php @@ -70,7 +70,7 @@ class Duration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'unit' => false, - 'value' => true + 'value' => true ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php index 0dba149d2..4a062c74d 100644 --- a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php @@ -70,7 +70,7 @@ class EntryModesRestriction implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -443,7 +443,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Expiry.php b/src/Adyen/Model/BalancePlatform/Expiry.php index 010325c11..a713dfba3 100644 --- a/src/Adyen/Model/BalancePlatform/Expiry.php +++ b/src/Adyen/Model/BalancePlatform/Expiry.php @@ -70,7 +70,7 @@ class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'month' => false, - 'year' => false + 'year' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php index 6df91ad46..8ef664195 100644 --- a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php @@ -70,7 +70,7 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php index 74dfea5fd..efd00176f 100644 --- a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -70,7 +70,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php index 1c7857b81..9b73c033d 100644 --- a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php +++ b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php @@ -70,7 +70,7 @@ class InternationalTransactionRestriction implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InvalidField.php b/src/Adyen/Model/BalancePlatform/InvalidField.php index 63539a42c..79fd00ec0 100644 --- a/src/Adyen/Model/BalancePlatform/InvalidField.php +++ b/src/Adyen/Model/BalancePlatform/InvalidField.php @@ -72,8 +72,8 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'message' => false, - 'name' => false, - 'value' => false + 'name' => false, + 'value' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONObject.php b/src/Adyen/Model/BalancePlatform/JSONObject.php index 90e72f965..e78daea48 100644 --- a/src/Adyen/Model/BalancePlatform/JSONObject.php +++ b/src/Adyen/Model/BalancePlatform/JSONObject.php @@ -70,7 +70,7 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'paths' => false, - 'root_path' => false + 'root_path' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONPath.php b/src/Adyen/Model/BalancePlatform/JSONPath.php index 7b8ade787..f577e9910 100644 --- a/src/Adyen/Model/BalancePlatform/JSONPath.php +++ b/src/Adyen/Model/BalancePlatform/JSONPath.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php index dd4e16b74..288965ca1 100644 --- a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php @@ -70,7 +70,7 @@ class MatchingTransactionsRestriction implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MccsRestriction.php b/src/Adyen/Model/BalancePlatform/MccsRestriction.php index d4b8fcce5..c37bd3438 100644 --- a/src/Adyen/Model/BalancePlatform/MccsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MccsRestriction.php @@ -70,7 +70,7 @@ class MccsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php index 43e34628f..02704cadf 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php +++ b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php @@ -70,7 +70,7 @@ class MerchantAcquirerPair implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'acquirer_id' => false, - 'merchant_id' => false + 'merchant_id' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php index fc9c8aacf..3cbf61ec0 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php @@ -70,7 +70,7 @@ class MerchantNamesRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php index f4a93f892..071a8eb6f 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php @@ -70,7 +70,7 @@ class MerchantsRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php index 6627a5429..57db6da40 100644 --- a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php @@ -70,7 +70,7 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Name.php b/src/Adyen/Model/BalancePlatform/Name.php index d8b5dcb22..bab3c4994 100644 --- a/src/Adyen/Model/BalancePlatform/Name.php +++ b/src/Adyen/Model/BalancePlatform/Name.php @@ -70,7 +70,7 @@ class Name implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'first_name' => false, - 'last_name' => false + 'last_name' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php index 36c5319f8..0c35925fd 100644 --- a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php @@ -74,9 +74,9 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'account_number' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'type' => false + 'additional_bank_identification' => false, + 'bic' => false, + 'type' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index 52fd467a0..c50681a56 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -84,7 +84,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -120,9 +120,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -245,8 +243,9 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); diff --git a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php index c975a81ae..f461856c9 100644 --- a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php @@ -70,7 +70,7 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php index 6497854c7..db123042f 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php @@ -72,8 +72,8 @@ class PaginatedAccountHoldersResponse implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'account_holders' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php index 89b95a24c..d6e4f5f24 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php @@ -72,8 +72,8 @@ class PaginatedBalanceAccountsResponse implements ModelInterface, ArrayAccess, \ */ protected static $openAPINullables = [ 'balance_accounts' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php index 6c98b3f16..53fa5c833 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php @@ -72,8 +72,8 @@ class PaginatedPaymentInstrumentsResponse implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'payment_instruments' => false + 'has_previous' => false, + 'payment_instruments' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index 2ea57ca8d..6e300bb5b 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -88,16 +88,16 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -836,7 +836,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php index 3a6aa97f5..3a941f5dd 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php @@ -77,10 +77,10 @@ class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false, - 'account_number' => false, - 'account_type' => false, - 'routing_number' => false + 'type' => false, + 'account_number' => false, + 'account_type' => false, + 'routing_number' => false ]; /** @@ -519,7 +519,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php index 7b5e0f815..a19088ee9 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php @@ -78,11 +78,11 @@ class PaymentInstrumentGroup implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'id' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'id' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php index ff6c2c140..39e4fd53b 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php @@ -76,10 +76,10 @@ class PaymentInstrumentGroupInfo implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php index 7463a423f..558664dd3 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -84,14 +84,14 @@ class PaymentInstrumentInfo implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'description' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'card' => false, + 'description' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -765,7 +765,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php index 2a5d0dd25..9c83b8108 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php @@ -72,8 +72,8 @@ class PaymentInstrumentRevealInfo implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'cvc' => false, - 'expiration' => false, - 'pan' => false + 'expiration' => false, + 'pan' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php index bba8047ef..70861a974 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php @@ -76,10 +76,10 @@ class PaymentInstrumentUpdateRequest implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false + 'card' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false ]; /** @@ -587,7 +587,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Phone.php b/src/Adyen/Model/BalancePlatform/Phone.php index 97fd7691f..1677aa9b2 100644 --- a/src/Adyen/Model/BalancePlatform/Phone.php +++ b/src/Adyen/Model/BalancePlatform/Phone.php @@ -70,7 +70,7 @@ class Phone implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'number' => false, - 'type' => false + 'type' => false ]; /** @@ -442,7 +442,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PhoneNumber.php b/src/Adyen/Model/BalancePlatform/PhoneNumber.php index d59dcabbe..49ee0c287 100644 --- a/src/Adyen/Model/BalancePlatform/PhoneNumber.php +++ b/src/Adyen/Model/BalancePlatform/PhoneNumber.php @@ -72,8 +72,8 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'phone_country_code' => false, - 'phone_number' => false, - 'phone_type' => false + 'phone_number' => false, + 'phone_type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php index a34e33a75..22aec905d 100644 --- a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php @@ -70,7 +70,7 @@ class ProcessingTypesRestriction implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -441,7 +441,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/RestServiceError.php b/src/Adyen/Model/BalancePlatform/RestServiceError.php index b74ba67fc..3de3284ba 100644 --- a/src/Adyen/Model/BalancePlatform/RestServiceError.php +++ b/src/Adyen/Model/BalancePlatform/RestServiceError.php @@ -84,14 +84,14 @@ class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'detail' => false, - 'error_code' => false, - 'instance' => false, - 'invalid_fields' => false, - 'request_id' => false, - 'response' => false, - 'status' => true, - 'title' => false, - 'type' => false + 'error_code' => false, + 'instance' => false, + 'invalid_fields' => false, + 'request_id' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false ]; /** @@ -654,7 +654,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php index d8ddb1b0f..30f219400 100644 --- a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php @@ -72,8 +72,8 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'clearing_number' => false, - 'type' => false + 'clearing_number' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php index 064dddc73..8322532bd 100644 --- a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php @@ -72,8 +72,8 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bic' => false, - 'type' => false + 'bic' => false, + 'type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/StringMatch.php b/src/Adyen/Model/BalancePlatform/StringMatch.php index f66cb0a6b..5e93be9ae 100644 --- a/src/Adyen/Model/BalancePlatform/StringMatch.php +++ b/src/Adyen/Model/BalancePlatform/StringMatch.php @@ -70,7 +70,7 @@ class StringMatch implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index 2860aee88..f89d8b96e 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -92,18 +92,18 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'category' => false, - 'counterparty' => false, - 'currency' => false, - 'description' => false, - 'id' => false, - 'priorities' => false, - 'reason' => false, - 'schedule' => false, - 'status' => false, - 'sweep_amount' => false, - 'target_amount' => false, - 'trigger_amount' => false, - 'type' => false + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweep_amount' => false, + 'target_amount' => false, + 'trigger_amount' => false, + 'type' => false ]; /** @@ -978,7 +978,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php index c5d5eb540..c07e6bb44 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php @@ -71,7 +71,7 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -407,7 +407,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php index ad023501f..b465f0ba0 100644 --- a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -72,8 +72,8 @@ class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'merchant_account' => false, - 'transfer_instrument_id' => false + 'merchant_account' => false, + 'transfer_instrument_id' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php index defab0d3e..0df075c54 100644 --- a/src/Adyen/Model/BalancePlatform/SweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -408,7 +408,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDay.php b/src/Adyen/Model/BalancePlatform/TimeOfDay.php index 2e6c0a36f..1d8549b72 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDay.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDay.php @@ -70,7 +70,7 @@ class TimeOfDay implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'end_time' => false, - 'start_time' => false + 'start_time' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php index 574fdb717..4ac8fed5e 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php @@ -70,7 +70,7 @@ class TimeOfDayRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php index b2d7aee4f..e579b2d2a 100644 --- a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php @@ -70,7 +70,7 @@ class TotalAmountRestriction implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 87b4b0631..d9a58ef5b 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -94,19 +94,19 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'id' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'id' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -965,7 +965,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php index 430fbc0f2..70421f031 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php @@ -70,7 +70,7 @@ class TransactionRuleEntityKey implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'entity_reference' => false, - 'entity_type' => false + 'entity_type' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 154e09a23..17c32c708 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -92,18 +92,18 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -931,7 +931,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php index d43f7cd2e..24e81f3c5 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php @@ -78,11 +78,11 @@ class TransactionRuleInterval implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'day_of_month' => true, - 'day_of_week' => false, - 'duration' => false, - 'time_of_day' => false, - 'time_zone' => false, - 'type' => false + 'day_of_week' => false, + 'duration' => false, + 'time_of_day' => false, + 'time_zone' => false, + 'type' => false ]; /** @@ -626,7 +626,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php index d55dfd575..3d761e342 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php index 0e7b2b440..bee041525 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -94,19 +94,19 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'active_network_tokens' => false, - 'brand_variants' => false, - 'countries' => false, - 'day_of_week' => false, - 'different_currencies' => false, - 'entry_modes' => false, - 'international_transaction' => false, - 'matching_transactions' => false, - 'mccs' => false, - 'merchant_names' => false, - 'merchants' => false, - 'processing_types' => false, - 'time_of_day' => false, - 'total_amount' => false + 'brand_variants' => false, + 'countries' => false, + 'day_of_week' => false, + 'different_currencies' => false, + 'entry_modes' => false, + 'international_transaction' => false, + 'matching_transactions' => false, + 'mccs' => false, + 'merchant_names' => false, + 'merchants' => false, + 'processing_types' => false, + 'time_of_day' => false, + 'total_amount' => false ]; /** @@ -811,7 +811,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php index 384a8d754..56ad310c9 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php index 34158d198..d27f1bb31 100644 --- a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php @@ -72,8 +72,8 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'sort_code' => false, - 'type' => false + 'sort_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php index 19a5b9daf..25f4f8e9d 100644 --- a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php @@ -74,9 +74,9 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'routing_number' => false, - 'type' => false + 'account_type' => false, + 'routing_number' => false, + 'type' => false ]; /** @@ -544,7 +544,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index 77ca4531d..d66b4e70d 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -90,17 +90,17 @@ class UpdatePaymentInstrument implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -870,7 +870,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php index e014944f5..0b3449107 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -70,7 +70,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'capabilities' => false, - 'expires_at' => false + 'expires_at' => false ]; /** @@ -528,7 +528,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php index d604f4e31..b769de08c 100644 --- a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php +++ b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get an account holder * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getAccountHolder(string $id, array $requestOptions = null): \Ady * Get all balance accounts of an account holder * * @param string $id - * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaginatedBalanceAccountsResponse * @throws AdyenException */ @@ -77,7 +77,7 @@ public function getAllBalanceAccountsOfAccountHolder(string $id, array $requestO * * @param string $id * @param \Adyen\Model\BalancePlatform\AccountHolder $accountHolder - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ @@ -92,7 +92,7 @@ public function updateAccountHolder(string $id, \Adyen\Model\BalancePlatform\Acc * Create an account holder * * @param \Adyen\Model\BalancePlatform\AccountHolderInfo $accountHolderInfo - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index e17db0889..2544ddf1b 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -47,21 +47,22 @@ public function __construct(Client $client) * * @param string $balanceAccountId * @param string $sweepId - * @param array|null $requestOptions ['idempotencyKey' => 'v'] - + * @param array|null $requestOptions ['idempotencyKey' => string] + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** * Get all sweeps for a balance account * * @param string $balanceAccountId - * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse * @throws AdyenException */ @@ -77,7 +78,7 @@ public function getAllSweepsForBalanceAccount(string $balanceAccountId, array $r * * @param string $balanceAccountId * @param string $sweepId - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ @@ -92,7 +93,7 @@ public function getSweep(string $balanceAccountId, string $sweepId, array $reque * Get a balance account * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -107,7 +108,7 @@ public function getBalanceAccount(string $id, array $requestOptions = null): \Ad * Get all payment instruments for a balance account * * @param string $id - * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaginatedPaymentInstrumentsResponse * @throws AdyenException */ @@ -124,7 +125,7 @@ public function getAllPaymentInstrumentsForBalanceAccount(string $id, array $req * @param string $balanceAccountId * @param string $sweepId * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ @@ -140,7 +141,7 @@ public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Mo * * @param string $id * @param \Adyen\Model\BalancePlatform\BalanceAccountUpdateRequest $balanceAccountUpdateRequest - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -155,7 +156,7 @@ public function updateBalanceAccount(string $id, \Adyen\Model\BalancePlatform\Ba * Create a balance account * * @param \Adyen\Model\BalancePlatform\BalanceAccountInfo $balanceAccountInfo - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -171,7 +172,7 @@ public function createBalanceAccount(\Adyen\Model\BalancePlatform\BalanceAccount * * @param string $balanceAccountId * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index f5bfac7ba..355d2aa4c 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -46,15 +46,14 @@ public function __construct(Client $client) * Validate a bank account * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return void * @throws AdyenException */ - public function validateBankAccountIdentification( - \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest - $bankAccountIdentificationValidationRequest, - array $requestOptions = null - ): void { + public function validateBankAccountIdentification + (\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest + $bankAccountIdentificationValidationRequest, array $requestOptions = null): void + { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); } diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php index 97c9af2b9..4be1263c7 100644 --- a/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a payment instrument group * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getPaymentInstrumentGroup(string $id, array $requestOptions = nu * Get all transaction rules for a payment instrument group * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse * @throws AdyenException */ @@ -76,7 +76,7 @@ public function getAllTransactionRulesForPaymentInstrumentGroup(string $id, arra * Create a payment instrument group * * @param \Adyen\Model\BalancePlatform\PaymentInstrumentGroupInfo $paymentInstrumentGroupInfo - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php index 6bbda0ca1..8ec1590a5 100644 --- a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a payment instrument * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaymentInstrument * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getPaymentInstrument(string $id, array $requestOptions = null): * Get the PAN of a payment instrument * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaymentInstrumentRevealInfo * @throws AdyenException */ @@ -76,7 +76,7 @@ public function getPanOfPaymentInstrument(string $id, array $requestOptions = nu * Get all transaction rules for a payment instrument * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse * @throws AdyenException */ @@ -92,7 +92,7 @@ public function getAllTransactionRulesForPaymentInstrument(string $id, array $re * * @param string $id * @param \Adyen\Model\BalancePlatform\PaymentInstrumentUpdateRequest $paymentInstrumentUpdateRequest - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\UpdatePaymentInstrument * @throws AdyenException */ @@ -107,7 +107,7 @@ public function updatePaymentInstrument(string $id, \Adyen\Model\BalancePlatform * Create a payment instrument * * @param \Adyen\Model\BalancePlatform\PaymentInstrumentInfo $paymentInstrumentInfo - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaymentInstrument * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/PlatformApi.php b/src/Adyen/Service/BalancePlatform/PlatformApi.php index a76a12f5f..e55033c56 100644 --- a/src/Adyen/Service/BalancePlatform/PlatformApi.php +++ b/src/Adyen/Service/BalancePlatform/PlatformApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a balance platform * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\BalancePlatform * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getBalancePlatform(string $id, array $requestOptions = null): \A * Get all account holders under a balance platform * * @param string $id - * @param array|null $requestOptions ['queryParams' => ['offset'=> 'v', 'limit'=> 'v'], 'idempotencyKey' => 'v'] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\PaginatedAccountHoldersResponse * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php index 0ba29b039..8082d9ee1 100644 --- a/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php +++ b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Delete a transaction rule * * @param string $transactionRuleId - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ @@ -61,7 +61,7 @@ public function deleteTransactionRule(string $transactionRuleId, array $requestO * Get a transaction rule * * @param string $transactionRuleId - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\TransactionRuleResponse * @throws AdyenException */ @@ -77,7 +77,7 @@ public function getTransactionRule(string $transactionRuleId, array $requestOpti * * @param string $transactionRuleId * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ @@ -92,7 +92,7 @@ public function updateTransactionRule(string $transactionRuleId, \Adyen\Model\Ba * Create a transaction rule * * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo - * @param array|null $requestOptions ['idempotencyKey' => 'v'] + * @param array|null $requestOptions ['idempotencyKey' => string] * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ diff --git a/templates/api.mustache b/templates/api.mustache index f097b9500..9a3c5a7b1 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -45,7 +45,7 @@ class {{classname}} extends Service {{#bodyParams}} * @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} {{/bodyParams}} - * @param array|null $requestOptions [{{#hasQueryParams}}'queryParams' => [{{#queryParams}}'{{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}'=> 'v'{{^-last}}, {{/-last}}{{/queryParams}}], {{/hasQueryParams}}'idempotencyKey' => 'v'] + * @param array|null $requestOptions [{{#hasQueryParams}}'queryParams' => [{{#queryParams}}'{{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}'=> {{{dataType}}}{{^-last}}, {{/-last}}{{/queryParams}}], {{/hasQueryParams}}'idempotencyKey' => string] {{#returnType}}* @return {{returnType}}{{/returnType}} * @throws AdyenException */ From 266d6739ba99f652c104e78180bfa8a36d94a3d9 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:24:39 +0200 Subject: [PATCH 09/33] fix codestyle --- .../AULocalAccountIdentification.php | 6 ++-- .../Model/BalancePlatform/AccountHolder.php | 22 +++++++-------- .../AccountHolderCapability.php | 20 ++++++------- .../BalancePlatform/AccountHolderInfo.php | 14 +++++----- .../AccountSupportingEntityCapability.php | 14 +++++----- .../ActiveNetworkTokensRestriction.php | 4 +-- .../AdditionalBankIdentification.php | 4 +-- src/Adyen/Model/BalancePlatform/Address.php | 12 ++++---- src/Adyen/Model/BalancePlatform/Address2.php | 14 +++++----- src/Adyen/Model/BalancePlatform/Amount.php | 4 +-- .../Model/BalancePlatform/Authentication.php | 6 ++-- src/Adyen/Model/BalancePlatform/Balance.php | 8 +++--- .../Model/BalancePlatform/BalanceAccount.php | 16 +++++------ .../BalancePlatform/BalanceAccountInfo.php | 10 +++---- .../BalanceAccountUpdateRequest.php | 12 ++++---- .../Model/BalancePlatform/BalancePlatform.php | 6 ++-- .../BalanceSweepConfigurationsResponse.php | 6 ++-- ...AccountIdentificationValidationRequest.php | 2 +- ...ValidationRequestAccountIdentification.php | 26 ++++++++--------- .../BrandVariantsRestriction.php | 4 +-- .../Model/BalancePlatform/BulkAddress.php | 18 ++++++------ .../CALocalAccountIdentification.php | 10 +++---- .../CZLocalAccountIdentification.php | 6 ++-- src/Adyen/Model/BalancePlatform/Card.php | 24 ++++++++-------- .../BalancePlatform/CardConfiguration.php | 28 +++++++++---------- src/Adyen/Model/BalancePlatform/CardInfo.php | 14 +++++----- .../Model/BalancePlatform/ContactDetails.php | 8 +++--- .../BalancePlatform/CountriesRestriction.php | 4 +-- .../BalancePlatform/CronSweepSchedule.php | 4 +-- .../BalancePlatform/DayOfWeekRestriction.php | 4 +-- .../Model/BalancePlatform/DeliveryContact.php | 12 ++++---- .../DifferentCurrenciesRestriction.php | 4 +-- src/Adyen/Model/BalancePlatform/Duration.php | 4 +-- .../BalancePlatform/EntryModesRestriction.php | 4 +-- src/Adyen/Model/BalancePlatform/Expiry.php | 4 +-- .../HULocalAccountIdentification.php | 4 +-- .../IbanAccountIdentification.php | 4 +-- .../InternationalTransactionRestriction.php | 4 +-- .../Model/BalancePlatform/InvalidField.php | 6 ++-- .../Model/BalancePlatform/JSONObject.php | 4 +-- src/Adyen/Model/BalancePlatform/JSONPath.php | 2 +- .../MatchingTransactionsRestriction.php | 4 +-- .../Model/BalancePlatform/MccsRestriction.php | 4 +-- .../BalancePlatform/MerchantAcquirerPair.php | 4 +-- .../MerchantNamesRestriction.php | 4 +-- .../BalancePlatform/MerchantsRestriction.php | 4 +-- .../NOLocalAccountIdentification.php | 4 +-- src/Adyen/Model/BalancePlatform/Name.php | 4 +-- .../NumberAndBicAccountIdentification.php | 8 +++--- .../BalancePlatform/ObjectSerializer.php | 11 ++++---- .../PLLocalAccountIdentification.php | 4 +-- .../PaginatedAccountHoldersResponse.php | 6 ++-- .../PaginatedBalanceAccountsResponse.php | 6 ++-- .../PaginatedPaymentInstrumentsResponse.php | 6 ++-- .../BalancePlatform/PaymentInstrument.php | 22 +++++++-------- .../PaymentInstrumentBankAccount.php | 10 +++---- .../PaymentInstrumentGroup.php | 12 ++++---- .../PaymentInstrumentGroupInfo.php | 10 +++---- .../BalancePlatform/PaymentInstrumentInfo.php | 18 ++++++------ .../PaymentInstrumentRevealInfo.php | 6 ++-- .../PaymentInstrumentUpdateRequest.php | 10 +++---- src/Adyen/Model/BalancePlatform/Phone.php | 4 +-- .../Model/BalancePlatform/PhoneNumber.php | 6 ++-- .../ProcessingTypesRestriction.php | 4 +-- .../BalancePlatform/RestServiceError.php | 18 ++++++------ .../SELocalAccountIdentification.php | 6 ++-- .../SGLocalAccountIdentification.php | 6 ++-- .../Model/BalancePlatform/StringMatch.php | 4 +-- .../BalancePlatform/SweepConfigurationV2.php | 26 ++++++++--------- .../SweepConfigurationV2Schedule.php | 4 +-- .../BalancePlatform/SweepCounterparty.php | 6 ++-- .../Model/BalancePlatform/SweepSchedule.php | 2 +- src/Adyen/Model/BalancePlatform/TimeOfDay.php | 4 +-- .../BalancePlatform/TimeOfDayRestriction.php | 4 +-- .../TotalAmountRestriction.php | 4 +-- .../Model/BalancePlatform/TransactionRule.php | 28 +++++++++---------- .../TransactionRuleEntityKey.php | 4 +-- .../BalancePlatform/TransactionRuleInfo.php | 26 ++++++++--------- .../TransactionRuleInterval.php | 12 ++++---- .../TransactionRuleResponse.php | 2 +- .../TransactionRuleRestrictions.php | 28 +++++++++---------- .../TransactionRulesResponse.php | 2 +- .../UKLocalAccountIdentification.php | 6 ++-- .../USLocalAccountIdentification.php | 8 +++--- .../UpdatePaymentInstrument.php | 24 ++++++++-------- .../BalancePlatform/VerificationDeadline.php | 4 +-- .../BalancePlatform/BalanceAccountsApi.php | 3 +- .../BankAccountValidationApi.php | 9 +++--- 88 files changed, 397 insertions(+), 396 deletions(-) diff --git a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php index 24d9ac505..a777a4d80 100644 --- a/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AULocalAccountIdentification.php @@ -72,8 +72,8 @@ class AULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false + 'bsb_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolder.php b/src/Adyen/Model/BalancePlatform/AccountHolder.php index 709dee5d1..14b41d64a 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolder.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolder.php @@ -88,16 +88,16 @@ class AccountHolder implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'id' => false, - 'legal_entity_id' => false, - 'primary_balance_account' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false, - 'verification_deadlines' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'id' => false, + 'legal_entity_id' => false, + 'primary_balance_account' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false, + 'verification_deadlines' => false ]; /** @@ -752,7 +752,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php index 3d71d1a50..e3ae79713 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderCapability.php @@ -86,15 +86,15 @@ class AccountHolderCapability implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'allowed_settings' => false, - 'enabled' => false, - 'problems' => false, - 'requested' => false, - 'requested_level' => false, - 'requested_settings' => false, - 'transfer_instruments' => false, - 'verification_status' => false + 'allowed_level' => false, + 'allowed_settings' => false, + 'enabled' => false, + 'problems' => false, + 'requested' => false, + 'requested_level' => false, + 'requested_settings' => false, + 'transfer_instruments' => false, + 'verification_status' => false ]; /** @@ -786,7 +786,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php index 193594ffa..7ce6a8547 100644 --- a/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php +++ b/src/Adyen/Model/BalancePlatform/AccountHolderInfo.php @@ -80,12 +80,12 @@ class AccountHolderInfo implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_platform' => false, - 'capabilities' => false, - 'contact_details' => false, - 'description' => false, - 'legal_entity_id' => false, - 'reference' => false, - 'time_zone' => false + 'capabilities' => false, + 'contact_details' => false, + 'description' => false, + 'legal_entity_id' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php index 48d14a6cc..f9dedc7a8 100644 --- a/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php +++ b/src/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.php @@ -80,12 +80,12 @@ class AccountSupportingEntityCapability implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'allowed' => false, - 'allowed_level' => false, - 'enabled' => false, - 'id' => false, - 'requested' => false, - 'requested_level' => false, - 'verification_status' => false + 'allowed_level' => false, + 'enabled' => false, + 'id' => false, + 'requested' => false, + 'requested_level' => false, + 'verification_status' => false ]; /** @@ -684,7 +684,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php index efa8cf26b..53fedef8d 100644 --- a/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.php @@ -70,7 +70,7 @@ class ActiveNetworkTokensRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php index 7ccc21434..f38ce5c88 100644 --- a/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php +++ b/src/Adyen/Model/BalancePlatform/AdditionalBankIdentification.php @@ -70,7 +70,7 @@ class AdditionalBankIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'code' => false, - 'type' => false + 'type' => false ]; /** @@ -436,7 +436,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address.php b/src/Adyen/Model/BalancePlatform/Address.php index 94ec71f14..0e6d16c24 100644 --- a/src/Adyen/Model/BalancePlatform/Address.php +++ b/src/Adyen/Model/BalancePlatform/Address.php @@ -78,11 +78,11 @@ class Address implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'house_number_or_name' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -554,7 +554,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Address2.php b/src/Adyen/Model/BalancePlatform/Address2.php index 7d6648f03..122f3756e 100644 --- a/src/Adyen/Model/BalancePlatform/Address2.php +++ b/src/Adyen/Model/BalancePlatform/Address2.php @@ -80,12 +80,12 @@ class Address2 implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'country' => false, - 'line1' => false, - 'line2' => false, - 'line3' => false, - 'postal_code' => false, - 'state_or_province' => false + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php index 5bf62d874..e0161429c 100644 --- a/src/Adyen/Model/BalancePlatform/Amount.php +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -70,7 +70,7 @@ class Amount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'currency' => false, - 'value' => false + 'value' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Authentication.php b/src/Adyen/Model/BalancePlatform/Authentication.php index 5c7fdbb4f..a62b4e681 100644 --- a/src/Adyen/Model/BalancePlatform/Authentication.php +++ b/src/Adyen/Model/BalancePlatform/Authentication.php @@ -72,8 +72,8 @@ class Authentication implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'email' => false, - 'password' => false, - 'phone' => false + 'password' => false, + 'phone' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Balance.php b/src/Adyen/Model/BalancePlatform/Balance.php index 8ad88e526..52852c3fe 100644 --- a/src/Adyen/Model/BalancePlatform/Balance.php +++ b/src/Adyen/Model/BalancePlatform/Balance.php @@ -74,9 +74,9 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'available' => false, - 'balance' => false, - 'currency' => false, - 'reserved' => false + 'balance' => false, + 'currency' => false, + 'reserved' => false ]; /** @@ -483,7 +483,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccount.php b/src/Adyen/Model/BalancePlatform/BalanceAccount.php index 537594491..80117eb2e 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccount.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccount.php @@ -82,13 +82,13 @@ class BalanceAccount implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'balances' => false, - 'default_currency_code' => false, - 'description' => false, - 'id' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'balances' => false, + 'default_currency_code' => false, + 'description' => false, + 'id' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -650,7 +650,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php index 5692fa378..b15f90c8b 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountInfo.php @@ -76,10 +76,10 @@ class BalanceAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'time_zone' => false ]; /** @@ -508,7 +508,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php index 03c75d32d..6f82a2ea3 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.php @@ -78,11 +78,11 @@ class BalanceAccountUpdateRequest implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'account_holder_id' => false, - 'default_currency_code' => false, - 'description' => false, - 'reference' => false, - 'status' => false, - 'time_zone' => false + 'default_currency_code' => false, + 'description' => false, + 'reference' => false, + 'status' => false, + 'time_zone' => false ]; /** @@ -576,7 +576,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatform.php b/src/Adyen/Model/BalancePlatform/BalancePlatform.php index fe53ad778..4dcf14f06 100644 --- a/src/Adyen/Model/BalancePlatform/BalancePlatform.php +++ b/src/Adyen/Model/BalancePlatform/BalancePlatform.php @@ -72,8 +72,8 @@ class BalancePlatform implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'description' => false, - 'id' => false, - 'status' => false + 'id' => false, + 'status' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php index ee1614c42..2849548bf 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php +++ b/src/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.php @@ -72,8 +72,8 @@ class BalanceSweepConfigurationsResponse implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'sweeps' => false + 'has_previous' => false, + 'sweeps' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php index 53542da7c..b545b6948 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.php @@ -372,7 +372,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index 319aa44b3..a866b671c 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -93,18 +93,18 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements */ protected static $openAPINullables = [ 'account_number' => false, - 'bsb_code' => false, - 'type' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'bank_code' => false, - 'iban' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'clearing_number' => false, - 'sort_code' => false, - 'routing_number' => false + 'bsb_code' => false, + 'type' => false, + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'bank_code' => false, + 'iban' => false, + 'additional_bank_identification' => false, + 'bic' => false, + 'clearing_number' => false, + 'sort_code' => false, + 'routing_number' => false ]; /** @@ -812,7 +812,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php index dbc1b317a..0ed0914b1 100644 --- a/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/BrandVariantsRestriction.php @@ -70,7 +70,7 @@ class BrandVariantsRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/BulkAddress.php b/src/Adyen/Model/BalancePlatform/BulkAddress.php index 21cb09b88..8b4f1e145 100644 --- a/src/Adyen/Model/BalancePlatform/BulkAddress.php +++ b/src/Adyen/Model/BalancePlatform/BulkAddress.php @@ -84,14 +84,14 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'city' => false, - 'company' => false, - 'country' => false, - 'email' => false, - 'house_number_or_name' => false, - 'mobile' => false, - 'postal_code' => false, - 'state_or_province' => false, - 'street' => false + 'company' => false, + 'country' => false, + 'email' => false, + 'house_number_or_name' => false, + 'mobile' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false ]; /** @@ -644,7 +644,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php index cabb2a927..5c2782f99 100644 --- a/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CALocalAccountIdentification.php @@ -76,10 +76,10 @@ class CALocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'institution_number' => false, - 'transit_number' => false, - 'type' => false + 'account_type' => false, + 'institution_number' => false, + 'transit_number' => false, + 'type' => false ]; /** @@ -581,7 +581,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php index 7796cd397..7d5d1191e 100644 --- a/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.php @@ -72,8 +72,8 @@ class CZLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bank_code' => false, - 'type' => false + 'bank_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php index a0f59f249..e10e5b036 100644 --- a/src/Adyen/Model/BalancePlatform/Card.php +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -90,17 +90,17 @@ class Card implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'bin' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'cvc' => false, - 'delivery_contact' => false, - 'expiration' => false, - 'form_factor' => false, - 'last_four' => false, - 'number' => false + 'bin' => false, + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'cvc' => false, + 'delivery_contact' => false, + 'expiration' => false, + 'form_factor' => false, + 'last_four' => false, + 'number' => false ]; /** @@ -793,7 +793,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php index 407696741..0aa41d2fe 100644 --- a/src/Adyen/Model/BalancePlatform/CardConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -94,19 +94,19 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'activation' => false, - 'activation_url' => false, - 'bulk_address' => false, - 'card_image_id' => false, - 'carrier' => false, - 'carrier_image_id' => false, - 'configuration_profile_id' => false, - 'currency' => false, - 'envelope' => false, - 'insert' => false, - 'language' => false, - 'logo_image_id' => false, - 'pin_mailer' => false, - 'shipment_method' => false + 'activation_url' => false, + 'bulk_address' => false, + 'card_image_id' => false, + 'carrier' => false, + 'carrier_image_id' => false, + 'configuration_profile_id' => false, + 'currency' => false, + 'envelope' => false, + 'insert' => false, + 'language' => false, + 'logo_image_id' => false, + 'pin_mailer' => false, + 'shipment_method' => false ]; /** @@ -814,7 +814,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CardInfo.php b/src/Adyen/Model/BalancePlatform/CardInfo.php index fbb7e9f66..b881f5538 100644 --- a/src/Adyen/Model/BalancePlatform/CardInfo.php +++ b/src/Adyen/Model/BalancePlatform/CardInfo.php @@ -80,12 +80,12 @@ class CardInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'authentication' => false, - 'brand' => false, - 'brand_variant' => false, - 'cardholder_name' => false, - 'configuration' => false, - 'delivery_contact' => false, - 'form_factor' => false + 'brand' => false, + 'brand_variant' => false, + 'cardholder_name' => false, + 'configuration' => false, + 'delivery_contact' => false, + 'form_factor' => false ]; /** @@ -620,7 +620,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ContactDetails.php b/src/Adyen/Model/BalancePlatform/ContactDetails.php index ce4cb4855..aca2ef30a 100644 --- a/src/Adyen/Model/BalancePlatform/ContactDetails.php +++ b/src/Adyen/Model/BalancePlatform/ContactDetails.php @@ -74,9 +74,9 @@ class ContactDetails implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'phone' => false, - 'web_address' => false + 'email' => false, + 'phone' => false, + 'web_address' => false ]; /** @@ -480,7 +480,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php index 49e127b4c..b89a73de4 100644 --- a/src/Adyen/Model/BalancePlatform/CountriesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/CountriesRestriction.php @@ -70,7 +70,7 @@ class CountriesRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php index 0b2ab8a56..041e73359 100644 --- a/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/CronSweepSchedule.php @@ -70,7 +70,7 @@ class CronSweepSchedule implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -445,7 +445,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php index 13e248b8e..3b398fe34 100644 --- a/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DayOfWeekRestriction.php @@ -70,7 +70,7 @@ class DayOfWeekRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -439,7 +439,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DeliveryContact.php b/src/Adyen/Model/BalancePlatform/DeliveryContact.php index d1b5f5ec8..b4cb4408b 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryContact.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryContact.php @@ -78,11 +78,11 @@ class DeliveryContact implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'address' => false, - 'email' => false, - 'full_phone_number' => false, - 'name' => false, - 'phone_number' => false, - 'web_address' => false + 'email' => false, + 'full_phone_number' => false, + 'name' => false, + 'phone_number' => false, + 'web_address' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php index d99db659e..c39ce4d26 100644 --- a/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.php @@ -70,7 +70,7 @@ class DifferentCurrenciesRestriction implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Duration.php b/src/Adyen/Model/BalancePlatform/Duration.php index 9f5ffa4db..1e48335fc 100644 --- a/src/Adyen/Model/BalancePlatform/Duration.php +++ b/src/Adyen/Model/BalancePlatform/Duration.php @@ -70,7 +70,7 @@ class Duration implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'unit' => false, - 'value' => true + 'value' => true ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php index 4a062c74d..0dba149d2 100644 --- a/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/EntryModesRestriction.php @@ -70,7 +70,7 @@ class EntryModesRestriction implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -443,7 +443,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Expiry.php b/src/Adyen/Model/BalancePlatform/Expiry.php index a713dfba3..010325c11 100644 --- a/src/Adyen/Model/BalancePlatform/Expiry.php +++ b/src/Adyen/Model/BalancePlatform/Expiry.php @@ -70,7 +70,7 @@ class Expiry implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'month' => false, - 'year' => false + 'year' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php index 8ef664195..6df91ad46 100644 --- a/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HULocalAccountIdentification.php @@ -70,7 +70,7 @@ class HULocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php index efd00176f..74dfea5fd 100644 --- a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -70,7 +70,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php index 9b73c033d..1c7857b81 100644 --- a/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php +++ b/src/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.php @@ -70,7 +70,7 @@ class InternationalTransactionRestriction implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/InvalidField.php b/src/Adyen/Model/BalancePlatform/InvalidField.php index 79fd00ec0..63539a42c 100644 --- a/src/Adyen/Model/BalancePlatform/InvalidField.php +++ b/src/Adyen/Model/BalancePlatform/InvalidField.php @@ -72,8 +72,8 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'message' => false, - 'name' => false, - 'value' => false + 'name' => false, + 'value' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONObject.php b/src/Adyen/Model/BalancePlatform/JSONObject.php index e78daea48..90e72f965 100644 --- a/src/Adyen/Model/BalancePlatform/JSONObject.php +++ b/src/Adyen/Model/BalancePlatform/JSONObject.php @@ -70,7 +70,7 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'paths' => false, - 'root_path' => false + 'root_path' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/JSONPath.php b/src/Adyen/Model/BalancePlatform/JSONPath.php index f577e9910..7b8ade787 100644 --- a/src/Adyen/Model/BalancePlatform/JSONPath.php +++ b/src/Adyen/Model/BalancePlatform/JSONPath.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php index 288965ca1..dd4e16b74 100644 --- a/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.php @@ -70,7 +70,7 @@ class MatchingTransactionsRestriction implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'operation' => false, - 'value' => true + 'value' => true ]; /** @@ -404,7 +404,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MccsRestriction.php b/src/Adyen/Model/BalancePlatform/MccsRestriction.php index c37bd3438..d4b8fcce5 100644 --- a/src/Adyen/Model/BalancePlatform/MccsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MccsRestriction.php @@ -70,7 +70,7 @@ class MccsRestriction implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php index 02704cadf..43e34628f 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php +++ b/src/Adyen/Model/BalancePlatform/MerchantAcquirerPair.php @@ -70,7 +70,7 @@ class MerchantAcquirerPair implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'acquirer_id' => false, - 'merchant_id' => false + 'merchant_id' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php index 3cbf61ec0..fc9c8aacf 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantNamesRestriction.php @@ -70,7 +70,7 @@ class MerchantNamesRestriction implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php index 071a8eb6f..f4a93f892 100644 --- a/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php +++ b/src/Adyen/Model/BalancePlatform/MerchantsRestriction.php @@ -70,7 +70,7 @@ class MerchantsRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php index 57db6da40..6627a5429 100644 --- a/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.php @@ -70,7 +70,7 @@ class NOLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Name.php b/src/Adyen/Model/BalancePlatform/Name.php index bab3c4994..d8b5dcb22 100644 --- a/src/Adyen/Model/BalancePlatform/Name.php +++ b/src/Adyen/Model/BalancePlatform/Name.php @@ -70,7 +70,7 @@ class Name implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'first_name' => false, - 'last_name' => false + 'last_name' => false ]; /** @@ -409,7 +409,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php index 0c35925fd..36c5319f8 100644 --- a/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.php @@ -74,9 +74,9 @@ class NumberAndBicAccountIdentification implements ModelInterface, ArrayAccess, */ protected static $openAPINullables = [ 'account_number' => false, - 'additional_bank_identification' => false, - 'bic' => false, - 'type' => false + 'additional_bank_identification' => false, + 'bic' => false, + 'type' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index c50681a56..52fd467a0 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -84,7 +84,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -120,7 +120,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } @@ -243,9 +245,8 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); diff --git a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php index f461856c9..c975a81ae 100644 --- a/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.php @@ -70,7 +70,7 @@ class PLLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'type' => false + 'type' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php index db123042f..6497854c7 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.php @@ -72,8 +72,8 @@ class PaginatedAccountHoldersResponse implements ModelInterface, ArrayAccess, \J */ protected static $openAPINullables = [ 'account_holders' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php index d6e4f5f24..89b95a24c 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.php @@ -72,8 +72,8 @@ class PaginatedBalanceAccountsResponse implements ModelInterface, ArrayAccess, \ */ protected static $openAPINullables = [ 'balance_accounts' => false, - 'has_next' => false, - 'has_previous' => false + 'has_next' => false, + 'has_previous' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php index 53fa5c833..6c98b3f16 100644 --- a/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php +++ b/src/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.php @@ -72,8 +72,8 @@ class PaginatedPaymentInstrumentsResponse implements ModelInterface, ArrayAccess */ protected static $openAPINullables = [ 'has_next' => false, - 'has_previous' => false, - 'payment_instruments' => false + 'has_previous' => false, + 'payment_instruments' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php index 6e300bb5b..2ea57ca8d 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrument.php @@ -88,16 +88,16 @@ class PaymentInstrument implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -836,7 +836,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php index 3a941f5dd..3a6aa97f5 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentBankAccount.php @@ -77,10 +77,10 @@ class PaymentInstrumentBankAccount implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'iban' => false, - 'type' => false, - 'account_number' => false, - 'account_type' => false, - 'routing_number' => false + 'type' => false, + 'account_number' => false, + 'account_type' => false, + 'routing_number' => false ]; /** @@ -519,7 +519,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php index a19088ee9..7b5e0f815 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.php @@ -78,11 +78,11 @@ class PaymentInstrumentGroup implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'id' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'id' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -545,7 +545,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php index 39e4fd53b..ff6c2c140 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.php @@ -76,10 +76,10 @@ class PaymentInstrumentGroupInfo implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'balance_platform' => false, - 'description' => false, - 'properties' => false, - 'reference' => false, - 'tx_variant' => false + 'description' => false, + 'properties' => false, + 'reference' => false, + 'tx_variant' => false ]; /** @@ -511,7 +511,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php index 558664dd3..7463a423f 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.php @@ -84,14 +84,14 @@ class PaymentInstrumentInfo implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'description' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_reason' => false, - 'type' => false + 'card' => false, + 'description' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -765,7 +765,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php index 9c83b8108..2a5d0dd25 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.php @@ -72,8 +72,8 @@ class PaymentInstrumentRevealInfo implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'cvc' => false, - 'expiration' => false, - 'pan' => false + 'expiration' => false, + 'pan' => false ]; /** @@ -446,7 +446,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php index 70861a974..bba8047ef 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.php @@ -76,10 +76,10 @@ class PaymentInstrumentUpdateRequest implements ModelInterface, ArrayAccess, \Js */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'card' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false + 'card' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false ]; /** @@ -587,7 +587,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/Phone.php b/src/Adyen/Model/BalancePlatform/Phone.php index 1677aa9b2..97fd7691f 100644 --- a/src/Adyen/Model/BalancePlatform/Phone.php +++ b/src/Adyen/Model/BalancePlatform/Phone.php @@ -70,7 +70,7 @@ class Phone implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'number' => false, - 'type' => false + 'type' => false ]; /** @@ -442,7 +442,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/PhoneNumber.php b/src/Adyen/Model/BalancePlatform/PhoneNumber.php index 49ee0c287..d59dcabbe 100644 --- a/src/Adyen/Model/BalancePlatform/PhoneNumber.php +++ b/src/Adyen/Model/BalancePlatform/PhoneNumber.php @@ -72,8 +72,8 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'phone_country_code' => false, - 'phone_number' => false, - 'phone_type' => false + 'phone_number' => false, + 'phone_type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php index 22aec905d..a34e33a75 100644 --- a/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php +++ b/src/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.php @@ -70,7 +70,7 @@ class ProcessingTypesRestriction implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -441,7 +441,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/RestServiceError.php b/src/Adyen/Model/BalancePlatform/RestServiceError.php index 3de3284ba..b74ba67fc 100644 --- a/src/Adyen/Model/BalancePlatform/RestServiceError.php +++ b/src/Adyen/Model/BalancePlatform/RestServiceError.php @@ -84,14 +84,14 @@ class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'detail' => false, - 'error_code' => false, - 'instance' => false, - 'invalid_fields' => false, - 'request_id' => false, - 'response' => false, - 'status' => true, - 'title' => false, - 'type' => false + 'error_code' => false, + 'instance' => false, + 'invalid_fields' => false, + 'request_id' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false ]; /** @@ -654,7 +654,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php index 30f219400..d8ddb1b0f 100644 --- a/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SELocalAccountIdentification.php @@ -72,8 +72,8 @@ class SELocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'clearing_number' => false, - 'type' => false + 'clearing_number' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php index 8322532bd..064dddc73 100644 --- a/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.php @@ -72,8 +72,8 @@ class SGLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'bic' => false, - 'type' => false + 'bic' => false, + 'type' => false ]; /** @@ -474,7 +474,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/StringMatch.php b/src/Adyen/Model/BalancePlatform/StringMatch.php index 5e93be9ae..f66cb0a6b 100644 --- a/src/Adyen/Model/BalancePlatform/StringMatch.php +++ b/src/Adyen/Model/BalancePlatform/StringMatch.php @@ -70,7 +70,7 @@ class StringMatch implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -440,7 +440,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index f89d8b96e..2860aee88 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -92,18 +92,18 @@ class SweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'category' => false, - 'counterparty' => false, - 'currency' => false, - 'description' => false, - 'id' => false, - 'priorities' => false, - 'reason' => false, - 'schedule' => false, - 'status' => false, - 'sweep_amount' => false, - 'target_amount' => false, - 'trigger_amount' => false, - 'type' => false + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'id' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweep_amount' => false, + 'target_amount' => false, + 'trigger_amount' => false, + 'type' => false ]; /** @@ -978,7 +978,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php index c07e6bb44..c5d5eb540 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2Schedule.php @@ -71,7 +71,7 @@ class SweepConfigurationV2Schedule implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'cron_expression' => false, - 'type' => false + 'type' => false ]; /** @@ -407,7 +407,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php index b465f0ba0..ad023501f 100644 --- a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -72,8 +72,8 @@ class SweepCounterparty implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'merchant_account' => false, - 'transfer_instrument_id' => false + 'merchant_account' => false, + 'transfer_instrument_id' => false ]; /** @@ -437,7 +437,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/SweepSchedule.php b/src/Adyen/Model/BalancePlatform/SweepSchedule.php index 0df075c54..defab0d3e 100644 --- a/src/Adyen/Model/BalancePlatform/SweepSchedule.php +++ b/src/Adyen/Model/BalancePlatform/SweepSchedule.php @@ -408,7 +408,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDay.php b/src/Adyen/Model/BalancePlatform/TimeOfDay.php index 1d8549b72..2e6c0a36f 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDay.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDay.php @@ -70,7 +70,7 @@ class TimeOfDay implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'end_time' => false, - 'start_time' => false + 'start_time' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php index 4ac8fed5e..574fdb717 100644 --- a/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TimeOfDayRestriction.php @@ -70,7 +70,7 @@ class TimeOfDayRestriction implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php index e579b2d2a..b2d7aee4f 100644 --- a/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php +++ b/src/Adyen/Model/BalancePlatform/TotalAmountRestriction.php @@ -70,7 +70,7 @@ class TotalAmountRestriction implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPINullables = [ 'operation' => false, - 'value' => false + 'value' => false ]; /** @@ -406,7 +406,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index d9a58ef5b..87b4b0631 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -94,19 +94,19 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'id' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'id' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -965,7 +965,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php index 70421f031..430fbc0f2 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.php @@ -70,7 +70,7 @@ class TransactionRuleEntityKey implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPINullables = [ 'entity_reference' => false, - 'entity_type' => false + 'entity_type' => false ]; /** @@ -403,7 +403,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 17c32c708..154e09a23 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -92,18 +92,18 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPINullables = [ 'aggregation_level' => false, - 'description' => false, - 'end_date' => false, - 'entity_key' => false, - 'interval' => false, - 'outcome_type' => false, - 'reference' => false, - 'request_type' => false, - 'rule_restrictions' => false, - 'score' => true, - 'start_date' => false, - 'status' => false, - 'type' => false + 'description' => false, + 'end_date' => false, + 'entity_key' => false, + 'interval' => false, + 'outcome_type' => false, + 'reference' => false, + 'request_type' => false, + 'rule_restrictions' => false, + 'score' => true, + 'start_date' => false, + 'status' => false, + 'type' => false ]; /** @@ -931,7 +931,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php index 24e81f3c5..d43f7cd2e 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInterval.php @@ -78,11 +78,11 @@ class TransactionRuleInterval implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'day_of_month' => true, - 'day_of_week' => false, - 'duration' => false, - 'time_of_day' => false, - 'time_zone' => false, - 'type' => false + 'day_of_week' => false, + 'duration' => false, + 'time_of_day' => false, + 'time_zone' => false, + 'type' => false ]; /** @@ -626,7 +626,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php index 3d761e342..d55dfd575 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php index bee041525..0e7b2b440 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.php @@ -94,19 +94,19 @@ class TransactionRuleRestrictions implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPINullables = [ 'active_network_tokens' => false, - 'brand_variants' => false, - 'countries' => false, - 'day_of_week' => false, - 'different_currencies' => false, - 'entry_modes' => false, - 'international_transaction' => false, - 'matching_transactions' => false, - 'mccs' => false, - 'merchant_names' => false, - 'merchants' => false, - 'processing_types' => false, - 'time_of_day' => false, - 'total_amount' => false + 'brand_variants' => false, + 'countries' => false, + 'day_of_week' => false, + 'different_currencies' => false, + 'entry_modes' => false, + 'international_transaction' => false, + 'matching_transactions' => false, + 'mccs' => false, + 'merchant_names' => false, + 'merchants' => false, + 'processing_types' => false, + 'time_of_day' => false, + 'total_amount' => false ]; /** @@ -811,7 +811,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php index 56ad310c9..384a8d754 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRulesResponse.php @@ -369,7 +369,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php index d27f1bb31..34158d198 100644 --- a/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.php @@ -72,8 +72,8 @@ class UKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'sort_code' => false, - 'type' => false + 'sort_code' => false, + 'type' => false ]; /** @@ -477,7 +477,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php index 25f4f8e9d..19a5b9daf 100644 --- a/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/USLocalAccountIdentification.php @@ -74,9 +74,9 @@ class USLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'account_number' => false, - 'account_type' => false, - 'routing_number' => false, - 'type' => false + 'account_type' => false, + 'routing_number' => false, + 'type' => false ]; /** @@ -544,7 +544,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php index d66b4e70d..77ca4531d 100644 --- a/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php +++ b/src/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.php @@ -90,17 +90,17 @@ class UpdatePaymentInstrument implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPINullables = [ 'balance_account_id' => false, - 'bank_account' => false, - 'card' => false, - 'description' => false, - 'id' => false, - 'issuing_country_code' => false, - 'payment_instrument_group_id' => false, - 'reference' => false, - 'status' => false, - 'status_comment' => false, - 'status_reason' => false, - 'type' => false + 'bank_account' => false, + 'card' => false, + 'description' => false, + 'id' => false, + 'issuing_country_code' => false, + 'payment_instrument_group_id' => false, + 'reference' => false, + 'status' => false, + 'status_comment' => false, + 'status_reason' => false, + 'type' => false ]; /** @@ -870,7 +870,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php index 0b3449107..e014944f5 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationDeadline.php +++ b/src/Adyen/Model/BalancePlatform/VerificationDeadline.php @@ -70,7 +70,7 @@ class VerificationDeadline implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPINullables = [ 'capabilities' => false, - 'expires_at' => false + 'expires_at' => false ]; /** @@ -528,7 +528,7 @@ public function offsetUnset($offset): void #[\ReturnTypeWillChange] public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 2544ddf1b..e9c5578b5 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -48,14 +48,13 @@ public function __construct(Client $client) * @param string $balanceAccountId * @param string $sweepId * @param array|null $requestOptions ['idempotencyKey' => string] - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index 355d2aa4c..ebb6d9c37 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -50,10 +50,11 @@ public function __construct(Client $client) * @return void * @throws AdyenException */ - public function validateBankAccountIdentification - (\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest - $bankAccountIdentificationValidationRequest, array $requestOptions = null): void - { + public function validateBankAccountIdentification( + \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest + $bankAccountIdentificationValidationRequest, + array $requestOptions = null + ): void { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); } From fd1fda1d8dc6b87c50069bebe1d9c8a26f69c3fe Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 3 Apr 2023 17:05:33 +0200 Subject: [PATCH 10/33] remove idempotency part from requestOptions annotation --- .../BalancePlatform/AccountHoldersApi.php | 8 ++++---- .../BalancePlatform/BalanceAccountsApi.php | 18 +++++++++--------- .../BankAccountValidationApi.php | 4 ++-- .../PaymentInstrumentGroupsApi.php | 6 +++--- .../BalancePlatform/PaymentInstrumentsApi.php | 10 +++++----- .../Service/BalancePlatform/PlatformApi.php | 4 ++-- .../BalancePlatform/TransactionRulesApi.php | 8 ++++---- templates/api-single.mustache | 9 +++++++-- templates/api.mustache | 2 +- 9 files changed, 37 insertions(+), 32 deletions(-) diff --git a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php index b769de08c..944d99fa5 100644 --- a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php +++ b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get an account holder * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getAccountHolder(string $id, array $requestOptions = null): \Ady * Get all balance accounts of an account holder * * @param string $id - * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int]] * @return \Adyen\Model\BalancePlatform\PaginatedBalanceAccountsResponse * @throws AdyenException */ @@ -77,7 +77,7 @@ public function getAllBalanceAccountsOfAccountHolder(string $id, array $requestO * * @param string $id * @param \Adyen\Model\BalancePlatform\AccountHolder $accountHolder - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ @@ -92,7 +92,7 @@ public function updateAccountHolder(string $id, \Adyen\Model\BalancePlatform\Acc * Create an account holder * * @param \Adyen\Model\BalancePlatform\AccountHolderInfo $accountHolderInfo - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\AccountHolder * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index e9c5578b5..d3c1c1ceb 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -47,7 +47,7 @@ public function __construct(Client $client) * * @param string $balanceAccountId * @param string $sweepId - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @throws AdyenException */ @@ -61,7 +61,7 @@ public function deleteSweep(string $balanceAccountId, string $sweepId, array $re * Get all sweeps for a balance account * * @param string $balanceAccountId - * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int]] * @return \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse * @throws AdyenException */ @@ -77,7 +77,7 @@ public function getAllSweepsForBalanceAccount(string $balanceAccountId, array $r * * @param string $balanceAccountId * @param string $sweepId - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ @@ -92,7 +92,7 @@ public function getSweep(string $balanceAccountId, string $sweepId, array $reque * Get a balance account * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -107,7 +107,7 @@ public function getBalanceAccount(string $id, array $requestOptions = null): \Ad * Get all payment instruments for a balance account * * @param string $id - * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int]] * @return \Adyen\Model\BalancePlatform\PaginatedPaymentInstrumentsResponse * @throws AdyenException */ @@ -124,7 +124,7 @@ public function getAllPaymentInstrumentsForBalanceAccount(string $id, array $req * @param string $balanceAccountId * @param string $sweepId * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ @@ -140,7 +140,7 @@ public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Mo * * @param string $id * @param \Adyen\Model\BalancePlatform\BalanceAccountUpdateRequest $balanceAccountUpdateRequest - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -155,7 +155,7 @@ public function updateBalanceAccount(string $id, \Adyen\Model\BalancePlatform\Ba * Create a balance account * * @param \Adyen\Model\BalancePlatform\BalanceAccountInfo $balanceAccountInfo - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\BalanceAccount * @throws AdyenException */ @@ -171,7 +171,7 @@ public function createBalanceAccount(\Adyen\Model\BalancePlatform\BalanceAccount * * @param string $balanceAccountId * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index ebb6d9c37..5ba953be7 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -46,8 +46,8 @@ public function __construct(Client $client) * Validate a bank account * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest - * @param array|null $requestOptions ['idempotencyKey' => string] - * @return void + * @param array|null $requestOptions + * @return object * @throws AdyenException */ public function validateBankAccountIdentification( diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php index 4be1263c7..aa338e950 100644 --- a/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a payment instrument group * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getPaymentInstrumentGroup(string $id, array $requestOptions = nu * Get all transaction rules for a payment instrument group * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse * @throws AdyenException */ @@ -76,7 +76,7 @@ public function getAllTransactionRulesForPaymentInstrumentGroup(string $id, arra * Create a payment instrument group * * @param \Adyen\Model\BalancePlatform\PaymentInstrumentGroupInfo $paymentInstrumentGroupInfo - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\PaymentInstrumentGroup * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php index 8ec1590a5..3901e7db3 100644 --- a/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php +++ b/src/Adyen/Service/BalancePlatform/PaymentInstrumentsApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a payment instrument * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\PaymentInstrument * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getPaymentInstrument(string $id, array $requestOptions = null): * Get the PAN of a payment instrument * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\PaymentInstrumentRevealInfo * @throws AdyenException */ @@ -76,7 +76,7 @@ public function getPanOfPaymentInstrument(string $id, array $requestOptions = nu * Get all transaction rules for a payment instrument * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\TransactionRulesResponse * @throws AdyenException */ @@ -92,7 +92,7 @@ public function getAllTransactionRulesForPaymentInstrument(string $id, array $re * * @param string $id * @param \Adyen\Model\BalancePlatform\PaymentInstrumentUpdateRequest $paymentInstrumentUpdateRequest - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\UpdatePaymentInstrument * @throws AdyenException */ @@ -107,7 +107,7 @@ public function updatePaymentInstrument(string $id, \Adyen\Model\BalancePlatform * Create a payment instrument * * @param \Adyen\Model\BalancePlatform\PaymentInstrumentInfo $paymentInstrumentInfo - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\PaymentInstrument * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/PlatformApi.php b/src/Adyen/Service/BalancePlatform/PlatformApi.php index e55033c56..8ea9b6426 100644 --- a/src/Adyen/Service/BalancePlatform/PlatformApi.php +++ b/src/Adyen/Service/BalancePlatform/PlatformApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Get a balance platform * * @param string $id - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\BalancePlatform * @throws AdyenException */ @@ -61,7 +61,7 @@ public function getBalancePlatform(string $id, array $requestOptions = null): \A * Get all account holders under a balance platform * * @param string $id - * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int], 'idempotencyKey' => string] + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int]] * @return \Adyen\Model\BalancePlatform\PaginatedAccountHoldersResponse * @throws AdyenException */ diff --git a/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php index 8082d9ee1..61034b680 100644 --- a/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php +++ b/src/Adyen/Service/BalancePlatform/TransactionRulesApi.php @@ -46,7 +46,7 @@ public function __construct(Client $client) * Delete a transaction rule * * @param string $transactionRuleId - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ @@ -61,7 +61,7 @@ public function deleteTransactionRule(string $transactionRuleId, array $requestO * Get a transaction rule * * @param string $transactionRuleId - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\TransactionRuleResponse * @throws AdyenException */ @@ -77,7 +77,7 @@ public function getTransactionRule(string $transactionRuleId, array $requestOpti * * @param string $transactionRuleId * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ @@ -92,7 +92,7 @@ public function updateTransactionRule(string $transactionRuleId, \Adyen\Model\Ba * Create a transaction rule * * @param \Adyen\Model\BalancePlatform\TransactionRuleInfo $transactionRuleInfo - * @param array|null $requestOptions ['idempotencyKey' => string] + * @param array|null $requestOptions * @return \Adyen\Model\BalancePlatform\TransactionRule * @throws AdyenException */ diff --git a/templates/api-single.mustache b/templates/api-single.mustache index 2aa4252ef..fb194a89e 100644 --- a/templates/api-single.mustache +++ b/templates/api-single.mustache @@ -38,8 +38,13 @@ class {{customApi}}Api extends Service * Description: {{.}} * {{/description}} - {{#allParams}}* @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} - {{/allParams}}* @param array $requestOptions + {{#pathParams}} + * @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} + {{/pathParams}} + {{#bodyParams}} + * @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} + {{/bodyParams}} + * @param array|null $requestOptions{{#hasQueryParams}} ['queryParams' => [{{#queryParams}}'{{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}'=> {{{dataType}}}{{^-last}}, {{/-last}}{{/queryParams}}]]{{/hasQueryParams}} {{#returnType}}* @return {{returnType}}{{/returnType}} * @throws AdyenException */ diff --git a/templates/api.mustache b/templates/api.mustache index 9a3c5a7b1..f5585b3d5 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -45,7 +45,7 @@ class {{classname}} extends Service {{#bodyParams}} * @param {{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}} {{/bodyParams}} - * @param array|null $requestOptions [{{#hasQueryParams}}'queryParams' => [{{#queryParams}}'{{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}'=> {{{dataType}}}{{^-last}}, {{/-last}}{{/queryParams}}], {{/hasQueryParams}}'idempotencyKey' => string] + * @param array|null $requestOptions{{#hasQueryParams}} ['queryParams' => [{{#queryParams}}'{{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}'=> {{{dataType}}}{{^-last}}, {{/-last}}{{/queryParams}}]]{{/hasQueryParams}} {{#returnType}}* @return {{returnType}}{{/returnType}} * @throws AdyenException */ From ade23cc53d88573334725ebb673ba1cdc453f1b0 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Tue, 4 Apr 2023 09:40:36 +0200 Subject: [PATCH 11/33] Generated Checkout and added unit tests (also some template fixes for oneOf) (#463) --- .github/workflows/main.yml | 2 +- Makefile | 3 + sonar-project.properties | 3 +- src/Adyen/Model/Checkout/AccountInfo.php | 1223 ++++++++ src/Adyen/Model/Checkout/AcctInfo.php | 1154 +++++++ src/Adyen/Model/Checkout/AchDetails.php | 695 ++++ .../Model/Checkout/AdditionalData3DSecure.php | 600 ++++ .../Model/Checkout/AdditionalDataAirline.php | 1308 ++++++++ .../Checkout/AdditionalDataCarRental.php | 1135 +++++++ .../Model/Checkout/AdditionalDataCommon.php | 930 ++++++ .../Model/Checkout/AdditionalDataLevel23.php | 931 ++++++ .../Model/Checkout/AdditionalDataLodging.php | 931 ++++++ .../Checkout/AdditionalDataOpenInvoice.php | 965 ++++++ .../Model/Checkout/AdditionalDataOpi.php | 387 +++ .../Model/Checkout/AdditionalDataRatepay.php | 625 ++++ .../Model/Checkout/AdditionalDataRetry.php | 455 +++ .../Model/Checkout/AdditionalDataRisk.php | 1067 +++++++ .../Checkout/AdditionalDataRiskStandalone.php | 863 +++++ .../Checkout/AdditionalDataSubMerchant.php | 693 ++++ .../AdditionalDataTemporaryServices.php | 659 ++++ .../Model/Checkout/AdditionalDataWallets.php | 557 ++++ src/Adyen/Model/Checkout/Address.php | 572 ++++ src/Adyen/Model/Checkout/AfterpayDetails.php | 631 ++++ src/Adyen/Model/Checkout/AmazonPayDetails.php | 486 +++ src/Adyen/Model/Checkout/Amount.php | 427 +++ .../Model/Checkout/AndroidPayDetails.php | 452 +++ src/Adyen/Model/Checkout/ApplePayDetails.php | 624 ++++ .../Checkout/ApplePaySessionResponse.php | 390 +++ src/Adyen/Model/Checkout/ApplicationInfo.php | 557 ++++ .../Model/Checkout/AuthenticationData.php | 488 +++ src/Adyen/Model/Checkout/Avs.php | 456 +++ .../Model/Checkout/BacsDirectDebitDetails.php | 624 ++++ src/Adyen/Model/Checkout/BankAccount.php | 659 ++++ src/Adyen/Model/Checkout/BillDeskDetails.php | 498 +++ src/Adyen/Model/Checkout/BlikDetails.php | 556 ++++ src/Adyen/Model/Checkout/BrowserInfo.php | 675 ++++ src/Adyen/Model/Checkout/Card.php | 631 ++++ src/Adyen/Model/Checkout/CardBrandDetails.php | 421 +++ src/Adyen/Model/Checkout/CardDetails.php | 1073 +++++++ .../Model/Checkout/CardDetailsRequest.php | 529 ++++ .../Model/Checkout/CardDetailsResponse.php | 387 +++ src/Adyen/Model/Checkout/CellulantDetails.php | 486 +++ .../Model/Checkout/CheckoutAwaitAction.php | 523 ++++ .../Checkout/CheckoutBalanceCheckRequest.php | 1925 ++++++++++++ .../Checkout/CheckoutBalanceCheckResponse.php | 632 ++++ .../Checkout/CheckoutCancelOrderRequest.php | 427 +++ .../Checkout/CheckoutCancelOrderResponse.php | 458 +++ .../Checkout/CheckoutCreateOrderRequest.php | 498 +++ .../Checkout/CheckoutCreateOrderResponse.php | 739 +++++ .../Checkout/CheckoutNativeRedirectAction.php | 591 ++++ src/Adyen/Model/Checkout/CheckoutOrder.php | 427 +++ .../Model/Checkout/CheckoutOrderResponse.php | 560 ++++ .../Model/Checkout/CheckoutPaymentMethod.php | 2037 ++++++++++++ .../Model/Checkout/CheckoutQrCodeAction.php | 591 ++++ .../Model/Checkout/CheckoutRedirectAction.php | 557 ++++ .../Model/Checkout/CheckoutSDKAction.php | 559 ++++ .../CheckoutSessionInstallmentOption.php | 476 +++ .../Model/Checkout/CheckoutThreeDS2Action.php | 625 ++++ .../Model/Checkout/CheckoutUtilityRequest.php | 390 +++ .../Checkout/CheckoutUtilityResponse.php | 387 +++ .../Model/Checkout/CheckoutVoucherAction.php | 1067 +++++++ src/Adyen/Model/Checkout/CommonField.php | 421 +++ src/Adyen/Model/Checkout/Company.php | 557 ++++ src/Adyen/Model/Checkout/Configuration.php | 524 ++++ .../Checkout/CreateApplePaySessionRequest.php | 464 +++ .../Checkout/CreateCheckoutSessionRequest.php | 2341 ++++++++++++++ .../CreateCheckoutSessionResponse.php | 2482 +++++++++++++++ .../CreatePaymentAmountUpdateRequest.php | 564 ++++ .../Checkout/CreatePaymentCancelRequest.php | 424 +++ .../Checkout/CreatePaymentCaptureRequest.php | 529 ++++ .../Checkout/CreatePaymentLinkRequest.php | 1717 ++++++++++ .../Checkout/CreatePaymentRefundRequest.php | 602 ++++ .../Checkout/CreatePaymentReversalRequest.php | 424 +++ .../CreateStandalonePaymentCancelRequest.php | 461 +++ src/Adyen/Model/Checkout/DetailsRequest.php | 494 +++ .../DetailsRequestAuthenticationData.php | 387 +++ .../Model/Checkout/DeviceRenderOptions.php | 485 +++ src/Adyen/Model/Checkout/DokuDetails.php | 582 ++++ src/Adyen/Model/Checkout/DonationResponse.php | 626 ++++ src/Adyen/Model/Checkout/DotpayDetails.php | 489 +++ src/Adyen/Model/Checkout/DragonpayDetails.php | 532 ++++ .../Model/Checkout/EcontextVoucherDetails.php | 605 ++++ src/Adyen/Model/Checkout/ExternalPlatform.php | 455 +++ src/Adyen/Model/Checkout/ForexQuote.php | 765 +++++ src/Adyen/Model/Checkout/FraudCheckResult.php | 460 +++ src/Adyen/Model/Checkout/FraudResult.php | 422 +++ src/Adyen/Model/Checkout/FundOrigin.php | 421 +++ src/Adyen/Model/Checkout/FundRecipient.php | 693 ++++ .../GenericIssuerPaymentMethodDetails.php | 568 ++++ src/Adyen/Model/Checkout/GiropayDetails.php | 522 +++ src/Adyen/Model/Checkout/GooglePayDetails.php | 624 ++++ src/Adyen/Model/Checkout/IdealDetails.php | 559 ++++ src/Adyen/Model/Checkout/InputDetail.php | 661 ++++ .../Model/Checkout/InstallmentOption.php | 508 +++ src/Adyen/Model/Checkout/Installments.php | 455 +++ .../Model/Checkout/InstallmentsNumber.php | 388 +++ src/Adyen/Model/Checkout/Item.php | 421 +++ src/Adyen/Model/Checkout/KlarnaDetails.php | 639 ++++ src/Adyen/Model/Checkout/LineItem.php | 931 ++++++ .../ListStoredPaymentMethodsResponse.php | 455 +++ src/Adyen/Model/Checkout/Mandate.php | 747 +++++ .../Model/Checkout/MasterpassDetails.php | 554 ++++ src/Adyen/Model/Checkout/MbwayDetails.php | 526 ++++ src/Adyen/Model/Checkout/MerchantDevice.php | 455 +++ .../Model/Checkout/MerchantRiskIndicator.php | 909 ++++++ src/Adyen/Model/Checkout/MobilePayDetails.php | 452 +++ src/Adyen/Model/Checkout/ModelInterface.php | 95 + src/Adyen/Model/Checkout/MolPayDetails.php | 494 +++ src/Adyen/Model/Checkout/Name.php | 427 +++ src/Adyen/Model/Checkout/ObjectSerializer.php | 320 ++ .../Model/Checkout/OpenInvoiceDetails.php | 628 ++++ src/Adyen/Model/Checkout/PayPalDetails.php | 660 ++++ src/Adyen/Model/Checkout/PayUUpiDetails.php | 593 ++++ .../Model/Checkout/PayWithGoogleDetails.php | 624 ++++ .../Checkout/PaymentAmountUpdateResource.php | 709 +++++ .../Model/Checkout/PaymentCancelResource.php | 566 ++++ .../Model/Checkout/PaymentCaptureResource.php | 671 ++++ .../Checkout/PaymentCompletionDetails.php | 931 ++++++ src/Adyen/Model/Checkout/PaymentDetails.php | 634 ++++ .../Model/Checkout/PaymentDetailsResponse.php | 918 ++++++ .../Model/Checkout/PaymentDonationRequest.php | 2788 +++++++++++++++++ .../Model/Checkout/PaymentLinkResponse.php | 1901 +++++++++++ src/Adyen/Model/Checkout/PaymentMethod.php | 692 ++++ .../Model/Checkout/PaymentMethodGroup.php | 455 +++ .../Model/Checkout/PaymentMethodIssuer.php | 461 +++ .../Model/Checkout/PaymentMethodsRequest.php | 799 +++++ .../Model/Checkout/PaymentMethodsResponse.php | 421 +++ .../Model/Checkout/PaymentRefundResource.php | 744 +++++ src/Adyen/Model/Checkout/PaymentRequest.php | 2683 ++++++++++++++++ src/Adyen/Model/Checkout/PaymentResponse.php | 918 ++++++ .../Model/Checkout/PaymentResponseAction.php | 1309 ++++++++ .../Checkout/PaymentReversalResource.php | 566 ++++ .../Model/Checkout/PaymentSetupRequest.php | 2341 ++++++++++++++ .../Model/Checkout/PaymentSetupResponse.php | 423 +++ .../Checkout/PaymentVerificationRequest.php | 390 +++ .../Checkout/PaymentVerificationResponse.php | 754 +++++ src/Adyen/Model/Checkout/Phone.php | 421 +++ .../Checkout/PlatformChargebackLogic.php | 456 +++ src/Adyen/Model/Checkout/RatepayDetails.php | 629 ++++ src/Adyen/Model/Checkout/Recurring.php | 591 ++++ src/Adyen/Model/Checkout/RecurringDetail.php | 760 +++++ .../ResponseAdditionalData3DSecure.php | 523 ++++ .../ResponseAdditionalDataBillingAddress.php | 557 ++++ .../Checkout/ResponseAdditionalDataCard.php | 625 ++++ .../Checkout/ResponseAdditionalDataCommon.php | 2427 ++++++++++++++ .../ResponseAdditionalDataInstallments.php | 761 +++++ .../ResponseAdditionalDataNetworkTokens.php | 455 +++ .../Checkout/ResponseAdditionalDataOpi.php | 387 +++ .../Checkout/ResponseAdditionalDataSepa.php | 455 +++ .../Model/Checkout/ResponsePaymentMethod.php | 421 +++ src/Adyen/Model/Checkout/RiskData.php | 487 +++ src/Adyen/Model/Checkout/SDKEphemPubKey.php | 489 +++ .../Model/Checkout/SamsungPayDetails.php | 624 ++++ .../Model/Checkout/SepaDirectDebitDetails.php | 598 ++++ src/Adyen/Model/Checkout/ServiceError.php | 555 ++++ src/Adyen/Model/Checkout/ServiceError2.php | 489 +++ src/Adyen/Model/Checkout/ShopperInput.php | 560 ++++ .../Checkout/ShopperInteractionDevice.php | 455 +++ src/Adyen/Model/Checkout/Split.php | 578 ++++ src/Adyen/Model/Checkout/SplitAmount.php | 424 +++ .../StandalonePaymentCancelResource.php | 566 ++++ src/Adyen/Model/Checkout/StoredDetails.php | 455 +++ .../Model/Checkout/StoredPaymentMethod.php | 829 +++++ .../Checkout/StoredPaymentMethodDetails.php | 552 ++++ .../Checkout/StoredPaymentMethodResource.php | 931 ++++++ src/Adyen/Model/Checkout/SubInputDetail.php | 557 ++++ src/Adyen/Model/Checkout/SubMerchant.php | 523 ++++ .../Model/Checkout/ThreeDS2RequestData.php | 1908 +++++++++++ .../Model/Checkout/ThreeDS2ResponseData.php | 999 ++++++ src/Adyen/Model/Checkout/ThreeDS2Result.php | 946 ++++++ .../Model/Checkout/ThreeDSRequestData.php | 625 ++++ .../ThreeDSRequestorAuthenticationInfo.php | 496 +++ ...hreeDSRequestorPriorAuthenticationInfo.php | 526 ++++ src/Adyen/Model/Checkout/ThreeDSecureData.php | 886 ++++++ .../Checkout/UpdatePaymentLinkRequest.php | 421 +++ .../Model/Checkout/UpiCollectDetails.php | 630 ++++ src/Adyen/Model/Checkout/UpiIntentDetails.php | 559 ++++ src/Adyen/Model/Checkout/VippsDetails.php | 559 ++++ .../Model/Checkout/VisaCheckoutDetails.php | 554 ++++ src/Adyen/Model/Checkout/WeChatPayDetails.php | 454 +++ .../Checkout/WeChatPayMiniProgramDetails.php | 520 +++ src/Adyen/Model/Checkout/ZipDetails.php | 558 ++++ .../Checkout/ClassicCheckoutSDKApi.php | 76 + .../Service/Checkout/ModificationsApi.php | 145 + src/Adyen/Service/Checkout/OrdersApi.php | 92 + .../Service/Checkout/PaymentLinksApi.php | 91 + src/Adyen/Service/Checkout/PaymentsApi.php | 140 + src/Adyen/Service/Checkout/RecurringApi.php | 77 + src/Adyen/Service/Checkout/UtilityApi.php | 76 + templates/model.mustache | 2 +- templates/model_generic.mustache | 9 +- .../cardDetails-success.json | 12 + .../deleteStoredPaymentMethods-success.json | 21 + .../ModelBasedCheckout/donations-success.json | 20 + .../getStoredPaymentMethods-success.json | 27 + .../invalid-merchant-account.json | 6 + .../payment-links-expired.json | 10 + .../payment-links-invalid.json | 6 + .../payment-links-success.json | 9 + .../payment-methods-forbidden.json | 7 + .../payment-methods-success.json | 278 ++ .../payment-session-success.json | 3 + .../ModelBasedCheckout/payments-action.json | 4 + .../payments-details-success.json | 8 + .../payments-forbidden.json | 7 + .../payments-result-success.json | 4 + .../payments-success-3D.json | 20 + .../ModelBasedCheckout/payments-success.json | 91 + .../ModelBasedCheckout/sessions-invalid.json | 6 + .../ModelBasedCheckout/sessions-success.json | 13 + tests/Unit/ModelBasedCheckoutTest.php | 395 +++ 211 files changed, 126923 insertions(+), 5 deletions(-) create mode 100644 src/Adyen/Model/Checkout/AccountInfo.php create mode 100644 src/Adyen/Model/Checkout/AcctInfo.php create mode 100644 src/Adyen/Model/Checkout/AchDetails.php create mode 100644 src/Adyen/Model/Checkout/AdditionalData3DSecure.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataAirline.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataCarRental.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataCommon.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataLevel23.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataLodging.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataOpi.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataRatepay.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataRetry.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataRisk.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php create mode 100644 src/Adyen/Model/Checkout/AdditionalDataWallets.php create mode 100644 src/Adyen/Model/Checkout/Address.php create mode 100644 src/Adyen/Model/Checkout/AfterpayDetails.php create mode 100644 src/Adyen/Model/Checkout/AmazonPayDetails.php create mode 100644 src/Adyen/Model/Checkout/Amount.php create mode 100644 src/Adyen/Model/Checkout/AndroidPayDetails.php create mode 100644 src/Adyen/Model/Checkout/ApplePayDetails.php create mode 100644 src/Adyen/Model/Checkout/ApplePaySessionResponse.php create mode 100644 src/Adyen/Model/Checkout/ApplicationInfo.php create mode 100644 src/Adyen/Model/Checkout/AuthenticationData.php create mode 100644 src/Adyen/Model/Checkout/Avs.php create mode 100644 src/Adyen/Model/Checkout/BacsDirectDebitDetails.php create mode 100644 src/Adyen/Model/Checkout/BankAccount.php create mode 100644 src/Adyen/Model/Checkout/BillDeskDetails.php create mode 100644 src/Adyen/Model/Checkout/BlikDetails.php create mode 100644 src/Adyen/Model/Checkout/BrowserInfo.php create mode 100644 src/Adyen/Model/Checkout/Card.php create mode 100644 src/Adyen/Model/Checkout/CardBrandDetails.php create mode 100644 src/Adyen/Model/Checkout/CardDetails.php create mode 100644 src/Adyen/Model/Checkout/CardDetailsRequest.php create mode 100644 src/Adyen/Model/Checkout/CardDetailsResponse.php create mode 100644 src/Adyen/Model/Checkout/CellulantDetails.php create mode 100644 src/Adyen/Model/Checkout/CheckoutAwaitAction.php create mode 100644 src/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.php create mode 100644 src/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.php create mode 100644 src/Adyen/Model/Checkout/CheckoutCancelOrderRequest.php create mode 100644 src/Adyen/Model/Checkout/CheckoutCancelOrderResponse.php create mode 100644 src/Adyen/Model/Checkout/CheckoutCreateOrderRequest.php create mode 100644 src/Adyen/Model/Checkout/CheckoutCreateOrderResponse.php create mode 100644 src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php create mode 100644 src/Adyen/Model/Checkout/CheckoutOrder.php create mode 100644 src/Adyen/Model/Checkout/CheckoutOrderResponse.php create mode 100644 src/Adyen/Model/Checkout/CheckoutPaymentMethod.php create mode 100644 src/Adyen/Model/Checkout/CheckoutQrCodeAction.php create mode 100644 src/Adyen/Model/Checkout/CheckoutRedirectAction.php create mode 100644 src/Adyen/Model/Checkout/CheckoutSDKAction.php create mode 100644 src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php create mode 100644 src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php create mode 100644 src/Adyen/Model/Checkout/CheckoutUtilityRequest.php create mode 100644 src/Adyen/Model/Checkout/CheckoutUtilityResponse.php create mode 100644 src/Adyen/Model/Checkout/CheckoutVoucherAction.php create mode 100644 src/Adyen/Model/Checkout/CommonField.php create mode 100644 src/Adyen/Model/Checkout/Company.php create mode 100644 src/Adyen/Model/Checkout/Configuration.php create mode 100644 src/Adyen/Model/Checkout/CreateApplePaySessionRequest.php create mode 100644 src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php create mode 100644 src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php create mode 100644 src/Adyen/Model/Checkout/CreatePaymentAmountUpdateRequest.php create mode 100644 src/Adyen/Model/Checkout/CreatePaymentCancelRequest.php create mode 100644 src/Adyen/Model/Checkout/CreatePaymentCaptureRequest.php create mode 100644 src/Adyen/Model/Checkout/CreatePaymentLinkRequest.php create mode 100644 src/Adyen/Model/Checkout/CreatePaymentRefundRequest.php create mode 100644 src/Adyen/Model/Checkout/CreatePaymentReversalRequest.php create mode 100644 src/Adyen/Model/Checkout/CreateStandalonePaymentCancelRequest.php create mode 100644 src/Adyen/Model/Checkout/DetailsRequest.php create mode 100644 src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php create mode 100644 src/Adyen/Model/Checkout/DeviceRenderOptions.php create mode 100644 src/Adyen/Model/Checkout/DokuDetails.php create mode 100644 src/Adyen/Model/Checkout/DonationResponse.php create mode 100644 src/Adyen/Model/Checkout/DotpayDetails.php create mode 100644 src/Adyen/Model/Checkout/DragonpayDetails.php create mode 100644 src/Adyen/Model/Checkout/EcontextVoucherDetails.php create mode 100644 src/Adyen/Model/Checkout/ExternalPlatform.php create mode 100644 src/Adyen/Model/Checkout/ForexQuote.php create mode 100644 src/Adyen/Model/Checkout/FraudCheckResult.php create mode 100644 src/Adyen/Model/Checkout/FraudResult.php create mode 100644 src/Adyen/Model/Checkout/FundOrigin.php create mode 100644 src/Adyen/Model/Checkout/FundRecipient.php create mode 100644 src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php create mode 100644 src/Adyen/Model/Checkout/GiropayDetails.php create mode 100644 src/Adyen/Model/Checkout/GooglePayDetails.php create mode 100644 src/Adyen/Model/Checkout/IdealDetails.php create mode 100644 src/Adyen/Model/Checkout/InputDetail.php create mode 100644 src/Adyen/Model/Checkout/InstallmentOption.php create mode 100644 src/Adyen/Model/Checkout/Installments.php create mode 100644 src/Adyen/Model/Checkout/InstallmentsNumber.php create mode 100644 src/Adyen/Model/Checkout/Item.php create mode 100644 src/Adyen/Model/Checkout/KlarnaDetails.php create mode 100644 src/Adyen/Model/Checkout/LineItem.php create mode 100644 src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php create mode 100644 src/Adyen/Model/Checkout/Mandate.php create mode 100644 src/Adyen/Model/Checkout/MasterpassDetails.php create mode 100644 src/Adyen/Model/Checkout/MbwayDetails.php create mode 100644 src/Adyen/Model/Checkout/MerchantDevice.php create mode 100644 src/Adyen/Model/Checkout/MerchantRiskIndicator.php create mode 100644 src/Adyen/Model/Checkout/MobilePayDetails.php create mode 100644 src/Adyen/Model/Checkout/ModelInterface.php create mode 100644 src/Adyen/Model/Checkout/MolPayDetails.php create mode 100644 src/Adyen/Model/Checkout/Name.php create mode 100644 src/Adyen/Model/Checkout/ObjectSerializer.php create mode 100644 src/Adyen/Model/Checkout/OpenInvoiceDetails.php create mode 100644 src/Adyen/Model/Checkout/PayPalDetails.php create mode 100644 src/Adyen/Model/Checkout/PayUUpiDetails.php create mode 100644 src/Adyen/Model/Checkout/PayWithGoogleDetails.php create mode 100644 src/Adyen/Model/Checkout/PaymentAmountUpdateResource.php create mode 100644 src/Adyen/Model/Checkout/PaymentCancelResource.php create mode 100644 src/Adyen/Model/Checkout/PaymentCaptureResource.php create mode 100644 src/Adyen/Model/Checkout/PaymentCompletionDetails.php create mode 100644 src/Adyen/Model/Checkout/PaymentDetails.php create mode 100644 src/Adyen/Model/Checkout/PaymentDetailsResponse.php create mode 100644 src/Adyen/Model/Checkout/PaymentDonationRequest.php create mode 100644 src/Adyen/Model/Checkout/PaymentLinkResponse.php create mode 100644 src/Adyen/Model/Checkout/PaymentMethod.php create mode 100644 src/Adyen/Model/Checkout/PaymentMethodGroup.php create mode 100644 src/Adyen/Model/Checkout/PaymentMethodIssuer.php create mode 100644 src/Adyen/Model/Checkout/PaymentMethodsRequest.php create mode 100644 src/Adyen/Model/Checkout/PaymentMethodsResponse.php create mode 100644 src/Adyen/Model/Checkout/PaymentRefundResource.php create mode 100644 src/Adyen/Model/Checkout/PaymentRequest.php create mode 100644 src/Adyen/Model/Checkout/PaymentResponse.php create mode 100644 src/Adyen/Model/Checkout/PaymentResponseAction.php create mode 100644 src/Adyen/Model/Checkout/PaymentReversalResource.php create mode 100644 src/Adyen/Model/Checkout/PaymentSetupRequest.php create mode 100644 src/Adyen/Model/Checkout/PaymentSetupResponse.php create mode 100644 src/Adyen/Model/Checkout/PaymentVerificationRequest.php create mode 100644 src/Adyen/Model/Checkout/PaymentVerificationResponse.php create mode 100644 src/Adyen/Model/Checkout/Phone.php create mode 100644 src/Adyen/Model/Checkout/PlatformChargebackLogic.php create mode 100644 src/Adyen/Model/Checkout/RatepayDetails.php create mode 100644 src/Adyen/Model/Checkout/Recurring.php create mode 100644 src/Adyen/Model/Checkout/RecurringDetail.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php create mode 100644 src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php create mode 100644 src/Adyen/Model/Checkout/ResponsePaymentMethod.php create mode 100644 src/Adyen/Model/Checkout/RiskData.php create mode 100644 src/Adyen/Model/Checkout/SDKEphemPubKey.php create mode 100644 src/Adyen/Model/Checkout/SamsungPayDetails.php create mode 100644 src/Adyen/Model/Checkout/SepaDirectDebitDetails.php create mode 100644 src/Adyen/Model/Checkout/ServiceError.php create mode 100644 src/Adyen/Model/Checkout/ServiceError2.php create mode 100644 src/Adyen/Model/Checkout/ShopperInput.php create mode 100644 src/Adyen/Model/Checkout/ShopperInteractionDevice.php create mode 100644 src/Adyen/Model/Checkout/Split.php create mode 100644 src/Adyen/Model/Checkout/SplitAmount.php create mode 100644 src/Adyen/Model/Checkout/StandalonePaymentCancelResource.php create mode 100644 src/Adyen/Model/Checkout/StoredDetails.php create mode 100644 src/Adyen/Model/Checkout/StoredPaymentMethod.php create mode 100644 src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php create mode 100644 src/Adyen/Model/Checkout/StoredPaymentMethodResource.php create mode 100644 src/Adyen/Model/Checkout/SubInputDetail.php create mode 100644 src/Adyen/Model/Checkout/SubMerchant.php create mode 100644 src/Adyen/Model/Checkout/ThreeDS2RequestData.php create mode 100644 src/Adyen/Model/Checkout/ThreeDS2ResponseData.php create mode 100644 src/Adyen/Model/Checkout/ThreeDS2Result.php create mode 100644 src/Adyen/Model/Checkout/ThreeDSRequestData.php create mode 100644 src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php create mode 100644 src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php create mode 100644 src/Adyen/Model/Checkout/ThreeDSecureData.php create mode 100644 src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php create mode 100644 src/Adyen/Model/Checkout/UpiCollectDetails.php create mode 100644 src/Adyen/Model/Checkout/UpiIntentDetails.php create mode 100644 src/Adyen/Model/Checkout/VippsDetails.php create mode 100644 src/Adyen/Model/Checkout/VisaCheckoutDetails.php create mode 100644 src/Adyen/Model/Checkout/WeChatPayDetails.php create mode 100644 src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php create mode 100644 src/Adyen/Model/Checkout/ZipDetails.php create mode 100644 src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php create mode 100644 src/Adyen/Service/Checkout/ModificationsApi.php create mode 100644 src/Adyen/Service/Checkout/OrdersApi.php create mode 100644 src/Adyen/Service/Checkout/PaymentLinksApi.php create mode 100644 src/Adyen/Service/Checkout/PaymentsApi.php create mode 100644 src/Adyen/Service/Checkout/RecurringApi.php create mode 100644 src/Adyen/Service/Checkout/UtilityApi.php create mode 100644 tests/Resources/ModelBasedCheckout/cardDetails-success.json create mode 100644 tests/Resources/ModelBasedCheckout/deleteStoredPaymentMethods-success.json create mode 100644 tests/Resources/ModelBasedCheckout/donations-success.json create mode 100644 tests/Resources/ModelBasedCheckout/getStoredPaymentMethods-success.json create mode 100644 tests/Resources/ModelBasedCheckout/invalid-merchant-account.json create mode 100644 tests/Resources/ModelBasedCheckout/payment-links-expired.json create mode 100644 tests/Resources/ModelBasedCheckout/payment-links-invalid.json create mode 100644 tests/Resources/ModelBasedCheckout/payment-links-success.json create mode 100644 tests/Resources/ModelBasedCheckout/payment-methods-forbidden.json create mode 100644 tests/Resources/ModelBasedCheckout/payment-methods-success.json create mode 100644 tests/Resources/ModelBasedCheckout/payment-session-success.json create mode 100644 tests/Resources/ModelBasedCheckout/payments-action.json create mode 100644 tests/Resources/ModelBasedCheckout/payments-details-success.json create mode 100644 tests/Resources/ModelBasedCheckout/payments-forbidden.json create mode 100644 tests/Resources/ModelBasedCheckout/payments-result-success.json create mode 100644 tests/Resources/ModelBasedCheckout/payments-success-3D.json create mode 100644 tests/Resources/ModelBasedCheckout/payments-success.json create mode 100644 tests/Resources/ModelBasedCheckout/sessions-invalid.json create mode 100644 tests/Resources/ModelBasedCheckout/sessions-success.json create mode 100644 tests/Unit/ModelBasedCheckoutTest.php diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed127554b..7b28e82c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: run: sed -i "s;`pwd`/;;g" build/*.xml - name: Run PHP Code Sniffer - run: vendor/bin/phpcs + run: vendor/bin/phpcs --exclude=Generic.Files.LineLength - name: Make sure project files are compilable run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l diff --git a/Makefile b/Makefile index b59df11dd..7271dca00 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ $(modelGen): target/spec $(openapi-generator-jar) -g $(generator) \ -o $(output) \ -t ./templates \ + --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ @@ -64,6 +65,7 @@ $(Services): target/spec $(openapi-generator-jar) -g $(generator) \ -o $(output) \ -t ./templates \ + --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ @@ -86,6 +88,7 @@ $(SingleFileServices): target/spec $(openapi-generator-jar) -c templates/config.yaml \ --model-package Model\\$@ \ --api-package Service\\$@ \ + --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ --reserved-words-mappings configuration=configuration \ --ignore-file-override ./.openapi-generator-ignore \ --skip-validate-spec \ diff --git a/sonar-project.properties b/sonar-project.properties index 881c18393..751f5ac4c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,4 +2,5 @@ sonar.organization=adyen sonar.projectKey=Adyen_adyen-php-api-library sonar.sources=. sonar.php.coverage.reportPaths=build/clover.xml -sonar.php.tests.reportPath=build/tests-log.xml \ No newline at end of file +sonar.php.tests.reportPath=build/tests-log.xml +sonar.exclusions=src/Adyen/Model/**, src/Adyen/Service/Checkout/** \ No newline at end of file diff --git a/src/Adyen/Model/Checkout/AccountInfo.php b/src/Adyen/Model/Checkout/AccountInfo.php new file mode 100644 index 000000000..e72194cfb --- /dev/null +++ b/src/Adyen/Model/Checkout/AccountInfo.php @@ -0,0 +1,1223 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AccountInfo Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_age_indicator' => 'string', + 'account_change_date' => '\DateTime', + 'account_change_indicator' => 'string', + 'account_creation_date' => '\DateTime', + 'account_type' => 'string', + 'add_card_attempts_day' => 'int', + 'delivery_address_usage_date' => '\DateTime', + 'delivery_address_usage_indicator' => 'string', + 'home_phone' => 'string', + 'mobile_phone' => 'string', + 'password_change_date' => '\DateTime', + 'password_change_indicator' => 'string', + 'past_transactions_day' => 'int', + 'past_transactions_year' => 'int', + 'payment_account_age' => '\DateTime', + 'payment_account_indicator' => 'string', + 'purchases_last6_months' => 'int', + 'suspicious_activity' => 'bool', + 'work_phone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_age_indicator' => null, + 'account_change_date' => 'date-time', + 'account_change_indicator' => null, + 'account_creation_date' => 'date-time', + 'account_type' => null, + 'add_card_attempts_day' => 'int32', + 'delivery_address_usage_date' => 'date-time', + 'delivery_address_usage_indicator' => null, + 'home_phone' => null, + 'mobile_phone' => null, + 'password_change_date' => 'date-time', + 'password_change_indicator' => null, + 'past_transactions_day' => 'int32', + 'past_transactions_year' => 'int32', + 'payment_account_age' => 'date-time', + 'payment_account_indicator' => null, + 'purchases_last6_months' => 'int32', + 'suspicious_activity' => null, + 'work_phone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_age_indicator' => false, + 'account_change_date' => false, + 'account_change_indicator' => false, + 'account_creation_date' => false, + 'account_type' => false, + 'add_card_attempts_day' => true, + 'delivery_address_usage_date' => false, + 'delivery_address_usage_indicator' => false, + 'home_phone' => false, + 'mobile_phone' => false, + 'password_change_date' => false, + 'password_change_indicator' => false, + 'past_transactions_day' => true, + 'past_transactions_year' => true, + 'payment_account_age' => false, + 'payment_account_indicator' => false, + 'purchases_last6_months' => true, + 'suspicious_activity' => false, + 'work_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_age_indicator' => 'accountAgeIndicator', + 'account_change_date' => 'accountChangeDate', + 'account_change_indicator' => 'accountChangeIndicator', + 'account_creation_date' => 'accountCreationDate', + 'account_type' => 'accountType', + 'add_card_attempts_day' => 'addCardAttemptsDay', + 'delivery_address_usage_date' => 'deliveryAddressUsageDate', + 'delivery_address_usage_indicator' => 'deliveryAddressUsageIndicator', + 'home_phone' => 'homePhone', + 'mobile_phone' => 'mobilePhone', + 'password_change_date' => 'passwordChangeDate', + 'password_change_indicator' => 'passwordChangeIndicator', + 'past_transactions_day' => 'pastTransactionsDay', + 'past_transactions_year' => 'pastTransactionsYear', + 'payment_account_age' => 'paymentAccountAge', + 'payment_account_indicator' => 'paymentAccountIndicator', + 'purchases_last6_months' => 'purchasesLast6Months', + 'suspicious_activity' => 'suspiciousActivity', + 'work_phone' => 'workPhone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_age_indicator' => 'setAccountAgeIndicator', + 'account_change_date' => 'setAccountChangeDate', + 'account_change_indicator' => 'setAccountChangeIndicator', + 'account_creation_date' => 'setAccountCreationDate', + 'account_type' => 'setAccountType', + 'add_card_attempts_day' => 'setAddCardAttemptsDay', + 'delivery_address_usage_date' => 'setDeliveryAddressUsageDate', + 'delivery_address_usage_indicator' => 'setDeliveryAddressUsageIndicator', + 'home_phone' => 'setHomePhone', + 'mobile_phone' => 'setMobilePhone', + 'password_change_date' => 'setPasswordChangeDate', + 'password_change_indicator' => 'setPasswordChangeIndicator', + 'past_transactions_day' => 'setPastTransactionsDay', + 'past_transactions_year' => 'setPastTransactionsYear', + 'payment_account_age' => 'setPaymentAccountAge', + 'payment_account_indicator' => 'setPaymentAccountIndicator', + 'purchases_last6_months' => 'setPurchasesLast6Months', + 'suspicious_activity' => 'setSuspiciousActivity', + 'work_phone' => 'setWorkPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_age_indicator' => 'getAccountAgeIndicator', + 'account_change_date' => 'getAccountChangeDate', + 'account_change_indicator' => 'getAccountChangeIndicator', + 'account_creation_date' => 'getAccountCreationDate', + 'account_type' => 'getAccountType', + 'add_card_attempts_day' => 'getAddCardAttemptsDay', + 'delivery_address_usage_date' => 'getDeliveryAddressUsageDate', + 'delivery_address_usage_indicator' => 'getDeliveryAddressUsageIndicator', + 'home_phone' => 'getHomePhone', + 'mobile_phone' => 'getMobilePhone', + 'password_change_date' => 'getPasswordChangeDate', + 'password_change_indicator' => 'getPasswordChangeIndicator', + 'past_transactions_day' => 'getPastTransactionsDay', + 'past_transactions_year' => 'getPastTransactionsYear', + 'payment_account_age' => 'getPaymentAccountAge', + 'payment_account_indicator' => 'getPaymentAccountIndicator', + 'purchases_last6_months' => 'getPurchasesLast6Months', + 'suspicious_activity' => 'getSuspiciousActivity', + 'work_phone' => 'getWorkPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACCOUNT_AGE_INDICATOR_NOT_APPLICABLE = 'notApplicable'; + public const ACCOUNT_AGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const ACCOUNT_AGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const ACCOUNT_AGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const ACCOUNT_AGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const ACCOUNT_CHANGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const ACCOUNT_CHANGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const ACCOUNT_CHANGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const ACCOUNT_CHANGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const ACCOUNT_TYPE_NOT_APPLICABLE = 'notApplicable'; + public const ACCOUNT_TYPE_CREDIT = 'credit'; + public const ACCOUNT_TYPE_DEBIT = 'debit'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const PASSWORD_CHANGE_INDICATOR_NOT_APPLICABLE = 'notApplicable'; + public const PASSWORD_CHANGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const PASSWORD_CHANGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const PASSWORD_CHANGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const PASSWORD_CHANGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const PAYMENT_ACCOUNT_INDICATOR_NOT_APPLICABLE = 'notApplicable'; + public const PAYMENT_ACCOUNT_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const PAYMENT_ACCOUNT_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const PAYMENT_ACCOUNT_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const PAYMENT_ACCOUNT_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountAgeIndicatorAllowableValues() + { + return [ + self::ACCOUNT_AGE_INDICATOR_NOT_APPLICABLE, + self::ACCOUNT_AGE_INDICATOR_THIS_TRANSACTION, + self::ACCOUNT_AGE_INDICATOR_LESS_THAN30_DAYS, + self::ACCOUNT_AGE_INDICATOR_FROM30_TO60_DAYS, + self::ACCOUNT_AGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountChangeIndicatorAllowableValues() + { + return [ + self::ACCOUNT_CHANGE_INDICATOR_THIS_TRANSACTION, + self::ACCOUNT_CHANGE_INDICATOR_LESS_THAN30_DAYS, + self::ACCOUNT_CHANGE_INDICATOR_FROM30_TO60_DAYS, + self::ACCOUNT_CHANGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_NOT_APPLICABLE, + self::ACCOUNT_TYPE_CREDIT, + self::ACCOUNT_TYPE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeliveryAddressUsageIndicatorAllowableValues() + { + return [ + self::DELIVERY_ADDRESS_USAGE_INDICATOR_THIS_TRANSACTION, + self::DELIVERY_ADDRESS_USAGE_INDICATOR_LESS_THAN30_DAYS, + self::DELIVERY_ADDRESS_USAGE_INDICATOR_FROM30_TO60_DAYS, + self::DELIVERY_ADDRESS_USAGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPasswordChangeIndicatorAllowableValues() + { + return [ + self::PASSWORD_CHANGE_INDICATOR_NOT_APPLICABLE, + self::PASSWORD_CHANGE_INDICATOR_THIS_TRANSACTION, + self::PASSWORD_CHANGE_INDICATOR_LESS_THAN30_DAYS, + self::PASSWORD_CHANGE_INDICATOR_FROM30_TO60_DAYS, + self::PASSWORD_CHANGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentAccountIndicatorAllowableValues() + { + return [ + self::PAYMENT_ACCOUNT_INDICATOR_NOT_APPLICABLE, + self::PAYMENT_ACCOUNT_INDICATOR_THIS_TRANSACTION, + self::PAYMENT_ACCOUNT_INDICATOR_LESS_THAN30_DAYS, + self::PAYMENT_ACCOUNT_INDICATOR_FROM30_TO60_DAYS, + self::PAYMENT_ACCOUNT_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_age_indicator', $data ?? [], null); + $this->setIfExists('account_change_date', $data ?? [], null); + $this->setIfExists('account_change_indicator', $data ?? [], null); + $this->setIfExists('account_creation_date', $data ?? [], null); + $this->setIfExists('account_type', $data ?? [], null); + $this->setIfExists('add_card_attempts_day', $data ?? [], null); + $this->setIfExists('delivery_address_usage_date', $data ?? [], null); + $this->setIfExists('delivery_address_usage_indicator', $data ?? [], null); + $this->setIfExists('home_phone', $data ?? [], null); + $this->setIfExists('mobile_phone', $data ?? [], null); + $this->setIfExists('password_change_date', $data ?? [], null); + $this->setIfExists('password_change_indicator', $data ?? [], null); + $this->setIfExists('past_transactions_day', $data ?? [], null); + $this->setIfExists('past_transactions_year', $data ?? [], null); + $this->setIfExists('payment_account_age', $data ?? [], null); + $this->setIfExists('payment_account_indicator', $data ?? [], null); + $this->setIfExists('purchases_last6_months', $data ?? [], null); + $this->setIfExists('suspicious_activity', $data ?? [], null); + $this->setIfExists('work_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAccountAgeIndicatorAllowableValues(); + if (!is_null($this->container['account_age_indicator']) && !in_array($this->container['account_age_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_age_indicator', must be one of '%s'", + $this->container['account_age_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAccountChangeIndicatorAllowableValues(); + if (!is_null($this->container['account_change_indicator']) && !in_array($this->container['account_change_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_change_indicator', must be one of '%s'", + $this->container['account_change_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['account_type']) && !in_array($this->container['account_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_type', must be one of '%s'", + $this->container['account_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDeliveryAddressUsageIndicatorAllowableValues(); + if (!is_null($this->container['delivery_address_usage_indicator']) && !in_array($this->container['delivery_address_usage_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'delivery_address_usage_indicator', must be one of '%s'", + $this->container['delivery_address_usage_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPasswordChangeIndicatorAllowableValues(); + if (!is_null($this->container['password_change_indicator']) && !in_array($this->container['password_change_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'password_change_indicator', must be one of '%s'", + $this->container['password_change_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPaymentAccountIndicatorAllowableValues(); + if (!is_null($this->container['payment_account_indicator']) && !in_array($this->container['payment_account_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'payment_account_indicator', must be one of '%s'", + $this->container['payment_account_indicator'], + 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 account_age_indicator + * + * @return string|null + */ + public function getAccountAgeIndicator() + { + return $this->container['account_age_indicator']; + } + + /** + * Sets account_age_indicator + * + * @param string|null $account_age_indicator Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setAccountAgeIndicator($account_age_indicator) + { + if (is_null($account_age_indicator)) { + throw new \InvalidArgumentException('non-nullable account_age_indicator cannot be null'); + } + $allowedValues = $this->getAccountAgeIndicatorAllowableValues(); + if (!in_array($account_age_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_age_indicator', must be one of '%s'", + $account_age_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_age_indicator'] = $account_age_indicator; + + return $this; + } + + /** + * Gets account_change_date + * + * @return \DateTime|null + */ + public function getAccountChangeDate() + { + return $this->container['account_change_date']; + } + + /** + * Sets account_change_date + * + * @param \DateTime|null $account_change_date Date when the shopper's account was last changed. + * + * @return self + */ + public function setAccountChangeDate($account_change_date) + { + if (is_null($account_change_date)) { + throw new \InvalidArgumentException('non-nullable account_change_date cannot be null'); + } + $this->container['account_change_date'] = $account_change_date; + + return $this; + } + + /** + * Gets account_change_indicator + * + * @return string|null + */ + public function getAccountChangeIndicator() + { + return $this->container['account_change_indicator']; + } + + /** + * Sets account_change_indicator + * + * @param string|null $account_change_indicator Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setAccountChangeIndicator($account_change_indicator) + { + if (is_null($account_change_indicator)) { + throw new \InvalidArgumentException('non-nullable account_change_indicator cannot be null'); + } + $allowedValues = $this->getAccountChangeIndicatorAllowableValues(); + if (!in_array($account_change_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_change_indicator', must be one of '%s'", + $account_change_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_change_indicator'] = $account_change_indicator; + + return $this; + } + + /** + * Gets account_creation_date + * + * @return \DateTime|null + */ + public function getAccountCreationDate() + { + return $this->container['account_creation_date']; + } + + /** + * Sets account_creation_date + * + * @param \DateTime|null $account_creation_date Date when the shopper's account was created. + * + * @return self + */ + public function setAccountCreationDate($account_creation_date) + { + if (is_null($account_creation_date)) { + throw new \InvalidArgumentException('non-nullable account_creation_date cannot be null'); + } + $this->container['account_creation_date'] = $account_creation_date; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($account_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_type', must be one of '%s'", + $account_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets add_card_attempts_day + * + * @return int|null + */ + public function getAddCardAttemptsDay() + { + return $this->container['add_card_attempts_day']; + } + + /** + * Sets add_card_attempts_day + * + * @param int|null $add_card_attempts_day Number of attempts the shopper tried to add a card to their account in the last day. + * + * @return self + */ + public function setAddCardAttemptsDay($add_card_attempts_day) + { + // Do nothing for nullable integers + $this->container['add_card_attempts_day'] = $add_card_attempts_day; + + return $this; + } + + /** + * Gets delivery_address_usage_date + * + * @return \DateTime|null + */ + public function getDeliveryAddressUsageDate() + { + return $this->container['delivery_address_usage_date']; + } + + /** + * Sets delivery_address_usage_date + * + * @param \DateTime|null $delivery_address_usage_date Date the selected delivery address was first used. + * + * @return self + */ + public function setDeliveryAddressUsageDate($delivery_address_usage_date) + { + if (is_null($delivery_address_usage_date)) { + throw new \InvalidArgumentException('non-nullable delivery_address_usage_date cannot be null'); + } + $this->container['delivery_address_usage_date'] = $delivery_address_usage_date; + + return $this; + } + + /** + * Gets delivery_address_usage_indicator + * + * @return string|null + */ + public function getDeliveryAddressUsageIndicator() + { + return $this->container['delivery_address_usage_indicator']; + } + + /** + * Sets delivery_address_usage_indicator + * + * @param string|null $delivery_address_usage_indicator Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setDeliveryAddressUsageIndicator($delivery_address_usage_indicator) + { + if (is_null($delivery_address_usage_indicator)) { + throw new \InvalidArgumentException('non-nullable delivery_address_usage_indicator cannot be null'); + } + $allowedValues = $this->getDeliveryAddressUsageIndicatorAllowableValues(); + if (!in_array($delivery_address_usage_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'delivery_address_usage_indicator', must be one of '%s'", + $delivery_address_usage_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['delivery_address_usage_indicator'] = $delivery_address_usage_indicator; + + return $this; + } + + /** + * Gets home_phone + * + * @return string|null + * @deprecated + */ + public function getHomePhone() + { + return $this->container['home_phone']; + } + + /** + * Sets home_phone + * + * @param string|null $home_phone Shopper's home phone number (including the country code). + * + * @return self + * @deprecated + */ + public function setHomePhone($home_phone) + { + if (is_null($home_phone)) { + throw new \InvalidArgumentException('non-nullable home_phone cannot be null'); + } + $this->container['home_phone'] = $home_phone; + + return $this; + } + + /** + * Gets mobile_phone + * + * @return string|null + * @deprecated + */ + public function getMobilePhone() + { + return $this->container['mobile_phone']; + } + + /** + * Sets mobile_phone + * + * @param string|null $mobile_phone Shopper's mobile phone number (including the country code). + * + * @return self + * @deprecated + */ + public function setMobilePhone($mobile_phone) + { + if (is_null($mobile_phone)) { + throw new \InvalidArgumentException('non-nullable mobile_phone cannot be null'); + } + $this->container['mobile_phone'] = $mobile_phone; + + return $this; + } + + /** + * Gets password_change_date + * + * @return \DateTime|null + */ + public function getPasswordChangeDate() + { + return $this->container['password_change_date']; + } + + /** + * Sets password_change_date + * + * @param \DateTime|null $password_change_date Date when the shopper last changed their password. + * + * @return self + */ + public function setPasswordChangeDate($password_change_date) + { + if (is_null($password_change_date)) { + throw new \InvalidArgumentException('non-nullable password_change_date cannot be null'); + } + $this->container['password_change_date'] = $password_change_date; + + return $this; + } + + /** + * Gets password_change_indicator + * + * @return string|null + */ + public function getPasswordChangeIndicator() + { + return $this->container['password_change_indicator']; + } + + /** + * Sets password_change_indicator + * + * @param string|null $password_change_indicator Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setPasswordChangeIndicator($password_change_indicator) + { + if (is_null($password_change_indicator)) { + throw new \InvalidArgumentException('non-nullable password_change_indicator cannot be null'); + } + $allowedValues = $this->getPasswordChangeIndicatorAllowableValues(); + if (!in_array($password_change_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'password_change_indicator', must be one of '%s'", + $password_change_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['password_change_indicator'] = $password_change_indicator; + + return $this; + } + + /** + * Gets past_transactions_day + * + * @return int|null + */ + public function getPastTransactionsDay() + { + return $this->container['past_transactions_day']; + } + + /** + * Sets past_transactions_day + * + * @param int|null $past_transactions_day Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. + * + * @return self + */ + public function setPastTransactionsDay($past_transactions_day) + { + // Do nothing for nullable integers + $this->container['past_transactions_day'] = $past_transactions_day; + + return $this; + } + + /** + * Gets past_transactions_year + * + * @return int|null + */ + public function getPastTransactionsYear() + { + return $this->container['past_transactions_year']; + } + + /** + * Sets past_transactions_year + * + * @param int|null $past_transactions_year Number of all transactions (successful and abandoned) from this shopper in the past year. + * + * @return self + */ + public function setPastTransactionsYear($past_transactions_year) + { + // Do nothing for nullable integers + $this->container['past_transactions_year'] = $past_transactions_year; + + return $this; + } + + /** + * Gets payment_account_age + * + * @return \DateTime|null + */ + public function getPaymentAccountAge() + { + return $this->container['payment_account_age']; + } + + /** + * Sets payment_account_age + * + * @param \DateTime|null $payment_account_age Date this payment method was added to the shopper's account. + * + * @return self + */ + public function setPaymentAccountAge($payment_account_age) + { + if (is_null($payment_account_age)) { + throw new \InvalidArgumentException('non-nullable payment_account_age cannot be null'); + } + $this->container['payment_account_age'] = $payment_account_age; + + return $this; + } + + /** + * Gets payment_account_indicator + * + * @return string|null + */ + public function getPaymentAccountIndicator() + { + return $this->container['payment_account_indicator']; + } + + /** + * Sets payment_account_indicator + * + * @param string|null $payment_account_indicator Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setPaymentAccountIndicator($payment_account_indicator) + { + if (is_null($payment_account_indicator)) { + throw new \InvalidArgumentException('non-nullable payment_account_indicator cannot be null'); + } + $allowedValues = $this->getPaymentAccountIndicatorAllowableValues(); + if (!in_array($payment_account_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'payment_account_indicator', must be one of '%s'", + $payment_account_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['payment_account_indicator'] = $payment_account_indicator; + + return $this; + } + + /** + * Gets purchases_last6_months + * + * @return int|null + */ + public function getPurchasesLast6Months() + { + return $this->container['purchases_last6_months']; + } + + /** + * Sets purchases_last6_months + * + * @param int|null $purchases_last6_months Number of successful purchases in the last six months. + * + * @return self + */ + public function setPurchasesLast6Months($purchases_last6_months) + { + // Do nothing for nullable integers + $this->container['purchases_last6_months'] = $purchases_last6_months; + + return $this; + } + + /** + * Gets suspicious_activity + * + * @return bool|null + */ + public function getSuspiciousActivity() + { + return $this->container['suspicious_activity']; + } + + /** + * Sets suspicious_activity + * + * @param bool|null $suspicious_activity Whether suspicious activity was recorded on this account. + * + * @return self + */ + public function setSuspiciousActivity($suspicious_activity) + { + if (is_null($suspicious_activity)) { + throw new \InvalidArgumentException('non-nullable suspicious_activity cannot be null'); + } + $this->container['suspicious_activity'] = $suspicious_activity; + + return $this; + } + + /** + * Gets work_phone + * + * @return string|null + * @deprecated + */ + public function getWorkPhone() + { + return $this->container['work_phone']; + } + + /** + * Sets work_phone + * + * @param string|null $work_phone Shopper's work phone number (including the country code). + * + * @return self + * @deprecated + */ + public function setWorkPhone($work_phone) + { + if (is_null($work_phone)) { + throw new \InvalidArgumentException('non-nullable work_phone cannot be null'); + } + $this->container['work_phone'] = $work_phone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AcctInfo.php b/src/Adyen/Model/Checkout/AcctInfo.php new file mode 100644 index 000000000..dcfe57249 --- /dev/null +++ b/src/Adyen/Model/Checkout/AcctInfo.php @@ -0,0 +1,1154 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AcctInfo Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AcctInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AcctInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ch_acc_age_ind' => 'string', + 'ch_acc_change' => 'string', + 'ch_acc_change_ind' => 'string', + 'ch_acc_pw_change' => 'string', + 'ch_acc_pw_change_ind' => 'string', + 'ch_acc_string' => 'string', + 'nb_purchase_account' => 'string', + 'payment_acc_age' => 'string', + 'payment_acc_ind' => 'string', + 'provision_attempts_day' => 'string', + 'ship_address_usage' => 'string', + 'ship_address_usage_ind' => 'string', + 'ship_name_indicator' => 'string', + 'suspicious_acc_activity' => 'string', + 'txn_activity_day' => 'string', + 'txn_activity_year' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ch_acc_age_ind' => null, + 'ch_acc_change' => null, + 'ch_acc_change_ind' => null, + 'ch_acc_pw_change' => null, + 'ch_acc_pw_change_ind' => null, + 'ch_acc_string' => null, + 'nb_purchase_account' => null, + 'payment_acc_age' => null, + 'payment_acc_ind' => null, + 'provision_attempts_day' => null, + 'ship_address_usage' => null, + 'ship_address_usage_ind' => null, + 'ship_name_indicator' => null, + 'suspicious_acc_activity' => null, + 'txn_activity_day' => null, + 'txn_activity_year' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'ch_acc_age_ind' => false, + 'ch_acc_change' => false, + 'ch_acc_change_ind' => false, + 'ch_acc_pw_change' => false, + 'ch_acc_pw_change_ind' => false, + 'ch_acc_string' => false, + 'nb_purchase_account' => false, + 'payment_acc_age' => false, + 'payment_acc_ind' => false, + 'provision_attempts_day' => false, + 'ship_address_usage' => false, + 'ship_address_usage_ind' => false, + 'ship_name_indicator' => false, + 'suspicious_acc_activity' => false, + 'txn_activity_day' => false, + 'txn_activity_year' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ch_acc_age_ind' => 'chAccAgeInd', + 'ch_acc_change' => 'chAccChange', + 'ch_acc_change_ind' => 'chAccChangeInd', + 'ch_acc_pw_change' => 'chAccPwChange', + 'ch_acc_pw_change_ind' => 'chAccPwChangeInd', + 'ch_acc_string' => 'chAccString', + 'nb_purchase_account' => 'nbPurchaseAccount', + 'payment_acc_age' => 'paymentAccAge', + 'payment_acc_ind' => 'paymentAccInd', + 'provision_attempts_day' => 'provisionAttemptsDay', + 'ship_address_usage' => 'shipAddressUsage', + 'ship_address_usage_ind' => 'shipAddressUsageInd', + 'ship_name_indicator' => 'shipNameIndicator', + 'suspicious_acc_activity' => 'suspiciousAccActivity', + 'txn_activity_day' => 'txnActivityDay', + 'txn_activity_year' => 'txnActivityYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ch_acc_age_ind' => 'setChAccAgeInd', + 'ch_acc_change' => 'setChAccChange', + 'ch_acc_change_ind' => 'setChAccChangeInd', + 'ch_acc_pw_change' => 'setChAccPwChange', + 'ch_acc_pw_change_ind' => 'setChAccPwChangeInd', + 'ch_acc_string' => 'setChAccString', + 'nb_purchase_account' => 'setNbPurchaseAccount', + 'payment_acc_age' => 'setPaymentAccAge', + 'payment_acc_ind' => 'setPaymentAccInd', + 'provision_attempts_day' => 'setProvisionAttemptsDay', + 'ship_address_usage' => 'setShipAddressUsage', + 'ship_address_usage_ind' => 'setShipAddressUsageInd', + 'ship_name_indicator' => 'setShipNameIndicator', + 'suspicious_acc_activity' => 'setSuspiciousAccActivity', + 'txn_activity_day' => 'setTxnActivityDay', + 'txn_activity_year' => 'setTxnActivityYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ch_acc_age_ind' => 'getChAccAgeInd', + 'ch_acc_change' => 'getChAccChange', + 'ch_acc_change_ind' => 'getChAccChangeInd', + 'ch_acc_pw_change' => 'getChAccPwChange', + 'ch_acc_pw_change_ind' => 'getChAccPwChangeInd', + 'ch_acc_string' => 'getChAccString', + 'nb_purchase_account' => 'getNbPurchaseAccount', + 'payment_acc_age' => 'getPaymentAccAge', + 'payment_acc_ind' => 'getPaymentAccInd', + 'provision_attempts_day' => 'getProvisionAttemptsDay', + 'ship_address_usage' => 'getShipAddressUsage', + 'ship_address_usage_ind' => 'getShipAddressUsageInd', + 'ship_name_indicator' => 'getShipNameIndicator', + 'suspicious_acc_activity' => 'getSuspiciousAccActivity', + 'txn_activity_day' => 'getTxnActivityDay', + 'txn_activity_year' => 'getTxnActivityYear' + ]; + + /** + * 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 CH_ACC_AGE_IND__01 = '01'; + public const CH_ACC_AGE_IND__02 = '02'; + public const CH_ACC_AGE_IND__03 = '03'; + public const CH_ACC_AGE_IND__04 = '04'; + public const CH_ACC_AGE_IND__05 = '05'; + public const CH_ACC_CHANGE_IND__01 = '01'; + public const CH_ACC_CHANGE_IND__02 = '02'; + public const CH_ACC_CHANGE_IND__03 = '03'; + public const CH_ACC_CHANGE_IND__04 = '04'; + public const CH_ACC_PW_CHANGE_IND__01 = '01'; + public const CH_ACC_PW_CHANGE_IND__02 = '02'; + public const CH_ACC_PW_CHANGE_IND__03 = '03'; + public const CH_ACC_PW_CHANGE_IND__04 = '04'; + public const CH_ACC_PW_CHANGE_IND__05 = '05'; + public const PAYMENT_ACC_IND__01 = '01'; + public const PAYMENT_ACC_IND__02 = '02'; + public const PAYMENT_ACC_IND__03 = '03'; + public const PAYMENT_ACC_IND__04 = '04'; + public const PAYMENT_ACC_IND__05 = '05'; + public const SHIP_ADDRESS_USAGE_IND__01 = '01'; + public const SHIP_ADDRESS_USAGE_IND__02 = '02'; + public const SHIP_ADDRESS_USAGE_IND__03 = '03'; + public const SHIP_ADDRESS_USAGE_IND__04 = '04'; + public const SHIP_NAME_INDICATOR__01 = '01'; + public const SHIP_NAME_INDICATOR__02 = '02'; + public const SUSPICIOUS_ACC_ACTIVITY__01 = '01'; + public const SUSPICIOUS_ACC_ACTIVITY__02 = '02'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChAccAgeIndAllowableValues() + { + return [ + self::CH_ACC_AGE_IND__01, + self::CH_ACC_AGE_IND__02, + self::CH_ACC_AGE_IND__03, + self::CH_ACC_AGE_IND__04, + self::CH_ACC_AGE_IND__05, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChAccChangeIndAllowableValues() + { + return [ + self::CH_ACC_CHANGE_IND__01, + self::CH_ACC_CHANGE_IND__02, + self::CH_ACC_CHANGE_IND__03, + self::CH_ACC_CHANGE_IND__04, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChAccPwChangeIndAllowableValues() + { + return [ + self::CH_ACC_PW_CHANGE_IND__01, + self::CH_ACC_PW_CHANGE_IND__02, + self::CH_ACC_PW_CHANGE_IND__03, + self::CH_ACC_PW_CHANGE_IND__04, + self::CH_ACC_PW_CHANGE_IND__05, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentAccIndAllowableValues() + { + return [ + self::PAYMENT_ACC_IND__01, + self::PAYMENT_ACC_IND__02, + self::PAYMENT_ACC_IND__03, + self::PAYMENT_ACC_IND__04, + self::PAYMENT_ACC_IND__05, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShipAddressUsageIndAllowableValues() + { + return [ + self::SHIP_ADDRESS_USAGE_IND__01, + self::SHIP_ADDRESS_USAGE_IND__02, + self::SHIP_ADDRESS_USAGE_IND__03, + self::SHIP_ADDRESS_USAGE_IND__04, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShipNameIndicatorAllowableValues() + { + return [ + self::SHIP_NAME_INDICATOR__01, + self::SHIP_NAME_INDICATOR__02, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSuspiciousAccActivityAllowableValues() + { + return [ + self::SUSPICIOUS_ACC_ACTIVITY__01, + self::SUSPICIOUS_ACC_ACTIVITY__02, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ch_acc_age_ind', $data ?? [], null); + $this->setIfExists('ch_acc_change', $data ?? [], null); + $this->setIfExists('ch_acc_change_ind', $data ?? [], null); + $this->setIfExists('ch_acc_pw_change', $data ?? [], null); + $this->setIfExists('ch_acc_pw_change_ind', $data ?? [], null); + $this->setIfExists('ch_acc_string', $data ?? [], null); + $this->setIfExists('nb_purchase_account', $data ?? [], null); + $this->setIfExists('payment_acc_age', $data ?? [], null); + $this->setIfExists('payment_acc_ind', $data ?? [], null); + $this->setIfExists('provision_attempts_day', $data ?? [], null); + $this->setIfExists('ship_address_usage', $data ?? [], null); + $this->setIfExists('ship_address_usage_ind', $data ?? [], null); + $this->setIfExists('ship_name_indicator', $data ?? [], null); + $this->setIfExists('suspicious_acc_activity', $data ?? [], null); + $this->setIfExists('txn_activity_day', $data ?? [], null); + $this->setIfExists('txn_activity_year', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChAccAgeIndAllowableValues(); + if (!is_null($this->container['ch_acc_age_ind']) && !in_array($this->container['ch_acc_age_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ch_acc_age_ind', must be one of '%s'", + $this->container['ch_acc_age_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChAccChangeIndAllowableValues(); + if (!is_null($this->container['ch_acc_change_ind']) && !in_array($this->container['ch_acc_change_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ch_acc_change_ind', must be one of '%s'", + $this->container['ch_acc_change_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChAccPwChangeIndAllowableValues(); + if (!is_null($this->container['ch_acc_pw_change_ind']) && !in_array($this->container['ch_acc_pw_change_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ch_acc_pw_change_ind', must be one of '%s'", + $this->container['ch_acc_pw_change_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPaymentAccIndAllowableValues(); + if (!is_null($this->container['payment_acc_ind']) && !in_array($this->container['payment_acc_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'payment_acc_ind', must be one of '%s'", + $this->container['payment_acc_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getShipAddressUsageIndAllowableValues(); + if (!is_null($this->container['ship_address_usage_ind']) && !in_array($this->container['ship_address_usage_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ship_address_usage_ind', must be one of '%s'", + $this->container['ship_address_usage_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getShipNameIndicatorAllowableValues(); + if (!is_null($this->container['ship_name_indicator']) && !in_array($this->container['ship_name_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ship_name_indicator', must be one of '%s'", + $this->container['ship_name_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSuspiciousAccActivityAllowableValues(); + if (!is_null($this->container['suspicious_acc_activity']) && !in_array($this->container['suspicious_acc_activity'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'suspicious_acc_activity', must be one of '%s'", + $this->container['suspicious_acc_activity'], + 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 ch_acc_age_ind + * + * @return string|null + */ + public function getChAccAgeInd() + { + return $this->container['ch_acc_age_ind']; + } + + /** + * Sets ch_acc_age_ind + * + * @param string|null $ch_acc_age_ind Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + * + * @return self + */ + public function setChAccAgeInd($ch_acc_age_ind) + { + if (is_null($ch_acc_age_ind)) { + throw new \InvalidArgumentException('non-nullable ch_acc_age_ind cannot be null'); + } + $allowedValues = $this->getChAccAgeIndAllowableValues(); + if (!in_array($ch_acc_age_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ch_acc_age_ind', must be one of '%s'", + $ch_acc_age_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ch_acc_age_ind'] = $ch_acc_age_ind; + + return $this; + } + + /** + * Gets ch_acc_change + * + * @return string|null + */ + public function getChAccChange() + { + return $this->container['ch_acc_change']; + } + + /** + * Sets ch_acc_change + * + * @param string|null $ch_acc_change Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** + * + * @return self + */ + public function setChAccChange($ch_acc_change) + { + if (is_null($ch_acc_change)) { + throw new \InvalidArgumentException('non-nullable ch_acc_change cannot be null'); + } + $this->container['ch_acc_change'] = $ch_acc_change; + + return $this; + } + + /** + * Gets ch_acc_change_ind + * + * @return string|null + */ + public function getChAccChangeInd() + { + return $this->container['ch_acc_change_ind']; + } + + /** + * Sets ch_acc_change_ind + * + * @param string|null $ch_acc_change_ind Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + * + * @return self + */ + public function setChAccChangeInd($ch_acc_change_ind) + { + if (is_null($ch_acc_change_ind)) { + throw new \InvalidArgumentException('non-nullable ch_acc_change_ind cannot be null'); + } + $allowedValues = $this->getChAccChangeIndAllowableValues(); + if (!in_array($ch_acc_change_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ch_acc_change_ind', must be one of '%s'", + $ch_acc_change_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ch_acc_change_ind'] = $ch_acc_change_ind; + + return $this; + } + + /** + * Gets ch_acc_pw_change + * + * @return string|null + */ + public function getChAccPwChange() + { + return $this->container['ch_acc_pw_change']; + } + + /** + * Sets ch_acc_pw_change + * + * @param string|null $ch_acc_pw_change Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** + * + * @return self + */ + public function setChAccPwChange($ch_acc_pw_change) + { + if (is_null($ch_acc_pw_change)) { + throw new \InvalidArgumentException('non-nullable ch_acc_pw_change cannot be null'); + } + $this->container['ch_acc_pw_change'] = $ch_acc_pw_change; + + return $this; + } + + /** + * Gets ch_acc_pw_change_ind + * + * @return string|null + */ + public function getChAccPwChangeInd() + { + return $this->container['ch_acc_pw_change_ind']; + } + + /** + * Sets ch_acc_pw_change_ind + * + * @param string|null $ch_acc_pw_change_ind Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + * + * @return self + */ + public function setChAccPwChangeInd($ch_acc_pw_change_ind) + { + if (is_null($ch_acc_pw_change_ind)) { + throw new \InvalidArgumentException('non-nullable ch_acc_pw_change_ind cannot be null'); + } + $allowedValues = $this->getChAccPwChangeIndAllowableValues(); + if (!in_array($ch_acc_pw_change_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ch_acc_pw_change_ind', must be one of '%s'", + $ch_acc_pw_change_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ch_acc_pw_change_ind'] = $ch_acc_pw_change_ind; + + return $this; + } + + /** + * Gets ch_acc_string + * + * @return string|null + */ + public function getChAccString() + { + return $this->container['ch_acc_string']; + } + + /** + * Sets ch_acc_string + * + * @param string|null $ch_acc_string Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** + * + * @return self + */ + public function setChAccString($ch_acc_string) + { + if (is_null($ch_acc_string)) { + throw new \InvalidArgumentException('non-nullable ch_acc_string cannot be null'); + } + $this->container['ch_acc_string'] = $ch_acc_string; + + return $this; + } + + /** + * Gets nb_purchase_account + * + * @return string|null + */ + public function getNbPurchaseAccount() + { + return $this->container['nb_purchase_account']; + } + + /** + * Sets nb_purchase_account + * + * @param string|null $nb_purchase_account Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. + * + * @return self + */ + public function setNbPurchaseAccount($nb_purchase_account) + { + if (is_null($nb_purchase_account)) { + throw new \InvalidArgumentException('non-nullable nb_purchase_account cannot be null'); + } + $this->container['nb_purchase_account'] = $nb_purchase_account; + + return $this; + } + + /** + * Gets payment_acc_age + * + * @return string|null + */ + public function getPaymentAccAge() + { + return $this->container['payment_acc_age']; + } + + /** + * Sets payment_acc_age + * + * @param string|null $payment_acc_age String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** + * + * @return self + */ + public function setPaymentAccAge($payment_acc_age) + { + if (is_null($payment_acc_age)) { + throw new \InvalidArgumentException('non-nullable payment_acc_age cannot be null'); + } + $this->container['payment_acc_age'] = $payment_acc_age; + + return $this; + } + + /** + * Gets payment_acc_ind + * + * @return string|null + */ + public function getPaymentAccInd() + { + return $this->container['payment_acc_ind']; + } + + /** + * Sets payment_acc_ind + * + * @param string|null $payment_acc_ind Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + * + * @return self + */ + public function setPaymentAccInd($payment_acc_ind) + { + if (is_null($payment_acc_ind)) { + throw new \InvalidArgumentException('non-nullable payment_acc_ind cannot be null'); + } + $allowedValues = $this->getPaymentAccIndAllowableValues(); + if (!in_array($payment_acc_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'payment_acc_ind', must be one of '%s'", + $payment_acc_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['payment_acc_ind'] = $payment_acc_ind; + + return $this; + } + + /** + * Gets provision_attempts_day + * + * @return string|null + */ + public function getProvisionAttemptsDay() + { + return $this->container['provision_attempts_day']; + } + + /** + * Sets provision_attempts_day + * + * @param string|null $provision_attempts_day Number of Add Card attempts in the last 24 hours. Max length: 3 characters. + * + * @return self + */ + public function setProvisionAttemptsDay($provision_attempts_day) + { + if (is_null($provision_attempts_day)) { + throw new \InvalidArgumentException('non-nullable provision_attempts_day cannot be null'); + } + $this->container['provision_attempts_day'] = $provision_attempts_day; + + return $this; + } + + /** + * Gets ship_address_usage + * + * @return string|null + */ + public function getShipAddressUsage() + { + return $this->container['ship_address_usage']; + } + + /** + * Sets ship_address_usage + * + * @param string|null $ship_address_usage String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** + * + * @return self + */ + public function setShipAddressUsage($ship_address_usage) + { + if (is_null($ship_address_usage)) { + throw new \InvalidArgumentException('non-nullable ship_address_usage cannot be null'); + } + $this->container['ship_address_usage'] = $ship_address_usage; + + return $this; + } + + /** + * Gets ship_address_usage_ind + * + * @return string|null + */ + public function getShipAddressUsageInd() + { + return $this->container['ship_address_usage_ind']; + } + + /** + * Sets ship_address_usage_ind + * + * @param string|null $ship_address_usage_ind Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + * + * @return self + */ + public function setShipAddressUsageInd($ship_address_usage_ind) + { + if (is_null($ship_address_usage_ind)) { + throw new \InvalidArgumentException('non-nullable ship_address_usage_ind cannot be null'); + } + $allowedValues = $this->getShipAddressUsageIndAllowableValues(); + if (!in_array($ship_address_usage_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ship_address_usage_ind', must be one of '%s'", + $ship_address_usage_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ship_address_usage_ind'] = $ship_address_usage_ind; + + return $this; + } + + /** + * Gets ship_name_indicator + * + * @return string|null + */ + public function getShipNameIndicator() + { + return $this->container['ship_name_indicator']; + } + + /** + * Sets ship_name_indicator + * + * @param string|null $ship_name_indicator Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name + * + * @return self + */ + public function setShipNameIndicator($ship_name_indicator) + { + if (is_null($ship_name_indicator)) { + throw new \InvalidArgumentException('non-nullable ship_name_indicator cannot be null'); + } + $allowedValues = $this->getShipNameIndicatorAllowableValues(); + if (!in_array($ship_name_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ship_name_indicator', must be one of '%s'", + $ship_name_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ship_name_indicator'] = $ship_name_indicator; + + return $this; + } + + /** + * Gets suspicious_acc_activity + * + * @return string|null + */ + public function getSuspiciousAccActivity() + { + return $this->container['suspicious_acc_activity']; + } + + /** + * Sets suspicious_acc_activity + * + * @param string|null $suspicious_acc_activity Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed + * + * @return self + */ + public function setSuspiciousAccActivity($suspicious_acc_activity) + { + if (is_null($suspicious_acc_activity)) { + throw new \InvalidArgumentException('non-nullable suspicious_acc_activity cannot be null'); + } + $allowedValues = $this->getSuspiciousAccActivityAllowableValues(); + if (!in_array($suspicious_acc_activity, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'suspicious_acc_activity', must be one of '%s'", + $suspicious_acc_activity, + implode("', '", $allowedValues) + ) + ); + } + $this->container['suspicious_acc_activity'] = $suspicious_acc_activity; + + return $this; + } + + /** + * Gets txn_activity_day + * + * @return string|null + */ + public function getTxnActivityDay() + { + return $this->container['txn_activity_day']; + } + + /** + * Sets txn_activity_day + * + * @param string|null $txn_activity_day Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. + * + * @return self + */ + public function setTxnActivityDay($txn_activity_day) + { + if (is_null($txn_activity_day)) { + throw new \InvalidArgumentException('non-nullable txn_activity_day cannot be null'); + } + $this->container['txn_activity_day'] = $txn_activity_day; + + return $this; + } + + /** + * Gets txn_activity_year + * + * @return string|null + */ + public function getTxnActivityYear() + { + return $this->container['txn_activity_year']; + } + + /** + * Sets txn_activity_year + * + * @param string|null $txn_activity_year Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. + * + * @return self + */ + public function setTxnActivityYear($txn_activity_year) + { + if (is_null($txn_activity_year)) { + throw new \InvalidArgumentException('non-nullable txn_activity_year cannot be null'); + } + $this->container['txn_activity_year'] = $txn_activity_year; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AchDetails.php b/src/Adyen/Model/Checkout/AchDetails.php new file mode 100644 index 000000000..7ac29d6c7 --- /dev/null +++ b/src/Adyen/Model/Checkout/AchDetails.php @@ -0,0 +1,695 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AchDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AchDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AchDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank_account_number' => 'string', + 'bank_location_id' => 'string', + 'checkout_attempt_id' => 'string', + 'encrypted_bank_account_number' => 'string', + 'encrypted_bank_location_id' => 'string', + 'owner_name' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank_account_number' => null, + 'bank_location_id' => null, + 'checkout_attempt_id' => null, + 'encrypted_bank_account_number' => null, + 'encrypted_bank_location_id' => null, + 'owner_name' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank_account_number' => false, + 'bank_location_id' => false, + 'checkout_attempt_id' => false, + 'encrypted_bank_account_number' => false, + 'encrypted_bank_location_id' => false, + 'owner_name' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bank_account_number' => 'bankAccountNumber', + 'bank_location_id' => 'bankLocationId', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'encrypted_bank_account_number' => 'encryptedBankAccountNumber', + 'encrypted_bank_location_id' => 'encryptedBankLocationId', + 'owner_name' => 'ownerName', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank_account_number' => 'setBankAccountNumber', + 'bank_location_id' => 'setBankLocationId', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'encrypted_bank_account_number' => 'setEncryptedBankAccountNumber', + 'encrypted_bank_location_id' => 'setEncryptedBankLocationId', + 'owner_name' => 'setOwnerName', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank_account_number' => 'getBankAccountNumber', + 'bank_location_id' => 'getBankLocationId', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'encrypted_bank_account_number' => 'getEncryptedBankAccountNumber', + 'encrypted_bank_location_id' => 'getEncryptedBankLocationId', + 'owner_name' => 'getOwnerName', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_ACH = 'ach'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ACH, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bank_account_number', $data ?? [], null); + $this->setIfExists('bank_location_id', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('encrypted_bank_account_number', $data ?? [], null); + $this->setIfExists('encrypted_bank_location_id', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'ach'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['bank_account_number'] === null) { + $invalidProperties[] = "'bank_account_number' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank_account_number + * + * @return string + */ + public function getBankAccountNumber() + { + return $this->container['bank_account_number']; + } + + /** + * Sets bank_account_number + * + * @param string $bank_account_number The bank account number (without separators). + * + * @return self + */ + public function setBankAccountNumber($bank_account_number) + { + if (is_null($bank_account_number)) { + throw new \InvalidArgumentException('non-nullable bank_account_number cannot be null'); + } + $this->container['bank_account_number'] = $bank_account_number; + + return $this; + } + + /** + * Gets bank_location_id + * + * @return string|null + */ + public function getBankLocationId() + { + return $this->container['bank_location_id']; + } + + /** + * Sets bank_location_id + * + * @param string|null $bank_location_id The bank routing number of the account. The field value is `nil` in most cases. + * + * @return self + */ + public function setBankLocationId($bank_location_id) + { + if (is_null($bank_location_id)) { + throw new \InvalidArgumentException('non-nullable bank_location_id cannot be null'); + } + $this->container['bank_location_id'] = $bank_location_id; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets encrypted_bank_account_number + * + * @return string|null + */ + public function getEncryptedBankAccountNumber() + { + return $this->container['encrypted_bank_account_number']; + } + + /** + * Sets encrypted_bank_account_number + * + * @param string|null $encrypted_bank_account_number Encrypted bank account number. The bank account number (without separators). + * + * @return self + */ + public function setEncryptedBankAccountNumber($encrypted_bank_account_number) + { + if (is_null($encrypted_bank_account_number)) { + throw new \InvalidArgumentException('non-nullable encrypted_bank_account_number cannot be null'); + } + $this->container['encrypted_bank_account_number'] = $encrypted_bank_account_number; + + return $this; + } + + /** + * Gets encrypted_bank_location_id + * + * @return string|null + */ + public function getEncryptedBankLocationId() + { + return $this->container['encrypted_bank_location_id']; + } + + /** + * Sets encrypted_bank_location_id + * + * @param string|null $encrypted_bank_location_id Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. + * + * @return self + */ + public function setEncryptedBankLocationId($encrypted_bank_location_id) + { + if (is_null($encrypted_bank_location_id)) { + throw new \InvalidArgumentException('non-nullable encrypted_bank_location_id cannot be null'); + } + $this->container['encrypted_bank_location_id'] = $encrypted_bank_location_id; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **ach** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalData3DSecure.php b/src/Adyen/Model/Checkout/AdditionalData3DSecure.php new file mode 100644 index 000000000..131a0182c --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalData3DSecure.php @@ -0,0 +1,600 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalData3DSecure Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalData3DSecure implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalData3DSecure'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allow3_ds2' => 'string', + 'challenge_window_size' => 'string', + 'execute_three_d' => 'string', + 'mpi_implementation_type' => 'string', + 'sca_exemption' => 'string', + 'three_ds_version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allow3_ds2' => null, + 'challenge_window_size' => null, + 'execute_three_d' => null, + 'mpi_implementation_type' => null, + 'sca_exemption' => null, + 'three_ds_version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allow3_ds2' => false, + 'challenge_window_size' => false, + 'execute_three_d' => false, + 'mpi_implementation_type' => false, + 'sca_exemption' => false, + 'three_ds_version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allow3_ds2' => 'allow3DS2', + 'challenge_window_size' => 'challengeWindowSize', + 'execute_three_d' => 'executeThreeD', + 'mpi_implementation_type' => 'mpiImplementationType', + 'sca_exemption' => 'scaExemption', + 'three_ds_version' => 'threeDSVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allow3_ds2' => 'setAllow3Ds2', + 'challenge_window_size' => 'setChallengeWindowSize', + 'execute_three_d' => 'setExecuteThreeD', + 'mpi_implementation_type' => 'setMpiImplementationType', + 'sca_exemption' => 'setScaExemption', + 'three_ds_version' => 'setThreeDsVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allow3_ds2' => 'getAllow3Ds2', + 'challenge_window_size' => 'getChallengeWindowSize', + 'execute_three_d' => 'getExecuteThreeD', + 'mpi_implementation_type' => 'getMpiImplementationType', + 'sca_exemption' => 'getScaExemption', + 'three_ds_version' => 'getThreeDsVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHALLENGE_WINDOW_SIZE__01 = '01'; + public const CHALLENGE_WINDOW_SIZE__02 = '02'; + public const CHALLENGE_WINDOW_SIZE__03 = '03'; + public const CHALLENGE_WINDOW_SIZE__04 = '04'; + public const CHALLENGE_WINDOW_SIZE__05 = '05'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeWindowSizeAllowableValues() + { + return [ + self::CHALLENGE_WINDOW_SIZE__01, + self::CHALLENGE_WINDOW_SIZE__02, + self::CHALLENGE_WINDOW_SIZE__03, + self::CHALLENGE_WINDOW_SIZE__04, + self::CHALLENGE_WINDOW_SIZE__05, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allow3_ds2', $data ?? [], null); + $this->setIfExists('challenge_window_size', $data ?? [], null); + $this->setIfExists('execute_three_d', $data ?? [], null); + $this->setIfExists('mpi_implementation_type', $data ?? [], null); + $this->setIfExists('sca_exemption', $data ?? [], null); + $this->setIfExists('three_ds_version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChallengeWindowSizeAllowableValues(); + if (!is_null($this->container['challenge_window_size']) && !in_array($this->container['challenge_window_size'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_window_size', must be one of '%s'", + $this->container['challenge_window_size'], + 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 allow3_ds2 + * + * @return string|null + * @deprecated + */ + public function getAllow3Ds2() + { + return $this->container['allow3_ds2']; + } + + /** + * Sets allow3_ds2 + * + * @param string|null $allow3_ds2 Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. + * + * @return self + * @deprecated + */ + public function setAllow3Ds2($allow3_ds2) + { + if (is_null($allow3_ds2)) { + throw new \InvalidArgumentException('non-nullable allow3_ds2 cannot be null'); + } + $this->container['allow3_ds2'] = $allow3_ds2; + + return $this; + } + + /** + * Gets challenge_window_size + * + * @return string|null + */ + public function getChallengeWindowSize() + { + return $this->container['challenge_window_size']; + } + + /** + * Sets challenge_window_size + * + * @param string|null $challenge_window_size Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen + * + * @return self + */ + public function setChallengeWindowSize($challenge_window_size) + { + if (is_null($challenge_window_size)) { + throw new \InvalidArgumentException('non-nullable challenge_window_size cannot be null'); + } + $allowedValues = $this->getChallengeWindowSizeAllowableValues(); + if (!in_array($challenge_window_size, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_window_size', must be one of '%s'", + $challenge_window_size, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_window_size'] = $challenge_window_size; + + return $this; + } + + /** + * Gets execute_three_d + * + * @return string|null + * @deprecated + */ + public function getExecuteThreeD() + { + return $this->container['execute_three_d']; + } + + /** + * Sets execute_three_d + * + * @param string|null $execute_three_d Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + * + * @return self + * @deprecated + */ + public function setExecuteThreeD($execute_three_d) + { + if (is_null($execute_three_d)) { + throw new \InvalidArgumentException('non-nullable execute_three_d cannot be null'); + } + $this->container['execute_three_d'] = $execute_three_d; + + return $this; + } + + /** + * Gets mpi_implementation_type + * + * @return string|null + */ + public function getMpiImplementationType() + { + return $this->container['mpi_implementation_type']; + } + + /** + * Sets mpi_implementation_type + * + * @param string|null $mpi_implementation_type In case of Secure+, this field must be set to **CUPSecurePlus**. + * + * @return self + */ + public function setMpiImplementationType($mpi_implementation_type) + { + if (is_null($mpi_implementation_type)) { + throw new \InvalidArgumentException('non-nullable mpi_implementation_type cannot be null'); + } + $this->container['mpi_implementation_type'] = $mpi_implementation_type; + + return $this; + } + + /** + * Gets sca_exemption + * + * @return string|null + */ + public function getScaExemption() + { + return $this->container['sca_exemption']; + } + + /** + * Sets sca_exemption + * + * @param string|null $sca_exemption Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + * + * @return self + */ + public function setScaExemption($sca_exemption) + { + if (is_null($sca_exemption)) { + throw new \InvalidArgumentException('non-nullable sca_exemption cannot be null'); + } + $this->container['sca_exemption'] = $sca_exemption; + + return $this; + } + + /** + * Gets three_ds_version + * + * @return string|null + */ + public function getThreeDsVersion() + { + return $this->container['three_ds_version']; + } + + /** + * Sets three_ds_version + * + * @param string|null $three_ds_version Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. + * + * @return self + */ + public function setThreeDsVersion($three_ds_version) + { + if (is_null($three_ds_version)) { + throw new \InvalidArgumentException('non-nullable three_ds_version cannot be null'); + } + $this->container['three_ds_version'] = $three_ds_version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataAirline.php b/src/Adyen/Model/Checkout/AdditionalDataAirline.php new file mode 100644 index 000000000..7a6e05a74 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataAirline.php @@ -0,0 +1,1308 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataAirline Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataAirline implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataAirline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'airline_agency_invoice_number' => 'string', + 'airline_agency_plan_name' => 'string', + 'airline_airline_code' => 'string', + 'airline_airline_designator_code' => 'string', + 'airline_boarding_fee' => 'string', + 'airline_computerized_reservation_system' => 'string', + 'airline_customer_reference_number' => 'string', + 'airline_document_type' => 'string', + 'airline_flight_date' => 'string', + 'airline_leg_carrier_code' => 'string', + 'airline_leg_class_of_travel' => 'string', + 'airline_leg_date_of_travel' => 'string', + 'airline_leg_depart_airport' => 'string', + 'airline_leg_depart_tax' => 'string', + 'airline_leg_destination_code' => 'string', + 'airline_leg_fare_base_code' => 'string', + 'airline_leg_flight_number' => 'string', + 'airline_leg_stop_over_code' => 'string', + 'airline_passenger_date_of_birth' => 'string', + 'airline_passenger_first_name' => 'string', + 'airline_passenger_last_name' => 'string', + 'airline_passenger_telephone_number' => 'string', + 'airline_passenger_traveller_type' => 'string', + 'airline_passenger_name' => 'string', + 'airline_ticket_issue_address' => 'string', + 'airline_ticket_number' => 'string', + 'airline_travel_agency_code' => 'string', + 'airline_travel_agency_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'airline_agency_invoice_number' => null, + 'airline_agency_plan_name' => null, + 'airline_airline_code' => null, + 'airline_airline_designator_code' => null, + 'airline_boarding_fee' => null, + 'airline_computerized_reservation_system' => null, + 'airline_customer_reference_number' => null, + 'airline_document_type' => null, + 'airline_flight_date' => null, + 'airline_leg_carrier_code' => null, + 'airline_leg_class_of_travel' => null, + 'airline_leg_date_of_travel' => null, + 'airline_leg_depart_airport' => null, + 'airline_leg_depart_tax' => null, + 'airline_leg_destination_code' => null, + 'airline_leg_fare_base_code' => null, + 'airline_leg_flight_number' => null, + 'airline_leg_stop_over_code' => null, + 'airline_passenger_date_of_birth' => null, + 'airline_passenger_first_name' => null, + 'airline_passenger_last_name' => null, + 'airline_passenger_telephone_number' => null, + 'airline_passenger_traveller_type' => null, + 'airline_passenger_name' => null, + 'airline_ticket_issue_address' => null, + 'airline_ticket_number' => null, + 'airline_travel_agency_code' => null, + 'airline_travel_agency_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'airline_agency_invoice_number' => false, + 'airline_agency_plan_name' => false, + 'airline_airline_code' => false, + 'airline_airline_designator_code' => false, + 'airline_boarding_fee' => false, + 'airline_computerized_reservation_system' => false, + 'airline_customer_reference_number' => false, + 'airline_document_type' => false, + 'airline_flight_date' => false, + 'airline_leg_carrier_code' => false, + 'airline_leg_class_of_travel' => false, + 'airline_leg_date_of_travel' => false, + 'airline_leg_depart_airport' => false, + 'airline_leg_depart_tax' => false, + 'airline_leg_destination_code' => false, + 'airline_leg_fare_base_code' => false, + 'airline_leg_flight_number' => false, + 'airline_leg_stop_over_code' => false, + 'airline_passenger_date_of_birth' => false, + 'airline_passenger_first_name' => false, + 'airline_passenger_last_name' => false, + 'airline_passenger_telephone_number' => false, + 'airline_passenger_traveller_type' => false, + 'airline_passenger_name' => false, + 'airline_ticket_issue_address' => false, + 'airline_ticket_number' => false, + 'airline_travel_agency_code' => false, + 'airline_travel_agency_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'airline_agency_invoice_number' => 'airline.agency_invoice_number', + 'airline_agency_plan_name' => 'airline.agency_plan_name', + 'airline_airline_code' => 'airline.airline_code', + 'airline_airline_designator_code' => 'airline.airline_designator_code', + 'airline_boarding_fee' => 'airline.boarding_fee', + 'airline_computerized_reservation_system' => 'airline.computerized_reservation_system', + 'airline_customer_reference_number' => 'airline.customer_reference_number', + 'airline_document_type' => 'airline.document_type', + 'airline_flight_date' => 'airline.flight_date', + 'airline_leg_carrier_code' => 'airline.leg.carrier_code', + 'airline_leg_class_of_travel' => 'airline.leg.class_of_travel', + 'airline_leg_date_of_travel' => 'airline.leg.date_of_travel', + 'airline_leg_depart_airport' => 'airline.leg.depart_airport', + 'airline_leg_depart_tax' => 'airline.leg.depart_tax', + 'airline_leg_destination_code' => 'airline.leg.destination_code', + 'airline_leg_fare_base_code' => 'airline.leg.fare_base_code', + 'airline_leg_flight_number' => 'airline.leg.flight_number', + 'airline_leg_stop_over_code' => 'airline.leg.stop_over_code', + 'airline_passenger_date_of_birth' => 'airline.passenger.date_of_birth', + 'airline_passenger_first_name' => 'airline.passenger.first_name', + 'airline_passenger_last_name' => 'airline.passenger.last_name', + 'airline_passenger_telephone_number' => 'airline.passenger.telephone_number', + 'airline_passenger_traveller_type' => 'airline.passenger.traveller_type', + 'airline_passenger_name' => 'airline.passenger_name', + 'airline_ticket_issue_address' => 'airline.ticket_issue_address', + 'airline_ticket_number' => 'airline.ticket_number', + 'airline_travel_agency_code' => 'airline.travel_agency_code', + 'airline_travel_agency_name' => 'airline.travel_agency_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'airline_agency_invoice_number' => 'setAirlineAgencyInvoiceNumber', + 'airline_agency_plan_name' => 'setAirlineAgencyPlanName', + 'airline_airline_code' => 'setAirlineAirlineCode', + 'airline_airline_designator_code' => 'setAirlineAirlineDesignatorCode', + 'airline_boarding_fee' => 'setAirlineBoardingFee', + 'airline_computerized_reservation_system' => 'setAirlineComputerizedReservationSystem', + 'airline_customer_reference_number' => 'setAirlineCustomerReferenceNumber', + 'airline_document_type' => 'setAirlineDocumentType', + 'airline_flight_date' => 'setAirlineFlightDate', + 'airline_leg_carrier_code' => 'setAirlineLegCarrierCode', + 'airline_leg_class_of_travel' => 'setAirlineLegClassOfTravel', + 'airline_leg_date_of_travel' => 'setAirlineLegDateOfTravel', + 'airline_leg_depart_airport' => 'setAirlineLegDepartAirport', + 'airline_leg_depart_tax' => 'setAirlineLegDepartTax', + 'airline_leg_destination_code' => 'setAirlineLegDestinationCode', + 'airline_leg_fare_base_code' => 'setAirlineLegFareBaseCode', + 'airline_leg_flight_number' => 'setAirlineLegFlightNumber', + 'airline_leg_stop_over_code' => 'setAirlineLegStopOverCode', + 'airline_passenger_date_of_birth' => 'setAirlinePassengerDateOfBirth', + 'airline_passenger_first_name' => 'setAirlinePassengerFirstName', + 'airline_passenger_last_name' => 'setAirlinePassengerLastName', + 'airline_passenger_telephone_number' => 'setAirlinePassengerTelephoneNumber', + 'airline_passenger_traveller_type' => 'setAirlinePassengerTravellerType', + 'airline_passenger_name' => 'setAirlinePassengerName', + 'airline_ticket_issue_address' => 'setAirlineTicketIssueAddress', + 'airline_ticket_number' => 'setAirlineTicketNumber', + 'airline_travel_agency_code' => 'setAirlineTravelAgencyCode', + 'airline_travel_agency_name' => 'setAirlineTravelAgencyName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'airline_agency_invoice_number' => 'getAirlineAgencyInvoiceNumber', + 'airline_agency_plan_name' => 'getAirlineAgencyPlanName', + 'airline_airline_code' => 'getAirlineAirlineCode', + 'airline_airline_designator_code' => 'getAirlineAirlineDesignatorCode', + 'airline_boarding_fee' => 'getAirlineBoardingFee', + 'airline_computerized_reservation_system' => 'getAirlineComputerizedReservationSystem', + 'airline_customer_reference_number' => 'getAirlineCustomerReferenceNumber', + 'airline_document_type' => 'getAirlineDocumentType', + 'airline_flight_date' => 'getAirlineFlightDate', + 'airline_leg_carrier_code' => 'getAirlineLegCarrierCode', + 'airline_leg_class_of_travel' => 'getAirlineLegClassOfTravel', + 'airline_leg_date_of_travel' => 'getAirlineLegDateOfTravel', + 'airline_leg_depart_airport' => 'getAirlineLegDepartAirport', + 'airline_leg_depart_tax' => 'getAirlineLegDepartTax', + 'airline_leg_destination_code' => 'getAirlineLegDestinationCode', + 'airline_leg_fare_base_code' => 'getAirlineLegFareBaseCode', + 'airline_leg_flight_number' => 'getAirlineLegFlightNumber', + 'airline_leg_stop_over_code' => 'getAirlineLegStopOverCode', + 'airline_passenger_date_of_birth' => 'getAirlinePassengerDateOfBirth', + 'airline_passenger_first_name' => 'getAirlinePassengerFirstName', + 'airline_passenger_last_name' => 'getAirlinePassengerLastName', + 'airline_passenger_telephone_number' => 'getAirlinePassengerTelephoneNumber', + 'airline_passenger_traveller_type' => 'getAirlinePassengerTravellerType', + 'airline_passenger_name' => 'getAirlinePassengerName', + 'airline_ticket_issue_address' => 'getAirlineTicketIssueAddress', + 'airline_ticket_number' => 'getAirlineTicketNumber', + 'airline_travel_agency_code' => 'getAirlineTravelAgencyCode', + 'airline_travel_agency_name' => 'getAirlineTravelAgencyName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('airline_agency_invoice_number', $data ?? [], null); + $this->setIfExists('airline_agency_plan_name', $data ?? [], null); + $this->setIfExists('airline_airline_code', $data ?? [], null); + $this->setIfExists('airline_airline_designator_code', $data ?? [], null); + $this->setIfExists('airline_boarding_fee', $data ?? [], null); + $this->setIfExists('airline_computerized_reservation_system', $data ?? [], null); + $this->setIfExists('airline_customer_reference_number', $data ?? [], null); + $this->setIfExists('airline_document_type', $data ?? [], null); + $this->setIfExists('airline_flight_date', $data ?? [], null); + $this->setIfExists('airline_leg_carrier_code', $data ?? [], null); + $this->setIfExists('airline_leg_class_of_travel', $data ?? [], null); + $this->setIfExists('airline_leg_date_of_travel', $data ?? [], null); + $this->setIfExists('airline_leg_depart_airport', $data ?? [], null); + $this->setIfExists('airline_leg_depart_tax', $data ?? [], null); + $this->setIfExists('airline_leg_destination_code', $data ?? [], null); + $this->setIfExists('airline_leg_fare_base_code', $data ?? [], null); + $this->setIfExists('airline_leg_flight_number', $data ?? [], null); + $this->setIfExists('airline_leg_stop_over_code', $data ?? [], null); + $this->setIfExists('airline_passenger_date_of_birth', $data ?? [], null); + $this->setIfExists('airline_passenger_first_name', $data ?? [], null); + $this->setIfExists('airline_passenger_last_name', $data ?? [], null); + $this->setIfExists('airline_passenger_telephone_number', $data ?? [], null); + $this->setIfExists('airline_passenger_traveller_type', $data ?? [], null); + $this->setIfExists('airline_passenger_name', $data ?? [], null); + $this->setIfExists('airline_ticket_issue_address', $data ?? [], null); + $this->setIfExists('airline_ticket_number', $data ?? [], null); + $this->setIfExists('airline_travel_agency_code', $data ?? [], null); + $this->setIfExists('airline_travel_agency_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['airline_passenger_name'] === null) { + $invalidProperties[] = "'airline_passenger_name' 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 airline_agency_invoice_number + * + * @return string|null + */ + public function getAirlineAgencyInvoiceNumber() + { + return $this->container['airline_agency_invoice_number']; + } + + /** + * Sets airline_agency_invoice_number + * + * @param string|null $airline_agency_invoice_number Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 + * + * @return self + */ + public function setAirlineAgencyInvoiceNumber($airline_agency_invoice_number) + { + if (is_null($airline_agency_invoice_number)) { + throw new \InvalidArgumentException('non-nullable airline_agency_invoice_number cannot be null'); + } + $this->container['airline_agency_invoice_number'] = $airline_agency_invoice_number; + + return $this; + } + + /** + * Gets airline_agency_plan_name + * + * @return string|null + */ + public function getAirlineAgencyPlanName() + { + return $this->container['airline_agency_plan_name']; + } + + /** + * Sets airline_agency_plan_name + * + * @param string|null $airline_agency_plan_name 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineAgencyPlanName($airline_agency_plan_name) + { + if (is_null($airline_agency_plan_name)) { + throw new \InvalidArgumentException('non-nullable airline_agency_plan_name cannot be null'); + } + $this->container['airline_agency_plan_name'] = $airline_agency_plan_name; + + return $this; + } + + /** + * Gets airline_airline_code + * + * @return string|null + */ + public function getAirlineAirlineCode() + { + return $this->container['airline_airline_code']; + } + + /** + * Sets airline_airline_code + * + * @param string|null $airline_airline_code [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 + * + * @return self + */ + public function setAirlineAirlineCode($airline_airline_code) + { + if (is_null($airline_airline_code)) { + throw new \InvalidArgumentException('non-nullable airline_airline_code cannot be null'); + } + $this->container['airline_airline_code'] = $airline_airline_code; + + return $this; + } + + /** + * Gets airline_airline_designator_code + * + * @return string|null + */ + public function getAirlineAirlineDesignatorCode() + { + return $this->container['airline_airline_designator_code']; + } + + /** + * Sets airline_airline_designator_code + * + * @param string|null $airline_airline_designator_code [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineAirlineDesignatorCode($airline_airline_designator_code) + { + if (is_null($airline_airline_designator_code)) { + throw new \InvalidArgumentException('non-nullable airline_airline_designator_code cannot be null'); + } + $this->container['airline_airline_designator_code'] = $airline_airline_designator_code; + + return $this; + } + + /** + * Gets airline_boarding_fee + * + * @return string|null + */ + public function getAirlineBoardingFee() + { + return $this->container['airline_boarding_fee']; + } + + /** + * Sets airline_boarding_fee + * + * @param string|null $airline_boarding_fee Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 + * + * @return self + */ + public function setAirlineBoardingFee($airline_boarding_fee) + { + if (is_null($airline_boarding_fee)) { + throw new \InvalidArgumentException('non-nullable airline_boarding_fee cannot be null'); + } + $this->container['airline_boarding_fee'] = $airline_boarding_fee; + + return $this; + } + + /** + * Gets airline_computerized_reservation_system + * + * @return string|null + */ + public function getAirlineComputerizedReservationSystem() + { + return $this->container['airline_computerized_reservation_system']; + } + + /** + * Sets airline_computerized_reservation_system + * + * @param string|null $airline_computerized_reservation_system The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 + * + * @return self + */ + public function setAirlineComputerizedReservationSystem($airline_computerized_reservation_system) + { + if (is_null($airline_computerized_reservation_system)) { + throw new \InvalidArgumentException('non-nullable airline_computerized_reservation_system cannot be null'); + } + $this->container['airline_computerized_reservation_system'] = $airline_computerized_reservation_system; + + return $this; + } + + /** + * Gets airline_customer_reference_number + * + * @return string|null + */ + public function getAirlineCustomerReferenceNumber() + { + return $this->container['airline_customer_reference_number']; + } + + /** + * Sets airline_customer_reference_number + * + * @param string|null $airline_customer_reference_number Reference number; alphanumeric. * minLength: 0 * maxLength: 20 + * + * @return self + */ + public function setAirlineCustomerReferenceNumber($airline_customer_reference_number) + { + if (is_null($airline_customer_reference_number)) { + throw new \InvalidArgumentException('non-nullable airline_customer_reference_number cannot be null'); + } + $this->container['airline_customer_reference_number'] = $airline_customer_reference_number; + + return $this; + } + + /** + * Gets airline_document_type + * + * @return string|null + */ + public function getAirlineDocumentType() + { + return $this->container['airline_document_type']; + } + + /** + * Sets airline_document_type + * + * @param string|null $airline_document_type Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineDocumentType($airline_document_type) + { + if (is_null($airline_document_type)) { + throw new \InvalidArgumentException('non-nullable airline_document_type cannot be null'); + } + $this->container['airline_document_type'] = $airline_document_type; + + return $this; + } + + /** + * Gets airline_flight_date + * + * @return string|null + */ + public function getAirlineFlightDate() + { + return $this->container['airline_flight_date']; + } + + /** + * Sets airline_flight_date + * + * @param string|null $airline_flight_date Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 + * + * @return self + */ + public function setAirlineFlightDate($airline_flight_date) + { + if (is_null($airline_flight_date)) { + throw new \InvalidArgumentException('non-nullable airline_flight_date cannot be null'); + } + $this->container['airline_flight_date'] = $airline_flight_date; + + return $this; + } + + /** + * Gets airline_leg_carrier_code + * + * @return string|null + */ + public function getAirlineLegCarrierCode() + { + return $this->container['airline_leg_carrier_code']; + } + + /** + * Sets airline_leg_carrier_code + * + * @param string|null $airline_leg_carrier_code [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineLegCarrierCode($airline_leg_carrier_code) + { + if (is_null($airline_leg_carrier_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_carrier_code cannot be null'); + } + $this->container['airline_leg_carrier_code'] = $airline_leg_carrier_code; + + return $this; + } + + /** + * Gets airline_leg_class_of_travel + * + * @return string|null + */ + public function getAirlineLegClassOfTravel() + { + return $this->container['airline_leg_class_of_travel']; + } + + /** + * Sets airline_leg_class_of_travel + * + * @param string|null $airline_leg_class_of_travel 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 + * + * @return self + */ + public function setAirlineLegClassOfTravel($airline_leg_class_of_travel) + { + if (is_null($airline_leg_class_of_travel)) { + throw new \InvalidArgumentException('non-nullable airline_leg_class_of_travel cannot be null'); + } + $this->container['airline_leg_class_of_travel'] = $airline_leg_class_of_travel; + + return $this; + } + + /** + * Gets airline_leg_date_of_travel + * + * @return string|null + */ + public function getAirlineLegDateOfTravel() + { + return $this->container['airline_leg_date_of_travel']; + } + + /** + * Sets airline_leg_date_of_travel + * + * @param string|null $airline_leg_date_of_travel Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 + * + * @return self + */ + public function setAirlineLegDateOfTravel($airline_leg_date_of_travel) + { + if (is_null($airline_leg_date_of_travel)) { + throw new \InvalidArgumentException('non-nullable airline_leg_date_of_travel cannot be null'); + } + $this->container['airline_leg_date_of_travel'] = $airline_leg_date_of_travel; + + return $this; + } + + /** + * Gets airline_leg_depart_airport + * + * @return string|null + */ + public function getAirlineLegDepartAirport() + { + return $this->container['airline_leg_depart_airport']; + } + + /** + * Sets airline_leg_depart_airport + * + * @param string|null $airline_leg_depart_airport Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * + * @return self + */ + public function setAirlineLegDepartAirport($airline_leg_depart_airport) + { + if (is_null($airline_leg_depart_airport)) { + throw new \InvalidArgumentException('non-nullable airline_leg_depart_airport cannot be null'); + } + $this->container['airline_leg_depart_airport'] = $airline_leg_depart_airport; + + return $this; + } + + /** + * Gets airline_leg_depart_tax + * + * @return string|null + */ + public function getAirlineLegDepartTax() + { + return $this->container['airline_leg_depart_tax']; + } + + /** + * Sets airline_leg_depart_tax + * + * @param string|null $airline_leg_depart_tax [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 + * + * @return self + */ + public function setAirlineLegDepartTax($airline_leg_depart_tax) + { + if (is_null($airline_leg_depart_tax)) { + throw new \InvalidArgumentException('non-nullable airline_leg_depart_tax cannot be null'); + } + $this->container['airline_leg_depart_tax'] = $airline_leg_depart_tax; + + return $this; + } + + /** + * Gets airline_leg_destination_code + * + * @return string|null + */ + public function getAirlineLegDestinationCode() + { + return $this->container['airline_leg_destination_code']; + } + + /** + * Sets airline_leg_destination_code + * + * @param string|null $airline_leg_destination_code Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * + * @return self + */ + public function setAirlineLegDestinationCode($airline_leg_destination_code) + { + if (is_null($airline_leg_destination_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_destination_code cannot be null'); + } + $this->container['airline_leg_destination_code'] = $airline_leg_destination_code; + + return $this; + } + + /** + * Gets airline_leg_fare_base_code + * + * @return string|null + */ + public function getAirlineLegFareBaseCode() + { + return $this->container['airline_leg_fare_base_code']; + } + + /** + * Sets airline_leg_fare_base_code + * + * @param string|null $airline_leg_fare_base_code [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 + * + * @return self + */ + public function setAirlineLegFareBaseCode($airline_leg_fare_base_code) + { + if (is_null($airline_leg_fare_base_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_fare_base_code cannot be null'); + } + $this->container['airline_leg_fare_base_code'] = $airline_leg_fare_base_code; + + return $this; + } + + /** + * Gets airline_leg_flight_number + * + * @return string|null + */ + public function getAirlineLegFlightNumber() + { + return $this->container['airline_leg_flight_number']; + } + + /** + * Sets airline_leg_flight_number + * + * @param string|null $airline_leg_flight_number The flight identifier. * minLength: 1 * maxLength: 5 + * + * @return self + */ + public function setAirlineLegFlightNumber($airline_leg_flight_number) + { + if (is_null($airline_leg_flight_number)) { + throw new \InvalidArgumentException('non-nullable airline_leg_flight_number cannot be null'); + } + $this->container['airline_leg_flight_number'] = $airline_leg_flight_number; + + return $this; + } + + /** + * Gets airline_leg_stop_over_code + * + * @return string|null + */ + public function getAirlineLegStopOverCode() + { + return $this->container['airline_leg_stop_over_code']; + } + + /** + * Sets airline_leg_stop_over_code + * + * @param string|null $airline_leg_stop_over_code 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 + * + * @return self + */ + public function setAirlineLegStopOverCode($airline_leg_stop_over_code) + { + if (is_null($airline_leg_stop_over_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_stop_over_code cannot be null'); + } + $this->container['airline_leg_stop_over_code'] = $airline_leg_stop_over_code; + + return $this; + } + + /** + * Gets airline_passenger_date_of_birth + * + * @return string|null + */ + public function getAirlinePassengerDateOfBirth() + { + return $this->container['airline_passenger_date_of_birth']; + } + + /** + * Sets airline_passenger_date_of_birth + * + * @param string|null $airline_passenger_date_of_birth Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + * + * @return self + */ + public function setAirlinePassengerDateOfBirth($airline_passenger_date_of_birth) + { + if (is_null($airline_passenger_date_of_birth)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_date_of_birth cannot be null'); + } + $this->container['airline_passenger_date_of_birth'] = $airline_passenger_date_of_birth; + + return $this; + } + + /** + * Gets airline_passenger_first_name + * + * @return string|null + */ + public function getAirlinePassengerFirstName() + { + return $this->container['airline_passenger_first_name']; + } + + /** + * Sets airline_passenger_first_name + * + * @param string|null $airline_passenger_first_name Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * + * @return self + */ + public function setAirlinePassengerFirstName($airline_passenger_first_name) + { + if (is_null($airline_passenger_first_name)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_first_name cannot be null'); + } + $this->container['airline_passenger_first_name'] = $airline_passenger_first_name; + + return $this; + } + + /** + * Gets airline_passenger_last_name + * + * @return string|null + */ + public function getAirlinePassengerLastName() + { + return $this->container['airline_passenger_last_name']; + } + + /** + * Sets airline_passenger_last_name + * + * @param string|null $airline_passenger_last_name Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * + * @return self + */ + public function setAirlinePassengerLastName($airline_passenger_last_name) + { + if (is_null($airline_passenger_last_name)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_last_name cannot be null'); + } + $this->container['airline_passenger_last_name'] = $airline_passenger_last_name; + + return $this; + } + + /** + * Gets airline_passenger_telephone_number + * + * @return string|null + */ + public function getAirlinePassengerTelephoneNumber() + { + return $this->container['airline_passenger_telephone_number']; + } + + /** + * Sets airline_passenger_telephone_number + * + * @param string|null $airline_passenger_telephone_number Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30 + * + * @return self + */ + public function setAirlinePassengerTelephoneNumber($airline_passenger_telephone_number) + { + if (is_null($airline_passenger_telephone_number)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_telephone_number cannot be null'); + } + $this->container['airline_passenger_telephone_number'] = $airline_passenger_telephone_number; + + return $this; + } + + /** + * Gets airline_passenger_traveller_type + * + * @return string|null + */ + public function getAirlinePassengerTravellerType() + { + return $this->container['airline_passenger_traveller_type']; + } + + /** + * Sets airline_passenger_traveller_type + * + * @param string|null $airline_passenger_traveller_type Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 + * + * @return self + */ + public function setAirlinePassengerTravellerType($airline_passenger_traveller_type) + { + if (is_null($airline_passenger_traveller_type)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_traveller_type cannot be null'); + } + $this->container['airline_passenger_traveller_type'] = $airline_passenger_traveller_type; + + return $this; + } + + /** + * Gets airline_passenger_name + * + * @return string + */ + public function getAirlinePassengerName() + { + return $this->container['airline_passenger_name']; + } + + /** + * Sets airline_passenger_name + * + * @param string $airline_passenger_name Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 + * + * @return self + */ + public function setAirlinePassengerName($airline_passenger_name) + { + if (is_null($airline_passenger_name)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_name cannot be null'); + } + $this->container['airline_passenger_name'] = $airline_passenger_name; + + return $this; + } + + /** + * Gets airline_ticket_issue_address + * + * @return string|null + */ + public function getAirlineTicketIssueAddress() + { + return $this->container['airline_ticket_issue_address']; + } + + /** + * Sets airline_ticket_issue_address + * + * @param string|null $airline_ticket_issue_address Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 + * + * @return self + */ + public function setAirlineTicketIssueAddress($airline_ticket_issue_address) + { + if (is_null($airline_ticket_issue_address)) { + throw new \InvalidArgumentException('non-nullable airline_ticket_issue_address cannot be null'); + } + $this->container['airline_ticket_issue_address'] = $airline_ticket_issue_address; + + return $this; + } + + /** + * Gets airline_ticket_number + * + * @return string|null + */ + public function getAirlineTicketNumber() + { + return $this->container['airline_ticket_number']; + } + + /** + * Sets airline_ticket_number + * + * @param string|null $airline_ticket_number The ticket's unique identifier. * minLength: 1 * maxLength: 150 + * + * @return self + */ + public function setAirlineTicketNumber($airline_ticket_number) + { + if (is_null($airline_ticket_number)) { + throw new \InvalidArgumentException('non-nullable airline_ticket_number cannot be null'); + } + $this->container['airline_ticket_number'] = $airline_ticket_number; + + return $this; + } + + /** + * Gets airline_travel_agency_code + * + * @return string|null + */ + public function getAirlineTravelAgencyCode() + { + return $this->container['airline_travel_agency_code']; + } + + /** + * Sets airline_travel_agency_code + * + * @param string|null $airline_travel_agency_code IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 + * + * @return self + */ + public function setAirlineTravelAgencyCode($airline_travel_agency_code) + { + if (is_null($airline_travel_agency_code)) { + throw new \InvalidArgumentException('non-nullable airline_travel_agency_code cannot be null'); + } + $this->container['airline_travel_agency_code'] = $airline_travel_agency_code; + + return $this; + } + + /** + * Gets airline_travel_agency_name + * + * @return string|null + */ + public function getAirlineTravelAgencyName() + { + return $this->container['airline_travel_agency_name']; + } + + /** + * Sets airline_travel_agency_name + * + * @param string|null $airline_travel_agency_name The name of the travel agency. * minLength: 1 * maxLength: 25 + * + * @return self + */ + public function setAirlineTravelAgencyName($airline_travel_agency_name) + { + if (is_null($airline_travel_agency_name)) { + throw new \InvalidArgumentException('non-nullable airline_travel_agency_name cannot be null'); + } + $this->container['airline_travel_agency_name'] = $airline_travel_agency_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataCarRental.php b/src/Adyen/Model/Checkout/AdditionalDataCarRental.php new file mode 100644 index 000000000..a08d18522 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataCarRental.php @@ -0,0 +1,1135 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataCarRental Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataCarRental implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataCarRental'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'car_rental_check_out_date' => 'string', + 'car_rental_customer_service_toll_free_number' => 'string', + 'car_rental_days_rented' => 'string', + 'car_rental_fuel_charges' => 'string', + 'car_rental_insurance_charges' => 'string', + 'car_rental_location_city' => 'string', + 'car_rental_location_country' => 'string', + 'car_rental_location_state_province' => 'string', + 'car_rental_no_show_indicator' => 'string', + 'car_rental_one_way_drop_off_charges' => 'string', + 'car_rental_rate' => 'string', + 'car_rental_rate_indicator' => 'string', + 'car_rental_rental_agreement_number' => 'string', + 'car_rental_rental_class_id' => 'string', + 'car_rental_renter_name' => 'string', + 'car_rental_return_city' => 'string', + 'car_rental_return_country' => 'string', + 'car_rental_return_date' => 'string', + 'car_rental_return_location_id' => 'string', + 'car_rental_return_state_province' => 'string', + 'car_rental_tax_exempt_indicator' => 'string', + 'travel_entertainment_auth_data_duration' => 'string', + 'travel_entertainment_auth_data_market' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'car_rental_check_out_date' => null, + 'car_rental_customer_service_toll_free_number' => null, + 'car_rental_days_rented' => null, + 'car_rental_fuel_charges' => null, + 'car_rental_insurance_charges' => null, + 'car_rental_location_city' => null, + 'car_rental_location_country' => null, + 'car_rental_location_state_province' => null, + 'car_rental_no_show_indicator' => null, + 'car_rental_one_way_drop_off_charges' => null, + 'car_rental_rate' => null, + 'car_rental_rate_indicator' => null, + 'car_rental_rental_agreement_number' => null, + 'car_rental_rental_class_id' => null, + 'car_rental_renter_name' => null, + 'car_rental_return_city' => null, + 'car_rental_return_country' => null, + 'car_rental_return_date' => null, + 'car_rental_return_location_id' => null, + 'car_rental_return_state_province' => null, + 'car_rental_tax_exempt_indicator' => null, + 'travel_entertainment_auth_data_duration' => null, + 'travel_entertainment_auth_data_market' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'car_rental_check_out_date' => false, + 'car_rental_customer_service_toll_free_number' => false, + 'car_rental_days_rented' => false, + 'car_rental_fuel_charges' => false, + 'car_rental_insurance_charges' => false, + 'car_rental_location_city' => false, + 'car_rental_location_country' => false, + 'car_rental_location_state_province' => false, + 'car_rental_no_show_indicator' => false, + 'car_rental_one_way_drop_off_charges' => false, + 'car_rental_rate' => false, + 'car_rental_rate_indicator' => false, + 'car_rental_rental_agreement_number' => false, + 'car_rental_rental_class_id' => false, + 'car_rental_renter_name' => false, + 'car_rental_return_city' => false, + 'car_rental_return_country' => false, + 'car_rental_return_date' => false, + 'car_rental_return_location_id' => false, + 'car_rental_return_state_province' => false, + 'car_rental_tax_exempt_indicator' => false, + 'travel_entertainment_auth_data_duration' => false, + 'travel_entertainment_auth_data_market' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'car_rental_check_out_date' => 'carRental.checkOutDate', + 'car_rental_customer_service_toll_free_number' => 'carRental.customerServiceTollFreeNumber', + 'car_rental_days_rented' => 'carRental.daysRented', + 'car_rental_fuel_charges' => 'carRental.fuelCharges', + 'car_rental_insurance_charges' => 'carRental.insuranceCharges', + 'car_rental_location_city' => 'carRental.locationCity', + 'car_rental_location_country' => 'carRental.locationCountry', + 'car_rental_location_state_province' => 'carRental.locationStateProvince', + 'car_rental_no_show_indicator' => 'carRental.noShowIndicator', + 'car_rental_one_way_drop_off_charges' => 'carRental.oneWayDropOffCharges', + 'car_rental_rate' => 'carRental.rate', + 'car_rental_rate_indicator' => 'carRental.rateIndicator', + 'car_rental_rental_agreement_number' => 'carRental.rentalAgreementNumber', + 'car_rental_rental_class_id' => 'carRental.rentalClassId', + 'car_rental_renter_name' => 'carRental.renterName', + 'car_rental_return_city' => 'carRental.returnCity', + 'car_rental_return_country' => 'carRental.returnCountry', + 'car_rental_return_date' => 'carRental.returnDate', + 'car_rental_return_location_id' => 'carRental.returnLocationId', + 'car_rental_return_state_province' => 'carRental.returnStateProvince', + 'car_rental_tax_exempt_indicator' => 'carRental.taxExemptIndicator', + 'travel_entertainment_auth_data_duration' => 'travelEntertainmentAuthData.duration', + 'travel_entertainment_auth_data_market' => 'travelEntertainmentAuthData.market' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'car_rental_check_out_date' => 'setCarRentalCheckOutDate', + 'car_rental_customer_service_toll_free_number' => 'setCarRentalCustomerServiceTollFreeNumber', + 'car_rental_days_rented' => 'setCarRentalDaysRented', + 'car_rental_fuel_charges' => 'setCarRentalFuelCharges', + 'car_rental_insurance_charges' => 'setCarRentalInsuranceCharges', + 'car_rental_location_city' => 'setCarRentalLocationCity', + 'car_rental_location_country' => 'setCarRentalLocationCountry', + 'car_rental_location_state_province' => 'setCarRentalLocationStateProvince', + 'car_rental_no_show_indicator' => 'setCarRentalNoShowIndicator', + 'car_rental_one_way_drop_off_charges' => 'setCarRentalOneWayDropOffCharges', + 'car_rental_rate' => 'setCarRentalRate', + 'car_rental_rate_indicator' => 'setCarRentalRateIndicator', + 'car_rental_rental_agreement_number' => 'setCarRentalRentalAgreementNumber', + 'car_rental_rental_class_id' => 'setCarRentalRentalClassId', + 'car_rental_renter_name' => 'setCarRentalRenterName', + 'car_rental_return_city' => 'setCarRentalReturnCity', + 'car_rental_return_country' => 'setCarRentalReturnCountry', + 'car_rental_return_date' => 'setCarRentalReturnDate', + 'car_rental_return_location_id' => 'setCarRentalReturnLocationId', + 'car_rental_return_state_province' => 'setCarRentalReturnStateProvince', + 'car_rental_tax_exempt_indicator' => 'setCarRentalTaxExemptIndicator', + 'travel_entertainment_auth_data_duration' => 'setTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'setTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'car_rental_check_out_date' => 'getCarRentalCheckOutDate', + 'car_rental_customer_service_toll_free_number' => 'getCarRentalCustomerServiceTollFreeNumber', + 'car_rental_days_rented' => 'getCarRentalDaysRented', + 'car_rental_fuel_charges' => 'getCarRentalFuelCharges', + 'car_rental_insurance_charges' => 'getCarRentalInsuranceCharges', + 'car_rental_location_city' => 'getCarRentalLocationCity', + 'car_rental_location_country' => 'getCarRentalLocationCountry', + 'car_rental_location_state_province' => 'getCarRentalLocationStateProvince', + 'car_rental_no_show_indicator' => 'getCarRentalNoShowIndicator', + 'car_rental_one_way_drop_off_charges' => 'getCarRentalOneWayDropOffCharges', + 'car_rental_rate' => 'getCarRentalRate', + 'car_rental_rate_indicator' => 'getCarRentalRateIndicator', + 'car_rental_rental_agreement_number' => 'getCarRentalRentalAgreementNumber', + 'car_rental_rental_class_id' => 'getCarRentalRentalClassId', + 'car_rental_renter_name' => 'getCarRentalRenterName', + 'car_rental_return_city' => 'getCarRentalReturnCity', + 'car_rental_return_country' => 'getCarRentalReturnCountry', + 'car_rental_return_date' => 'getCarRentalReturnDate', + 'car_rental_return_location_id' => 'getCarRentalReturnLocationId', + 'car_rental_return_state_province' => 'getCarRentalReturnStateProvince', + 'car_rental_tax_exempt_indicator' => 'getCarRentalTaxExemptIndicator', + 'travel_entertainment_auth_data_duration' => 'getTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'getTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('car_rental_check_out_date', $data ?? [], null); + $this->setIfExists('car_rental_customer_service_toll_free_number', $data ?? [], null); + $this->setIfExists('car_rental_days_rented', $data ?? [], null); + $this->setIfExists('car_rental_fuel_charges', $data ?? [], null); + $this->setIfExists('car_rental_insurance_charges', $data ?? [], null); + $this->setIfExists('car_rental_location_city', $data ?? [], null); + $this->setIfExists('car_rental_location_country', $data ?? [], null); + $this->setIfExists('car_rental_location_state_province', $data ?? [], null); + $this->setIfExists('car_rental_no_show_indicator', $data ?? [], null); + $this->setIfExists('car_rental_one_way_drop_off_charges', $data ?? [], null); + $this->setIfExists('car_rental_rate', $data ?? [], null); + $this->setIfExists('car_rental_rate_indicator', $data ?? [], null); + $this->setIfExists('car_rental_rental_agreement_number', $data ?? [], null); + $this->setIfExists('car_rental_rental_class_id', $data ?? [], null); + $this->setIfExists('car_rental_renter_name', $data ?? [], null); + $this->setIfExists('car_rental_return_city', $data ?? [], null); + $this->setIfExists('car_rental_return_country', $data ?? [], null); + $this->setIfExists('car_rental_return_date', $data ?? [], null); + $this->setIfExists('car_rental_return_location_id', $data ?? [], null); + $this->setIfExists('car_rental_return_state_province', $data ?? [], null); + $this->setIfExists('car_rental_tax_exempt_indicator', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_duration', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_market', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets car_rental_check_out_date + * + * @return string|null + */ + public function getCarRentalCheckOutDate() + { + return $this->container['car_rental_check_out_date']; + } + + /** + * Sets car_rental_check_out_date + * + * @param string|null $car_rental_check_out_date Pick-up date. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setCarRentalCheckOutDate($car_rental_check_out_date) + { + if (is_null($car_rental_check_out_date)) { + throw new \InvalidArgumentException('non-nullable car_rental_check_out_date cannot be null'); + } + $this->container['car_rental_check_out_date'] = $car_rental_check_out_date; + + return $this; + } + + /** + * Gets car_rental_customer_service_toll_free_number + * + * @return string|null + */ + public function getCarRentalCustomerServiceTollFreeNumber() + { + return $this->container['car_rental_customer_service_toll_free_number']; + } + + /** + * Sets car_rental_customer_service_toll_free_number + * + * @param string|null $car_rental_customer_service_toll_free_number The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 + * + * @return self + */ + public function setCarRentalCustomerServiceTollFreeNumber($car_rental_customer_service_toll_free_number) + { + if (is_null($car_rental_customer_service_toll_free_number)) { + throw new \InvalidArgumentException('non-nullable car_rental_customer_service_toll_free_number cannot be null'); + } + $this->container['car_rental_customer_service_toll_free_number'] = $car_rental_customer_service_toll_free_number; + + return $this; + } + + /** + * Gets car_rental_days_rented + * + * @return string|null + */ + public function getCarRentalDaysRented() + { + return $this->container['car_rental_days_rented']; + } + + /** + * Sets car_rental_days_rented + * + * @param string|null $car_rental_days_rented Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 + * + * @return self + */ + public function setCarRentalDaysRented($car_rental_days_rented) + { + if (is_null($car_rental_days_rented)) { + throw new \InvalidArgumentException('non-nullable car_rental_days_rented cannot be null'); + } + $this->container['car_rental_days_rented'] = $car_rental_days_rented; + + return $this; + } + + /** + * Gets car_rental_fuel_charges + * + * @return string|null + */ + public function getCarRentalFuelCharges() + { + return $this->container['car_rental_fuel_charges']; + } + + /** + * Sets car_rental_fuel_charges + * + * @param string|null $car_rental_fuel_charges Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalFuelCharges($car_rental_fuel_charges) + { + if (is_null($car_rental_fuel_charges)) { + throw new \InvalidArgumentException('non-nullable car_rental_fuel_charges cannot be null'); + } + $this->container['car_rental_fuel_charges'] = $car_rental_fuel_charges; + + return $this; + } + + /** + * Gets car_rental_insurance_charges + * + * @return string|null + */ + public function getCarRentalInsuranceCharges() + { + return $this->container['car_rental_insurance_charges']; + } + + /** + * Sets car_rental_insurance_charges + * + * @param string|null $car_rental_insurance_charges Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalInsuranceCharges($car_rental_insurance_charges) + { + if (is_null($car_rental_insurance_charges)) { + throw new \InvalidArgumentException('non-nullable car_rental_insurance_charges cannot be null'); + } + $this->container['car_rental_insurance_charges'] = $car_rental_insurance_charges; + + return $this; + } + + /** + * Gets car_rental_location_city + * + * @return string|null + */ + public function getCarRentalLocationCity() + { + return $this->container['car_rental_location_city']; + } + + /** + * Sets car_rental_location_city + * + * @param string|null $car_rental_location_city The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 + * + * @return self + */ + public function setCarRentalLocationCity($car_rental_location_city) + { + if (is_null($car_rental_location_city)) { + throw new \InvalidArgumentException('non-nullable car_rental_location_city cannot be null'); + } + $this->container['car_rental_location_city'] = $car_rental_location_city; + + return $this; + } + + /** + * Gets car_rental_location_country + * + * @return string|null + */ + public function getCarRentalLocationCountry() + { + return $this->container['car_rental_location_country']; + } + + /** + * Sets car_rental_location_country + * + * @param string|null $car_rental_location_country The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 + * + * @return self + */ + public function setCarRentalLocationCountry($car_rental_location_country) + { + if (is_null($car_rental_location_country)) { + throw new \InvalidArgumentException('non-nullable car_rental_location_country cannot be null'); + } + $this->container['car_rental_location_country'] = $car_rental_location_country; + + return $this; + } + + /** + * Gets car_rental_location_state_province + * + * @return string|null + */ + public function getCarRentalLocationStateProvince() + { + return $this->container['car_rental_location_state_province']; + } + + /** + * Sets car_rental_location_state_province + * + * @param string|null $car_rental_location_state_province The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 + * + * @return self + */ + public function setCarRentalLocationStateProvince($car_rental_location_state_province) + { + if (is_null($car_rental_location_state_province)) { + throw new \InvalidArgumentException('non-nullable car_rental_location_state_province cannot be null'); + } + $this->container['car_rental_location_state_province'] = $car_rental_location_state_province; + + return $this; + } + + /** + * Gets car_rental_no_show_indicator + * + * @return string|null + */ + public function getCarRentalNoShowIndicator() + { + return $this->container['car_rental_no_show_indicator']; + } + + /** + * Sets car_rental_no_show_indicator + * + * @param string|null $car_rental_no_show_indicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. + * + * @return self + */ + public function setCarRentalNoShowIndicator($car_rental_no_show_indicator) + { + if (is_null($car_rental_no_show_indicator)) { + throw new \InvalidArgumentException('non-nullable car_rental_no_show_indicator cannot be null'); + } + $this->container['car_rental_no_show_indicator'] = $car_rental_no_show_indicator; + + return $this; + } + + /** + * Gets car_rental_one_way_drop_off_charges + * + * @return string|null + */ + public function getCarRentalOneWayDropOffCharges() + { + return $this->container['car_rental_one_way_drop_off_charges']; + } + + /** + * Sets car_rental_one_way_drop_off_charges + * + * @param string|null $car_rental_one_way_drop_off_charges Charge associated with not returning a vehicle to the original rental location. + * + * @return self + */ + public function setCarRentalOneWayDropOffCharges($car_rental_one_way_drop_off_charges) + { + if (is_null($car_rental_one_way_drop_off_charges)) { + throw new \InvalidArgumentException('non-nullable car_rental_one_way_drop_off_charges cannot be null'); + } + $this->container['car_rental_one_way_drop_off_charges'] = $car_rental_one_way_drop_off_charges; + + return $this; + } + + /** + * Gets car_rental_rate + * + * @return string|null + */ + public function getCarRentalRate() + { + return $this->container['car_rental_rate']; + } + + /** + * Sets car_rental_rate + * + * @param string|null $car_rental_rate Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalRate($car_rental_rate) + { + if (is_null($car_rental_rate)) { + throw new \InvalidArgumentException('non-nullable car_rental_rate cannot be null'); + } + $this->container['car_rental_rate'] = $car_rental_rate; + + return $this; + } + + /** + * Gets car_rental_rate_indicator + * + * @return string|null + */ + public function getCarRentalRateIndicator() + { + return $this->container['car_rental_rate_indicator']; + } + + /** + * Sets car_rental_rate_indicator + * + * @param string|null $car_rental_rate_indicator Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. + * + * @return self + */ + public function setCarRentalRateIndicator($car_rental_rate_indicator) + { + if (is_null($car_rental_rate_indicator)) { + throw new \InvalidArgumentException('non-nullable car_rental_rate_indicator cannot be null'); + } + $this->container['car_rental_rate_indicator'] = $car_rental_rate_indicator; + + return $this; + } + + /** + * Gets car_rental_rental_agreement_number + * + * @return string|null + */ + public function getCarRentalRentalAgreementNumber() + { + return $this->container['car_rental_rental_agreement_number']; + } + + /** + * Sets car_rental_rental_agreement_number + * + * @param string|null $car_rental_rental_agreement_number The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 + * + * @return self + */ + public function setCarRentalRentalAgreementNumber($car_rental_rental_agreement_number) + { + if (is_null($car_rental_rental_agreement_number)) { + throw new \InvalidArgumentException('non-nullable car_rental_rental_agreement_number cannot be null'); + } + $this->container['car_rental_rental_agreement_number'] = $car_rental_rental_agreement_number; + + return $this; + } + + /** + * Gets car_rental_rental_class_id + * + * @return string|null + */ + public function getCarRentalRentalClassId() + { + return $this->container['car_rental_rental_class_id']; + } + + /** + * Sets car_rental_rental_class_id + * + * @param string|null $car_rental_rental_class_id Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalRentalClassId($car_rental_rental_class_id) + { + if (is_null($car_rental_rental_class_id)) { + throw new \InvalidArgumentException('non-nullable car_rental_rental_class_id cannot be null'); + } + $this->container['car_rental_rental_class_id'] = $car_rental_rental_class_id; + + return $this; + } + + /** + * Gets car_rental_renter_name + * + * @return string|null + */ + public function getCarRentalRenterName() + { + return $this->container['car_rental_renter_name']; + } + + /** + * Sets car_rental_renter_name + * + * @param string|null $car_rental_renter_name The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 + * + * @return self + */ + public function setCarRentalRenterName($car_rental_renter_name) + { + if (is_null($car_rental_renter_name)) { + throw new \InvalidArgumentException('non-nullable car_rental_renter_name cannot be null'); + } + $this->container['car_rental_renter_name'] = $car_rental_renter_name; + + return $this; + } + + /** + * Gets car_rental_return_city + * + * @return string|null + */ + public function getCarRentalReturnCity() + { + return $this->container['car_rental_return_city']; + } + + /** + * Sets car_rental_return_city + * + * @param string|null $car_rental_return_city The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 + * + * @return self + */ + public function setCarRentalReturnCity($car_rental_return_city) + { + if (is_null($car_rental_return_city)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_city cannot be null'); + } + $this->container['car_rental_return_city'] = $car_rental_return_city; + + return $this; + } + + /** + * Gets car_rental_return_country + * + * @return string|null + */ + public function getCarRentalReturnCountry() + { + return $this->container['car_rental_return_country']; + } + + /** + * Sets car_rental_return_country + * + * @param string|null $car_rental_return_country The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 + * + * @return self + */ + public function setCarRentalReturnCountry($car_rental_return_country) + { + if (is_null($car_rental_return_country)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_country cannot be null'); + } + $this->container['car_rental_return_country'] = $car_rental_return_country; + + return $this; + } + + /** + * Gets car_rental_return_date + * + * @return string|null + */ + public function getCarRentalReturnDate() + { + return $this->container['car_rental_return_date']; + } + + /** + * Sets car_rental_return_date + * + * @param string|null $car_rental_return_date The last date to return the car by. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setCarRentalReturnDate($car_rental_return_date) + { + if (is_null($car_rental_return_date)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_date cannot be null'); + } + $this->container['car_rental_return_date'] = $car_rental_return_date; + + return $this; + } + + /** + * Gets car_rental_return_location_id + * + * @return string|null + */ + public function getCarRentalReturnLocationId() + { + return $this->container['car_rental_return_location_id']; + } + + /** + * Sets car_rental_return_location_id + * + * @param string|null $car_rental_return_location_id Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 + * + * @return self + */ + public function setCarRentalReturnLocationId($car_rental_return_location_id) + { + if (is_null($car_rental_return_location_id)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_location_id cannot be null'); + } + $this->container['car_rental_return_location_id'] = $car_rental_return_location_id; + + return $this; + } + + /** + * Gets car_rental_return_state_province + * + * @return string|null + */ + public function getCarRentalReturnStateProvince() + { + return $this->container['car_rental_return_state_province']; + } + + /** + * Sets car_rental_return_state_province + * + * @param string|null $car_rental_return_state_province The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 + * + * @return self + */ + public function setCarRentalReturnStateProvince($car_rental_return_state_province) + { + if (is_null($car_rental_return_state_province)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_state_province cannot be null'); + } + $this->container['car_rental_return_state_province'] = $car_rental_return_state_province; + + return $this; + } + + /** + * Gets car_rental_tax_exempt_indicator + * + * @return string|null + */ + public function getCarRentalTaxExemptIndicator() + { + return $this->container['car_rental_tax_exempt_indicator']; + } + + /** + * Sets car_rental_tax_exempt_indicator + * + * @param string|null $car_rental_tax_exempt_indicator Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + * + * @return self + */ + public function setCarRentalTaxExemptIndicator($car_rental_tax_exempt_indicator) + { + if (is_null($car_rental_tax_exempt_indicator)) { + throw new \InvalidArgumentException('non-nullable car_rental_tax_exempt_indicator cannot be null'); + } + $this->container['car_rental_tax_exempt_indicator'] = $car_rental_tax_exempt_indicator; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_duration + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataDuration() + { + return $this->container['travel_entertainment_auth_data_duration']; + } + + /** + * Sets travel_entertainment_auth_data_duration + * + * @param string|null $travel_entertainment_auth_data_duration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * + * @return self + */ + public function setTravelEntertainmentAuthDataDuration($travel_entertainment_auth_data_duration) + { + if (is_null($travel_entertainment_auth_data_duration)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_duration cannot be null'); + } + $this->container['travel_entertainment_auth_data_duration'] = $travel_entertainment_auth_data_duration; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_market + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataMarket() + { + return $this->container['travel_entertainment_auth_data_market']; + } + + /** + * Sets travel_entertainment_auth_data_market + * + * @param string|null $travel_entertainment_auth_data_market Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * + * @return self + */ + public function setTravelEntertainmentAuthDataMarket($travel_entertainment_auth_data_market) + { + if (is_null($travel_entertainment_auth_data_market)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_market cannot be null'); + } + $this->container['travel_entertainment_auth_data_market'] = $travel_entertainment_auth_data_market; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataCommon.php b/src/Adyen/Model/Checkout/AdditionalDataCommon.php new file mode 100644 index 000000000..61634d360 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataCommon.php @@ -0,0 +1,930 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataCommon Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataCommon implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataCommon'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requested_test_error_response_code' => 'string', + 'allow_partial_auth' => 'string', + 'authorisation_type' => 'string', + 'custom_routing_flag' => 'string', + 'industry_usage' => 'string', + 'manual_capture' => 'string', + 'network_tx_reference' => 'string', + 'overwrite_brand' => 'string', + 'sub_merchant_city' => 'string', + 'sub_merchant_country' => 'string', + 'sub_merchant_id' => 'string', + 'sub_merchant_name' => 'string', + 'sub_merchant_postal_code' => 'string', + 'sub_merchant_state' => 'string', + 'sub_merchant_street' => 'string', + 'sub_merchant_tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requested_test_error_response_code' => null, + 'allow_partial_auth' => null, + 'authorisation_type' => null, + 'custom_routing_flag' => null, + 'industry_usage' => null, + 'manual_capture' => null, + 'network_tx_reference' => null, + 'overwrite_brand' => null, + 'sub_merchant_city' => null, + 'sub_merchant_country' => null, + 'sub_merchant_id' => null, + 'sub_merchant_name' => null, + 'sub_merchant_postal_code' => null, + 'sub_merchant_state' => null, + 'sub_merchant_street' => null, + 'sub_merchant_tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'requested_test_error_response_code' => false, + 'allow_partial_auth' => false, + 'authorisation_type' => false, + 'custom_routing_flag' => false, + 'industry_usage' => false, + 'manual_capture' => false, + 'network_tx_reference' => false, + 'overwrite_brand' => false, + 'sub_merchant_city' => false, + 'sub_merchant_country' => false, + 'sub_merchant_id' => false, + 'sub_merchant_name' => false, + 'sub_merchant_postal_code' => false, + 'sub_merchant_state' => false, + 'sub_merchant_street' => false, + 'sub_merchant_tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requested_test_error_response_code' => 'RequestedTestErrorResponseCode', + 'allow_partial_auth' => 'allowPartialAuth', + 'authorisation_type' => 'authorisationType', + 'custom_routing_flag' => 'customRoutingFlag', + 'industry_usage' => 'industryUsage', + 'manual_capture' => 'manualCapture', + 'network_tx_reference' => 'networkTxReference', + 'overwrite_brand' => 'overwriteBrand', + 'sub_merchant_city' => 'subMerchantCity', + 'sub_merchant_country' => 'subMerchantCountry', + 'sub_merchant_id' => 'subMerchantID', + 'sub_merchant_name' => 'subMerchantName', + 'sub_merchant_postal_code' => 'subMerchantPostalCode', + 'sub_merchant_state' => 'subMerchantState', + 'sub_merchant_street' => 'subMerchantStreet', + 'sub_merchant_tax_id' => 'subMerchantTaxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requested_test_error_response_code' => 'setRequestedTestErrorResponseCode', + 'allow_partial_auth' => 'setAllowPartialAuth', + 'authorisation_type' => 'setAuthorisationType', + 'custom_routing_flag' => 'setCustomRoutingFlag', + 'industry_usage' => 'setIndustryUsage', + 'manual_capture' => 'setManualCapture', + 'network_tx_reference' => 'setNetworkTxReference', + 'overwrite_brand' => 'setOverwriteBrand', + 'sub_merchant_city' => 'setSubMerchantCity', + 'sub_merchant_country' => 'setSubMerchantCountry', + 'sub_merchant_id' => 'setSubMerchantId', + 'sub_merchant_name' => 'setSubMerchantName', + 'sub_merchant_postal_code' => 'setSubMerchantPostalCode', + 'sub_merchant_state' => 'setSubMerchantState', + 'sub_merchant_street' => 'setSubMerchantStreet', + 'sub_merchant_tax_id' => 'setSubMerchantTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requested_test_error_response_code' => 'getRequestedTestErrorResponseCode', + 'allow_partial_auth' => 'getAllowPartialAuth', + 'authorisation_type' => 'getAuthorisationType', + 'custom_routing_flag' => 'getCustomRoutingFlag', + 'industry_usage' => 'getIndustryUsage', + 'manual_capture' => 'getManualCapture', + 'network_tx_reference' => 'getNetworkTxReference', + 'overwrite_brand' => 'getOverwriteBrand', + 'sub_merchant_city' => 'getSubMerchantCity', + 'sub_merchant_country' => 'getSubMerchantCountry', + 'sub_merchant_id' => 'getSubMerchantId', + 'sub_merchant_name' => 'getSubMerchantName', + 'sub_merchant_postal_code' => 'getSubMerchantPostalCode', + 'sub_merchant_state' => 'getSubMerchantState', + 'sub_merchant_street' => 'getSubMerchantStreet', + 'sub_merchant_tax_id' => 'getSubMerchantTaxId' + ]; + + /** + * 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 INDUSTRY_USAGE_NO_SHOW = 'NoShow'; + public const INDUSTRY_USAGE_DELAYED_CHARGE = 'DelayedCharge'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIndustryUsageAllowableValues() + { + return [ + self::INDUSTRY_USAGE_NO_SHOW, + self::INDUSTRY_USAGE_DELAYED_CHARGE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('requested_test_error_response_code', $data ?? [], null); + $this->setIfExists('allow_partial_auth', $data ?? [], null); + $this->setIfExists('authorisation_type', $data ?? [], null); + $this->setIfExists('custom_routing_flag', $data ?? [], null); + $this->setIfExists('industry_usage', $data ?? [], null); + $this->setIfExists('manual_capture', $data ?? [], null); + $this->setIfExists('network_tx_reference', $data ?? [], null); + $this->setIfExists('overwrite_brand', $data ?? [], null); + $this->setIfExists('sub_merchant_city', $data ?? [], null); + $this->setIfExists('sub_merchant_country', $data ?? [], null); + $this->setIfExists('sub_merchant_id', $data ?? [], null); + $this->setIfExists('sub_merchant_name', $data ?? [], null); + $this->setIfExists('sub_merchant_postal_code', $data ?? [], null); + $this->setIfExists('sub_merchant_state', $data ?? [], null); + $this->setIfExists('sub_merchant_street', $data ?? [], null); + $this->setIfExists('sub_merchant_tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!is_null($this->container['industry_usage']) && !in_array($this->container['industry_usage'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'industry_usage', must be one of '%s'", + $this->container['industry_usage'], + 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 requested_test_error_response_code + * + * @return string|null + */ + public function getRequestedTestErrorResponseCode() + { + return $this->container['requested_test_error_response_code']; + } + + /** + * Sets requested_test_error_response_code + * + * @param string|null $requested_test_error_response_code Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. + * + * @return self + */ + public function setRequestedTestErrorResponseCode($requested_test_error_response_code) + { + if (is_null($requested_test_error_response_code)) { + throw new \InvalidArgumentException('non-nullable requested_test_error_response_code cannot be null'); + } + $this->container['requested_test_error_response_code'] = $requested_test_error_response_code; + + return $this; + } + + /** + * Gets allow_partial_auth + * + * @return string|null + */ + public function getAllowPartialAuth() + { + return $this->container['allow_partial_auth']; + } + + /** + * Sets allow_partial_auth + * + * @param string|null $allow_partial_auth Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. + * + * @return self + */ + public function setAllowPartialAuth($allow_partial_auth) + { + if (is_null($allow_partial_auth)) { + throw new \InvalidArgumentException('non-nullable allow_partial_auth cannot be null'); + } + $this->container['allow_partial_auth'] = $allow_partial_auth; + + return $this; + } + + /** + * Gets authorisation_type + * + * @return string|null + */ + public function getAuthorisationType() + { + return $this->container['authorisation_type']; + } + + /** + * Sets authorisation_type + * + * @param string|null $authorisation_type Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. + * + * @return self + */ + public function setAuthorisationType($authorisation_type) + { + if (is_null($authorisation_type)) { + throw new \InvalidArgumentException('non-nullable authorisation_type cannot be null'); + } + $this->container['authorisation_type'] = $authorisation_type; + + return $this; + } + + /** + * Gets custom_routing_flag + * + * @return string|null + */ + public function getCustomRoutingFlag() + { + return $this->container['custom_routing_flag']; + } + + /** + * Sets custom_routing_flag + * + * @param string|null $custom_routing_flag Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setCustomRoutingFlag($custom_routing_flag) + { + if (is_null($custom_routing_flag)) { + throw new \InvalidArgumentException('non-nullable custom_routing_flag cannot be null'); + } + $this->container['custom_routing_flag'] = $custom_routing_flag; + + return $this; + } + + /** + * Gets industry_usage + * + * @return string|null + */ + public function getIndustryUsage() + { + return $this->container['industry_usage']; + } + + /** + * Sets industry_usage + * + * @param string|null $industry_usage In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. + * + * @return self + */ + public function setIndustryUsage($industry_usage) + { + if (is_null($industry_usage)) { + throw new \InvalidArgumentException('non-nullable industry_usage cannot be null'); + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!in_array($industry_usage, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'industry_usage', must be one of '%s'", + $industry_usage, + implode("', '", $allowedValues) + ) + ); + } + $this->container['industry_usage'] = $industry_usage; + + return $this; + } + + /** + * Gets manual_capture + * + * @return string|null + */ + public function getManualCapture() + { + return $this->container['manual_capture']; + } + + /** + * Sets manual_capture + * + * @param string|null $manual_capture Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. + * + * @return self + */ + public function setManualCapture($manual_capture) + { + if (is_null($manual_capture)) { + throw new \InvalidArgumentException('non-nullable manual_capture cannot be null'); + } + $this->container['manual_capture'] = $manual_capture; + + return $this; + } + + /** + * Gets network_tx_reference + * + * @return string|null + */ + public function getNetworkTxReference() + { + return $this->container['network_tx_reference']; + } + + /** + * Sets network_tx_reference + * + * @param string|null $network_tx_reference Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. + * + * @return self + */ + public function setNetworkTxReference($network_tx_reference) + { + if (is_null($network_tx_reference)) { + throw new \InvalidArgumentException('non-nullable network_tx_reference cannot be null'); + } + $this->container['network_tx_reference'] = $network_tx_reference; + + return $this; + } + + /** + * Gets overwrite_brand + * + * @return string|null + */ + public function getOverwriteBrand() + { + return $this->container['overwrite_brand']; + } + + /** + * Sets overwrite_brand + * + * @param string|null $overwrite_brand Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. + * + * @return self + */ + public function setOverwriteBrand($overwrite_brand) + { + if (is_null($overwrite_brand)) { + throw new \InvalidArgumentException('non-nullable overwrite_brand cannot be null'); + } + $this->container['overwrite_brand'] = $overwrite_brand; + + return $this; + } + + /** + * Gets sub_merchant_city + * + * @return string|null + */ + public function getSubMerchantCity() + { + return $this->container['sub_merchant_city']; + } + + /** + * Sets sub_merchant_city + * + * @param string|null $sub_merchant_city This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. + * + * @return self + */ + public function setSubMerchantCity($sub_merchant_city) + { + if (is_null($sub_merchant_city)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_city cannot be null'); + } + $this->container['sub_merchant_city'] = $sub_merchant_city; + + return $this; + } + + /** + * Gets sub_merchant_country + * + * @return string|null + */ + public function getSubMerchantCountry() + { + return $this->container['sub_merchant_country']; + } + + /** + * Sets sub_merchant_country + * + * @param string|null $sub_merchant_country This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. + * + * @return self + */ + public function setSubMerchantCountry($sub_merchant_country) + { + if (is_null($sub_merchant_country)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_country cannot be null'); + } + $this->container['sub_merchant_country'] = $sub_merchant_country; + + return $this; + } + + /** + * Gets sub_merchant_id + * + * @return string|null + */ + public function getSubMerchantId() + { + return $this->container['sub_merchant_id']; + } + + /** + * Sets sub_merchant_id + * + * @param string|null $sub_merchant_id This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. + * + * @return self + */ + public function setSubMerchantId($sub_merchant_id) + { + if (is_null($sub_merchant_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_id cannot be null'); + } + $this->container['sub_merchant_id'] = $sub_merchant_id; + + return $this; + } + + /** + * Gets sub_merchant_name + * + * @return string|null + */ + public function getSubMerchantName() + { + return $this->container['sub_merchant_name']; + } + + /** + * Sets sub_merchant_name + * + * @param string|null $sub_merchant_name This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. + * + * @return self + */ + public function setSubMerchantName($sub_merchant_name) + { + if (is_null($sub_merchant_name)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_name cannot be null'); + } + $this->container['sub_merchant_name'] = $sub_merchant_name; + + return $this; + } + + /** + * Gets sub_merchant_postal_code + * + * @return string|null + */ + public function getSubMerchantPostalCode() + { + return $this->container['sub_merchant_postal_code']; + } + + /** + * Sets sub_merchant_postal_code + * + * @param string|null $sub_merchant_postal_code This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. + * + * @return self + */ + public function setSubMerchantPostalCode($sub_merchant_postal_code) + { + if (is_null($sub_merchant_postal_code)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_postal_code cannot be null'); + } + $this->container['sub_merchant_postal_code'] = $sub_merchant_postal_code; + + return $this; + } + + /** + * Gets sub_merchant_state + * + * @return string|null + */ + public function getSubMerchantState() + { + return $this->container['sub_merchant_state']; + } + + /** + * Sets sub_merchant_state + * + * @param string|null $sub_merchant_state This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. + * + * @return self + */ + public function setSubMerchantState($sub_merchant_state) + { + if (is_null($sub_merchant_state)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_state cannot be null'); + } + $this->container['sub_merchant_state'] = $sub_merchant_state; + + return $this; + } + + /** + * Gets sub_merchant_street + * + * @return string|null + */ + public function getSubMerchantStreet() + { + return $this->container['sub_merchant_street']; + } + + /** + * Sets sub_merchant_street + * + * @param string|null $sub_merchant_street This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. + * + * @return self + */ + public function setSubMerchantStreet($sub_merchant_street) + { + if (is_null($sub_merchant_street)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_street cannot be null'); + } + $this->container['sub_merchant_street'] = $sub_merchant_street; + + return $this; + } + + /** + * Gets sub_merchant_tax_id + * + * @return string|null + */ + public function getSubMerchantTaxId() + { + return $this->container['sub_merchant_tax_id']; + } + + /** + * Sets sub_merchant_tax_id + * + * @param string|null $sub_merchant_tax_id This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. + * + * @return self + */ + public function setSubMerchantTaxId($sub_merchant_tax_id) + { + if (is_null($sub_merchant_tax_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_tax_id cannot be null'); + } + $this->container['sub_merchant_tax_id'] = $sub_merchant_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataLevel23.php b/src/Adyen/Model/Checkout/AdditionalDataLevel23.php new file mode 100644 index 000000000..5b0ae35cb --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataLevel23.php @@ -0,0 +1,931 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataLevel23 Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataLevel23 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataLevel23'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enhanced_scheme_data_customer_reference' => 'string', + 'enhanced_scheme_data_destination_country_code' => 'string', + 'enhanced_scheme_data_destination_postal_code' => 'string', + 'enhanced_scheme_data_destination_state_province_code' => 'string', + 'enhanced_scheme_data_duty_amount' => 'string', + 'enhanced_scheme_data_freight_amount' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'string', + 'enhanced_scheme_data_order_date' => 'string', + 'enhanced_scheme_data_ship_from_postal_code' => 'string', + 'enhanced_scheme_data_total_tax_amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enhanced_scheme_data_customer_reference' => null, + 'enhanced_scheme_data_destination_country_code' => null, + 'enhanced_scheme_data_destination_postal_code' => null, + 'enhanced_scheme_data_destination_state_province_code' => null, + 'enhanced_scheme_data_duty_amount' => null, + 'enhanced_scheme_data_freight_amount' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_description' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => null, + 'enhanced_scheme_data_order_date' => null, + 'enhanced_scheme_data_ship_from_postal_code' => null, + 'enhanced_scheme_data_total_tax_amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enhanced_scheme_data_customer_reference' => false, + 'enhanced_scheme_data_destination_country_code' => false, + 'enhanced_scheme_data_destination_postal_code' => false, + 'enhanced_scheme_data_destination_state_province_code' => false, + 'enhanced_scheme_data_duty_amount' => false, + 'enhanced_scheme_data_freight_amount' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_description' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => false, + 'enhanced_scheme_data_order_date' => false, + 'enhanced_scheme_data_ship_from_postal_code' => false, + 'enhanced_scheme_data_total_tax_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enhanced_scheme_data_customer_reference' => 'enhancedSchemeData.customerReference', + 'enhanced_scheme_data_destination_country_code' => 'enhancedSchemeData.destinationCountryCode', + 'enhanced_scheme_data_destination_postal_code' => 'enhancedSchemeData.destinationPostalCode', + 'enhanced_scheme_data_destination_state_province_code' => 'enhancedSchemeData.destinationStateProvinceCode', + 'enhanced_scheme_data_duty_amount' => 'enhancedSchemeData.dutyAmount', + 'enhanced_scheme_data_freight_amount' => 'enhancedSchemeData.freightAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'enhancedSchemeData.itemDetailLine[itemNr].commodityCode', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'enhancedSchemeData.itemDetailLine[itemNr].description', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'enhancedSchemeData.itemDetailLine[itemNr].discountAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'enhancedSchemeData.itemDetailLine[itemNr].productCode', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'enhancedSchemeData.itemDetailLine[itemNr].quantity', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'enhancedSchemeData.itemDetailLine[itemNr].totalAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'enhancedSchemeData.itemDetailLine[itemNr].unitPrice', + 'enhanced_scheme_data_order_date' => 'enhancedSchemeData.orderDate', + 'enhanced_scheme_data_ship_from_postal_code' => 'enhancedSchemeData.shipFromPostalCode', + 'enhanced_scheme_data_total_tax_amount' => 'enhancedSchemeData.totalTaxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enhanced_scheme_data_customer_reference' => 'setEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_destination_country_code' => 'setEnhancedSchemeDataDestinationCountryCode', + 'enhanced_scheme_data_destination_postal_code' => 'setEnhancedSchemeDataDestinationPostalCode', + 'enhanced_scheme_data_destination_state_province_code' => 'setEnhancedSchemeDataDestinationStateProvinceCode', + 'enhanced_scheme_data_duty_amount' => 'setEnhancedSchemeDataDutyAmount', + 'enhanced_scheme_data_freight_amount' => 'setEnhancedSchemeDataFreightAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'setEnhancedSchemeDataItemDetailLineItemNrCommodityCode', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'setEnhancedSchemeDataItemDetailLineItemNrDescription', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'setEnhancedSchemeDataItemDetailLineItemNrDiscountAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'setEnhancedSchemeDataItemDetailLineItemNrProductCode', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'setEnhancedSchemeDataItemDetailLineItemNrQuantity', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'setEnhancedSchemeDataItemDetailLineItemNrTotalAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'setEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'setEnhancedSchemeDataItemDetailLineItemNrUnitPrice', + 'enhanced_scheme_data_order_date' => 'setEnhancedSchemeDataOrderDate', + 'enhanced_scheme_data_ship_from_postal_code' => 'setEnhancedSchemeDataShipFromPostalCode', + 'enhanced_scheme_data_total_tax_amount' => 'setEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enhanced_scheme_data_customer_reference' => 'getEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_destination_country_code' => 'getEnhancedSchemeDataDestinationCountryCode', + 'enhanced_scheme_data_destination_postal_code' => 'getEnhancedSchemeDataDestinationPostalCode', + 'enhanced_scheme_data_destination_state_province_code' => 'getEnhancedSchemeDataDestinationStateProvinceCode', + 'enhanced_scheme_data_duty_amount' => 'getEnhancedSchemeDataDutyAmount', + 'enhanced_scheme_data_freight_amount' => 'getEnhancedSchemeDataFreightAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'getEnhancedSchemeDataItemDetailLineItemNrCommodityCode', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'getEnhancedSchemeDataItemDetailLineItemNrDescription', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'getEnhancedSchemeDataItemDetailLineItemNrDiscountAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'getEnhancedSchemeDataItemDetailLineItemNrProductCode', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'getEnhancedSchemeDataItemDetailLineItemNrQuantity', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'getEnhancedSchemeDataItemDetailLineItemNrTotalAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'getEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'getEnhancedSchemeDataItemDetailLineItemNrUnitPrice', + 'enhanced_scheme_data_order_date' => 'getEnhancedSchemeDataOrderDate', + 'enhanced_scheme_data_ship_from_postal_code' => 'getEnhancedSchemeDataShipFromPostalCode', + 'enhanced_scheme_data_total_tax_amount' => 'getEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enhanced_scheme_data_customer_reference', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_destination_country_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_destination_postal_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_destination_state_province_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_duty_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_freight_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_commodity_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_description', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_discount_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_product_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_quantity', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_total_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_unit_price', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_order_date', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_ship_from_postal_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_total_tax_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enhanced_scheme_data_customer_reference + * + * @return string|null + */ + public function getEnhancedSchemeDataCustomerReference() + { + return $this->container['enhanced_scheme_data_customer_reference']; + } + + /** + * Sets enhanced_scheme_data_customer_reference + * + * @param string|null $enhanced_scheme_data_customer_reference Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. + * + * @return self + */ + public function setEnhancedSchemeDataCustomerReference($enhanced_scheme_data_customer_reference) + { + if (is_null($enhanced_scheme_data_customer_reference)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_customer_reference cannot be null'); + } + $this->container['enhanced_scheme_data_customer_reference'] = $enhanced_scheme_data_customer_reference; + + return $this; + } + + /** + * Gets enhanced_scheme_data_destination_country_code + * + * @return string|null + */ + public function getEnhancedSchemeDataDestinationCountryCode() + { + return $this->container['enhanced_scheme_data_destination_country_code']; + } + + /** + * Sets enhanced_scheme_data_destination_country_code + * + * @param string|null $enhanced_scheme_data_destination_country_code Destination country code. Encoding: ASCII. Max length: 3 characters. + * + * @return self + */ + public function setEnhancedSchemeDataDestinationCountryCode($enhanced_scheme_data_destination_country_code) + { + if (is_null($enhanced_scheme_data_destination_country_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_destination_country_code cannot be null'); + } + $this->container['enhanced_scheme_data_destination_country_code'] = $enhanced_scheme_data_destination_country_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_destination_postal_code + * + * @return string|null + */ + public function getEnhancedSchemeDataDestinationPostalCode() + { + return $this->container['enhanced_scheme_data_destination_postal_code']; + } + + /** + * Sets enhanced_scheme_data_destination_postal_code + * + * @param string|null $enhanced_scheme_data_destination_postal_code The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. + * + * @return self + */ + public function setEnhancedSchemeDataDestinationPostalCode($enhanced_scheme_data_destination_postal_code) + { + if (is_null($enhanced_scheme_data_destination_postal_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_destination_postal_code cannot be null'); + } + $this->container['enhanced_scheme_data_destination_postal_code'] = $enhanced_scheme_data_destination_postal_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_destination_state_province_code + * + * @return string|null + */ + public function getEnhancedSchemeDataDestinationStateProvinceCode() + { + return $this->container['enhanced_scheme_data_destination_state_province_code']; + } + + /** + * Sets enhanced_scheme_data_destination_state_province_code + * + * @param string|null $enhanced_scheme_data_destination_state_province_code Destination state or province code. Encoding: ASCII.Max length: 3 characters. + * + * @return self + */ + public function setEnhancedSchemeDataDestinationStateProvinceCode($enhanced_scheme_data_destination_state_province_code) + { + if (is_null($enhanced_scheme_data_destination_state_province_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_destination_state_province_code cannot be null'); + } + $this->container['enhanced_scheme_data_destination_state_province_code'] = $enhanced_scheme_data_destination_state_province_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_duty_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataDutyAmount() + { + return $this->container['enhanced_scheme_data_duty_amount']; + } + + /** + * Sets enhanced_scheme_data_duty_amount + * + * @param string|null $enhanced_scheme_data_duty_amount Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataDutyAmount($enhanced_scheme_data_duty_amount) + { + if (is_null($enhanced_scheme_data_duty_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_duty_amount cannot be null'); + } + $this->container['enhanced_scheme_data_duty_amount'] = $enhanced_scheme_data_duty_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_freight_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataFreightAmount() + { + return $this->container['enhanced_scheme_data_freight_amount']; + } + + /** + * Sets enhanced_scheme_data_freight_amount + * + * @param string|null $enhanced_scheme_data_freight_amount Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataFreightAmount($enhanced_scheme_data_freight_amount) + { + if (is_null($enhanced_scheme_data_freight_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_freight_amount cannot be null'); + } + $this->container['enhanced_scheme_data_freight_amount'] = $enhanced_scheme_data_freight_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_commodity_code + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrCommodityCode() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_commodity_code']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_commodity_code + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_commodity_code Item commodity code. Encoding: ASCII. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrCommodityCode($enhanced_scheme_data_item_detail_line_item_nr_commodity_code) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_commodity_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_commodity_code cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_commodity_code'] = $enhanced_scheme_data_item_detail_line_item_nr_commodity_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_description + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrDescription() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_description']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_description + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_description Item description. Encoding: ASCII. Max length: 26 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrDescription($enhanced_scheme_data_item_detail_line_item_nr_description) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_description)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_description cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_description'] = $enhanced_scheme_data_item_detail_line_item_nr_description; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_discount_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrDiscountAmount() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_discount_amount']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_discount_amount + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_discount_amount Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrDiscountAmount($enhanced_scheme_data_item_detail_line_item_nr_discount_amount) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_discount_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_discount_amount cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_discount_amount'] = $enhanced_scheme_data_item_detail_line_item_nr_discount_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_product_code + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrProductCode() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_product_code']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_product_code + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_product_code Product code. Encoding: ASCII. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrProductCode($enhanced_scheme_data_item_detail_line_item_nr_product_code) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_product_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_product_code cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_product_code'] = $enhanced_scheme_data_item_detail_line_item_nr_product_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_quantity + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrQuantity() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_quantity']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_quantity + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_quantity Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrQuantity($enhanced_scheme_data_item_detail_line_item_nr_quantity) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_quantity)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_quantity cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_quantity'] = $enhanced_scheme_data_item_detail_line_item_nr_quantity; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_total_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrTotalAmount() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_total_amount']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_total_amount + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_total_amount Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrTotalAmount($enhanced_scheme_data_item_detail_line_item_nr_total_amount) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_total_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_total_amount cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_total_amount'] = $enhanced_scheme_data_item_detail_line_item_nr_total_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure Item unit of measurement. Encoding: ASCII. Max length: 3 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure($enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure'] = $enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_unit_price + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrUnitPrice() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_price']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_unit_price + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_unit_price Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrUnitPrice($enhanced_scheme_data_item_detail_line_item_nr_unit_price) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_unit_price)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_unit_price cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_price'] = $enhanced_scheme_data_item_detail_line_item_nr_unit_price; + + return $this; + } + + /** + * Gets enhanced_scheme_data_order_date + * + * @return string|null + */ + public function getEnhancedSchemeDataOrderDate() + { + return $this->container['enhanced_scheme_data_order_date']; + } + + /** + * Sets enhanced_scheme_data_order_date + * + * @param string|null $enhanced_scheme_data_order_date Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. + * + * @return self + */ + public function setEnhancedSchemeDataOrderDate($enhanced_scheme_data_order_date) + { + if (is_null($enhanced_scheme_data_order_date)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_order_date cannot be null'); + } + $this->container['enhanced_scheme_data_order_date'] = $enhanced_scheme_data_order_date; + + return $this; + } + + /** + * Gets enhanced_scheme_data_ship_from_postal_code + * + * @return string|null + */ + public function getEnhancedSchemeDataShipFromPostalCode() + { + return $this->container['enhanced_scheme_data_ship_from_postal_code']; + } + + /** + * Sets enhanced_scheme_data_ship_from_postal_code + * + * @param string|null $enhanced_scheme_data_ship_from_postal_code The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. + * + * @return self + */ + public function setEnhancedSchemeDataShipFromPostalCode($enhanced_scheme_data_ship_from_postal_code) + { + if (is_null($enhanced_scheme_data_ship_from_postal_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_ship_from_postal_code cannot be null'); + } + $this->container['enhanced_scheme_data_ship_from_postal_code'] = $enhanced_scheme_data_ship_from_postal_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_total_tax_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataTotalTaxAmount() + { + return $this->container['enhanced_scheme_data_total_tax_amount']; + } + + /** + * Sets enhanced_scheme_data_total_tax_amount + * + * @param string|null $enhanced_scheme_data_total_tax_amount Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. + * + * @return self + */ + public function setEnhancedSchemeDataTotalTaxAmount($enhanced_scheme_data_total_tax_amount) + { + if (is_null($enhanced_scheme_data_total_tax_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_total_tax_amount cannot be null'); + } + $this->container['enhanced_scheme_data_total_tax_amount'] = $enhanced_scheme_data_total_tax_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataLodging.php b/src/Adyen/Model/Checkout/AdditionalDataLodging.php new file mode 100644 index 000000000..1523d5df4 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataLodging.php @@ -0,0 +1,931 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataLodging Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataLodging'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'lodging_check_in_date' => 'string', + 'lodging_check_out_date' => 'string', + 'lodging_customer_service_toll_free_number' => 'string', + 'lodging_fire_safety_act_indicator' => 'string', + 'lodging_folio_cash_advances' => 'string', + 'lodging_folio_number' => 'string', + 'lodging_food_beverage_charges' => 'string', + 'lodging_no_show_indicator' => 'string', + 'lodging_prepaid_expenses' => 'string', + 'lodging_property_phone_number' => 'string', + 'lodging_room1_number_of_nights' => 'string', + 'lodging_room1_rate' => 'string', + 'lodging_room1_tax' => 'string', + 'lodging_total_room_tax' => 'string', + 'lodging_total_tax' => 'string', + 'travel_entertainment_auth_data_duration' => 'string', + 'travel_entertainment_auth_data_market' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'lodging_check_in_date' => null, + 'lodging_check_out_date' => null, + 'lodging_customer_service_toll_free_number' => null, + 'lodging_fire_safety_act_indicator' => null, + 'lodging_folio_cash_advances' => null, + 'lodging_folio_number' => null, + 'lodging_food_beverage_charges' => null, + 'lodging_no_show_indicator' => null, + 'lodging_prepaid_expenses' => null, + 'lodging_property_phone_number' => null, + 'lodging_room1_number_of_nights' => null, + 'lodging_room1_rate' => null, + 'lodging_room1_tax' => null, + 'lodging_total_room_tax' => null, + 'lodging_total_tax' => null, + 'travel_entertainment_auth_data_duration' => null, + 'travel_entertainment_auth_data_market' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'lodging_check_in_date' => false, + 'lodging_check_out_date' => false, + 'lodging_customer_service_toll_free_number' => false, + 'lodging_fire_safety_act_indicator' => false, + 'lodging_folio_cash_advances' => false, + 'lodging_folio_number' => false, + 'lodging_food_beverage_charges' => false, + 'lodging_no_show_indicator' => false, + 'lodging_prepaid_expenses' => false, + 'lodging_property_phone_number' => false, + 'lodging_room1_number_of_nights' => false, + 'lodging_room1_rate' => false, + 'lodging_room1_tax' => false, + 'lodging_total_room_tax' => false, + 'lodging_total_tax' => false, + 'travel_entertainment_auth_data_duration' => false, + 'travel_entertainment_auth_data_market' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lodging_check_in_date' => 'lodging.checkInDate', + 'lodging_check_out_date' => 'lodging.checkOutDate', + 'lodging_customer_service_toll_free_number' => 'lodging.customerServiceTollFreeNumber', + 'lodging_fire_safety_act_indicator' => 'lodging.fireSafetyActIndicator', + 'lodging_folio_cash_advances' => 'lodging.folioCashAdvances', + 'lodging_folio_number' => 'lodging.folioNumber', + 'lodging_food_beverage_charges' => 'lodging.foodBeverageCharges', + 'lodging_no_show_indicator' => 'lodging.noShowIndicator', + 'lodging_prepaid_expenses' => 'lodging.prepaidExpenses', + 'lodging_property_phone_number' => 'lodging.propertyPhoneNumber', + 'lodging_room1_number_of_nights' => 'lodging.room1.numberOfNights', + 'lodging_room1_rate' => 'lodging.room1.rate', + 'lodging_room1_tax' => 'lodging.room1.tax', + 'lodging_total_room_tax' => 'lodging.totalRoomTax', + 'lodging_total_tax' => 'lodging.totalTax', + 'travel_entertainment_auth_data_duration' => 'travelEntertainmentAuthData.duration', + 'travel_entertainment_auth_data_market' => 'travelEntertainmentAuthData.market' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lodging_check_in_date' => 'setLodgingCheckInDate', + 'lodging_check_out_date' => 'setLodgingCheckOutDate', + 'lodging_customer_service_toll_free_number' => 'setLodgingCustomerServiceTollFreeNumber', + 'lodging_fire_safety_act_indicator' => 'setLodgingFireSafetyActIndicator', + 'lodging_folio_cash_advances' => 'setLodgingFolioCashAdvances', + 'lodging_folio_number' => 'setLodgingFolioNumber', + 'lodging_food_beverage_charges' => 'setLodgingFoodBeverageCharges', + 'lodging_no_show_indicator' => 'setLodgingNoShowIndicator', + 'lodging_prepaid_expenses' => 'setLodgingPrepaidExpenses', + 'lodging_property_phone_number' => 'setLodgingPropertyPhoneNumber', + 'lodging_room1_number_of_nights' => 'setLodgingRoom1NumberOfNights', + 'lodging_room1_rate' => 'setLodgingRoom1Rate', + 'lodging_room1_tax' => 'setLodgingRoom1Tax', + 'lodging_total_room_tax' => 'setLodgingTotalRoomTax', + 'lodging_total_tax' => 'setLodgingTotalTax', + 'travel_entertainment_auth_data_duration' => 'setTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'setTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lodging_check_in_date' => 'getLodgingCheckInDate', + 'lodging_check_out_date' => 'getLodgingCheckOutDate', + 'lodging_customer_service_toll_free_number' => 'getLodgingCustomerServiceTollFreeNumber', + 'lodging_fire_safety_act_indicator' => 'getLodgingFireSafetyActIndicator', + 'lodging_folio_cash_advances' => 'getLodgingFolioCashAdvances', + 'lodging_folio_number' => 'getLodgingFolioNumber', + 'lodging_food_beverage_charges' => 'getLodgingFoodBeverageCharges', + 'lodging_no_show_indicator' => 'getLodgingNoShowIndicator', + 'lodging_prepaid_expenses' => 'getLodgingPrepaidExpenses', + 'lodging_property_phone_number' => 'getLodgingPropertyPhoneNumber', + 'lodging_room1_number_of_nights' => 'getLodgingRoom1NumberOfNights', + 'lodging_room1_rate' => 'getLodgingRoom1Rate', + 'lodging_room1_tax' => 'getLodgingRoom1Tax', + 'lodging_total_room_tax' => 'getLodgingTotalRoomTax', + 'lodging_total_tax' => 'getLodgingTotalTax', + 'travel_entertainment_auth_data_duration' => 'getTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'getTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lodging_check_in_date', $data ?? [], null); + $this->setIfExists('lodging_check_out_date', $data ?? [], null); + $this->setIfExists('lodging_customer_service_toll_free_number', $data ?? [], null); + $this->setIfExists('lodging_fire_safety_act_indicator', $data ?? [], null); + $this->setIfExists('lodging_folio_cash_advances', $data ?? [], null); + $this->setIfExists('lodging_folio_number', $data ?? [], null); + $this->setIfExists('lodging_food_beverage_charges', $data ?? [], null); + $this->setIfExists('lodging_no_show_indicator', $data ?? [], null); + $this->setIfExists('lodging_prepaid_expenses', $data ?? [], null); + $this->setIfExists('lodging_property_phone_number', $data ?? [], null); + $this->setIfExists('lodging_room1_number_of_nights', $data ?? [], null); + $this->setIfExists('lodging_room1_rate', $data ?? [], null); + $this->setIfExists('lodging_room1_tax', $data ?? [], null); + $this->setIfExists('lodging_total_room_tax', $data ?? [], null); + $this->setIfExists('lodging_total_tax', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_duration', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_market', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lodging_check_in_date + * + * @return string|null + */ + public function getLodgingCheckInDate() + { + return $this->container['lodging_check_in_date']; + } + + /** + * Sets lodging_check_in_date + * + * @param string|null $lodging_check_in_date The arrival date. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setLodgingCheckInDate($lodging_check_in_date) + { + if (is_null($lodging_check_in_date)) { + throw new \InvalidArgumentException('non-nullable lodging_check_in_date cannot be null'); + } + $this->container['lodging_check_in_date'] = $lodging_check_in_date; + + return $this; + } + + /** + * Gets lodging_check_out_date + * + * @return string|null + */ + public function getLodgingCheckOutDate() + { + return $this->container['lodging_check_out_date']; + } + + /** + * Sets lodging_check_out_date + * + * @param string|null $lodging_check_out_date The departure date. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setLodgingCheckOutDate($lodging_check_out_date) + { + if (is_null($lodging_check_out_date)) { + throw new \InvalidArgumentException('non-nullable lodging_check_out_date cannot be null'); + } + $this->container['lodging_check_out_date'] = $lodging_check_out_date; + + return $this; + } + + /** + * Gets lodging_customer_service_toll_free_number + * + * @return string|null + */ + public function getLodgingCustomerServiceTollFreeNumber() + { + return $this->container['lodging_customer_service_toll_free_number']; + } + + /** + * Sets lodging_customer_service_toll_free_number + * + * @param string|null $lodging_customer_service_toll_free_number The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17 + * + * @return self + */ + public function setLodgingCustomerServiceTollFreeNumber($lodging_customer_service_toll_free_number) + { + if (is_null($lodging_customer_service_toll_free_number)) { + throw new \InvalidArgumentException('non-nullable lodging_customer_service_toll_free_number cannot be null'); + } + $this->container['lodging_customer_service_toll_free_number'] = $lodging_customer_service_toll_free_number; + + return $this; + } + + /** + * Gets lodging_fire_safety_act_indicator + * + * @return string|null + */ + public function getLodgingFireSafetyActIndicator() + { + return $this->container['lodging_fire_safety_act_indicator']; + } + + /** + * Sets lodging_fire_safety_act_indicator + * + * @param string|null $lodging_fire_safety_act_indicator Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1 + * + * @return self + */ + public function setLodgingFireSafetyActIndicator($lodging_fire_safety_act_indicator) + { + if (is_null($lodging_fire_safety_act_indicator)) { + throw new \InvalidArgumentException('non-nullable lodging_fire_safety_act_indicator cannot be null'); + } + $this->container['lodging_fire_safety_act_indicator'] = $lodging_fire_safety_act_indicator; + + return $this; + } + + /** + * Gets lodging_folio_cash_advances + * + * @return string|null + */ + public function getLodgingFolioCashAdvances() + { + return $this->container['lodging_folio_cash_advances']; + } + + /** + * Sets lodging_folio_cash_advances + * + * @param string|null $lodging_folio_cash_advances The folio cash advances. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingFolioCashAdvances($lodging_folio_cash_advances) + { + if (is_null($lodging_folio_cash_advances)) { + throw new \InvalidArgumentException('non-nullable lodging_folio_cash_advances cannot be null'); + } + $this->container['lodging_folio_cash_advances'] = $lodging_folio_cash_advances; + + return $this; + } + + /** + * Gets lodging_folio_number + * + * @return string|null + */ + public function getLodgingFolioNumber() + { + return $this->container['lodging_folio_number']; + } + + /** + * Sets lodging_folio_number + * + * @param string|null $lodging_folio_number Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25 + * + * @return self + */ + public function setLodgingFolioNumber($lodging_folio_number) + { + if (is_null($lodging_folio_number)) { + throw new \InvalidArgumentException('non-nullable lodging_folio_number cannot be null'); + } + $this->container['lodging_folio_number'] = $lodging_folio_number; + + return $this; + } + + /** + * Gets lodging_food_beverage_charges + * + * @return string|null + */ + public function getLodgingFoodBeverageCharges() + { + return $this->container['lodging_food_beverage_charges']; + } + + /** + * Sets lodging_food_beverage_charges + * + * @param string|null $lodging_food_beverage_charges Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingFoodBeverageCharges($lodging_food_beverage_charges) + { + if (is_null($lodging_food_beverage_charges)) { + throw new \InvalidArgumentException('non-nullable lodging_food_beverage_charges cannot be null'); + } + $this->container['lodging_food_beverage_charges'] = $lodging_food_beverage_charges; + + return $this; + } + + /** + * Gets lodging_no_show_indicator + * + * @return string|null + */ + public function getLodgingNoShowIndicator() + { + return $this->container['lodging_no_show_indicator']; + } + + /** + * Sets lodging_no_show_indicator + * + * @param string|null $lodging_no_show_indicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1 + * + * @return self + */ + public function setLodgingNoShowIndicator($lodging_no_show_indicator) + { + if (is_null($lodging_no_show_indicator)) { + throw new \InvalidArgumentException('non-nullable lodging_no_show_indicator cannot be null'); + } + $this->container['lodging_no_show_indicator'] = $lodging_no_show_indicator; + + return $this; + } + + /** + * Gets lodging_prepaid_expenses + * + * @return string|null + */ + public function getLodgingPrepaidExpenses() + { + return $this->container['lodging_prepaid_expenses']; + } + + /** + * Sets lodging_prepaid_expenses + * + * @param string|null $lodging_prepaid_expenses Prepaid expenses for the booking. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingPrepaidExpenses($lodging_prepaid_expenses) + { + if (is_null($lodging_prepaid_expenses)) { + throw new \InvalidArgumentException('non-nullable lodging_prepaid_expenses cannot be null'); + } + $this->container['lodging_prepaid_expenses'] = $lodging_prepaid_expenses; + + return $this; + } + + /** + * Gets lodging_property_phone_number + * + * @return string|null + */ + public function getLodgingPropertyPhoneNumber() + { + return $this->container['lodging_property_phone_number']; + } + + /** + * Sets lodging_property_phone_number + * + * @param string|null $lodging_property_phone_number Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17 + * + * @return self + */ + public function setLodgingPropertyPhoneNumber($lodging_property_phone_number) + { + if (is_null($lodging_property_phone_number)) { + throw new \InvalidArgumentException('non-nullable lodging_property_phone_number cannot be null'); + } + $this->container['lodging_property_phone_number'] = $lodging_property_phone_number; + + return $this; + } + + /** + * Gets lodging_room1_number_of_nights + * + * @return string|null + */ + public function getLodgingRoom1NumberOfNights() + { + return $this->container['lodging_room1_number_of_nights']; + } + + /** + * Sets lodging_room1_number_of_nights + * + * @param string|null $lodging_room1_number_of_nights Total number of nights the room will be rented. * Format: Numeric * maxLength: 4 + * + * @return self + */ + public function setLodgingRoom1NumberOfNights($lodging_room1_number_of_nights) + { + if (is_null($lodging_room1_number_of_nights)) { + throw new \InvalidArgumentException('non-nullable lodging_room1_number_of_nights cannot be null'); + } + $this->container['lodging_room1_number_of_nights'] = $lodging_room1_number_of_nights; + + return $this; + } + + /** + * Gets lodging_room1_rate + * + * @return string|null + */ + public function getLodgingRoom1Rate() + { + return $this->container['lodging_room1_rate']; + } + + /** + * Sets lodging_room1_rate + * + * @param string|null $lodging_room1_rate The rate of the room. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingRoom1Rate($lodging_room1_rate) + { + if (is_null($lodging_room1_rate)) { + throw new \InvalidArgumentException('non-nullable lodging_room1_rate cannot be null'); + } + $this->container['lodging_room1_rate'] = $lodging_room1_rate; + + return $this; + } + + /** + * Gets lodging_room1_tax + * + * @return string|null + */ + public function getLodgingRoom1Tax() + { + return $this->container['lodging_room1_tax']; + } + + /** + * Sets lodging_room1_tax + * + * @param string|null $lodging_room1_tax The total amount of tax to be paid. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingRoom1Tax($lodging_room1_tax) + { + if (is_null($lodging_room1_tax)) { + throw new \InvalidArgumentException('non-nullable lodging_room1_tax cannot be null'); + } + $this->container['lodging_room1_tax'] = $lodging_room1_tax; + + return $this; + } + + /** + * Gets lodging_total_room_tax + * + * @return string|null + */ + public function getLodgingTotalRoomTax() + { + return $this->container['lodging_total_room_tax']; + } + + /** + * Sets lodging_total_room_tax + * + * @param string|null $lodging_total_room_tax Total room tax amount. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingTotalRoomTax($lodging_total_room_tax) + { + if (is_null($lodging_total_room_tax)) { + throw new \InvalidArgumentException('non-nullable lodging_total_room_tax cannot be null'); + } + $this->container['lodging_total_room_tax'] = $lodging_total_room_tax; + + return $this; + } + + /** + * Gets lodging_total_tax + * + * @return string|null + */ + public function getLodgingTotalTax() + { + return $this->container['lodging_total_tax']; + } + + /** + * Sets lodging_total_tax + * + * @param string|null $lodging_total_tax Total tax amount. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingTotalTax($lodging_total_tax) + { + if (is_null($lodging_total_tax)) { + throw new \InvalidArgumentException('non-nullable lodging_total_tax cannot be null'); + } + $this->container['lodging_total_tax'] = $lodging_total_tax; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_duration + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataDuration() + { + return $this->container['travel_entertainment_auth_data_duration']; + } + + /** + * Sets travel_entertainment_auth_data_duration + * + * @param string|null $travel_entertainment_auth_data_duration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * + * @return self + */ + public function setTravelEntertainmentAuthDataDuration($travel_entertainment_auth_data_duration) + { + if (is_null($travel_entertainment_auth_data_duration)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_duration cannot be null'); + } + $this->container['travel_entertainment_auth_data_duration'] = $travel_entertainment_auth_data_duration; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_market + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataMarket() + { + return $this->container['travel_entertainment_auth_data_market']; + } + + /** + * Sets travel_entertainment_auth_data_market + * + * @param string|null $travel_entertainment_auth_data_market Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * + * @return self + */ + public function setTravelEntertainmentAuthDataMarket($travel_entertainment_auth_data_market) + { + if (is_null($travel_entertainment_auth_data_market)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_market cannot be null'); + } + $this->container['travel_entertainment_auth_data_market'] = $travel_entertainment_auth_data_market; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php b/src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php new file mode 100644 index 000000000..7695c47e3 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataOpenInvoice.php @@ -0,0 +1,965 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataOpenInvoice Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataOpenInvoice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataOpenInvoice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'openinvoicedata_merchant_data' => 'string', + 'openinvoicedata_number_of_lines' => 'string', + 'openinvoicedata_recipient_first_name' => 'string', + 'openinvoicedata_recipient_last_name' => 'string', + 'openinvoicedata_line_item_nr_currency_code' => 'string', + 'openinvoicedata_line_item_nr_description' => 'string', + 'openinvoicedata_line_item_nr_item_amount' => 'string', + 'openinvoicedata_line_item_nr_item_id' => 'string', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'string', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'string', + 'openinvoicedata_line_item_nr_number_of_items' => 'string', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'string', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'string', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'string', + 'openinvoicedata_line_item_nr_shipping_company' => 'string', + 'openinvoicedata_line_item_nr_shipping_method' => 'string', + 'openinvoicedata_line_item_nr_tracking_number' => 'string', + 'openinvoicedata_line_item_nr_tracking_uri' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'openinvoicedata_merchant_data' => null, + 'openinvoicedata_number_of_lines' => null, + 'openinvoicedata_recipient_first_name' => null, + 'openinvoicedata_recipient_last_name' => null, + 'openinvoicedata_line_item_nr_currency_code' => null, + 'openinvoicedata_line_item_nr_description' => null, + 'openinvoicedata_line_item_nr_item_amount' => null, + 'openinvoicedata_line_item_nr_item_id' => null, + 'openinvoicedata_line_item_nr_item_vat_amount' => null, + 'openinvoicedata_line_item_nr_item_vat_percentage' => null, + 'openinvoicedata_line_item_nr_number_of_items' => null, + 'openinvoicedata_line_item_nr_return_shipping_company' => null, + 'openinvoicedata_line_item_nr_return_tracking_number' => null, + 'openinvoicedata_line_item_nr_return_tracking_uri' => null, + 'openinvoicedata_line_item_nr_shipping_company' => null, + 'openinvoicedata_line_item_nr_shipping_method' => null, + 'openinvoicedata_line_item_nr_tracking_number' => null, + 'openinvoicedata_line_item_nr_tracking_uri' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'openinvoicedata_merchant_data' => false, + 'openinvoicedata_number_of_lines' => false, + 'openinvoicedata_recipient_first_name' => false, + 'openinvoicedata_recipient_last_name' => false, + 'openinvoicedata_line_item_nr_currency_code' => false, + 'openinvoicedata_line_item_nr_description' => false, + 'openinvoicedata_line_item_nr_item_amount' => false, + 'openinvoicedata_line_item_nr_item_id' => false, + 'openinvoicedata_line_item_nr_item_vat_amount' => false, + 'openinvoicedata_line_item_nr_item_vat_percentage' => false, + 'openinvoicedata_line_item_nr_number_of_items' => false, + 'openinvoicedata_line_item_nr_return_shipping_company' => false, + 'openinvoicedata_line_item_nr_return_tracking_number' => false, + 'openinvoicedata_line_item_nr_return_tracking_uri' => false, + 'openinvoicedata_line_item_nr_shipping_company' => false, + 'openinvoicedata_line_item_nr_shipping_method' => false, + 'openinvoicedata_line_item_nr_tracking_number' => false, + 'openinvoicedata_line_item_nr_tracking_uri' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'openinvoicedata_merchant_data' => 'openinvoicedata.merchantData', + 'openinvoicedata_number_of_lines' => 'openinvoicedata.numberOfLines', + 'openinvoicedata_recipient_first_name' => 'openinvoicedata.recipientFirstName', + 'openinvoicedata_recipient_last_name' => 'openinvoicedata.recipientLastName', + 'openinvoicedata_line_item_nr_currency_code' => 'openinvoicedataLine[itemNr].currencyCode', + 'openinvoicedata_line_item_nr_description' => 'openinvoicedataLine[itemNr].description', + 'openinvoicedata_line_item_nr_item_amount' => 'openinvoicedataLine[itemNr].itemAmount', + 'openinvoicedata_line_item_nr_item_id' => 'openinvoicedataLine[itemNr].itemId', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'openinvoicedataLine[itemNr].itemVatAmount', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'openinvoicedataLine[itemNr].itemVatPercentage', + 'openinvoicedata_line_item_nr_number_of_items' => 'openinvoicedataLine[itemNr].numberOfItems', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'openinvoicedataLine[itemNr].returnShippingCompany', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'openinvoicedataLine[itemNr].returnTrackingNumber', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'openinvoicedataLine[itemNr].returnTrackingUri', + 'openinvoicedata_line_item_nr_shipping_company' => 'openinvoicedataLine[itemNr].shippingCompany', + 'openinvoicedata_line_item_nr_shipping_method' => 'openinvoicedataLine[itemNr].shippingMethod', + 'openinvoicedata_line_item_nr_tracking_number' => 'openinvoicedataLine[itemNr].trackingNumber', + 'openinvoicedata_line_item_nr_tracking_uri' => 'openinvoicedataLine[itemNr].trackingUri' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'openinvoicedata_merchant_data' => 'setOpeninvoicedataMerchantData', + 'openinvoicedata_number_of_lines' => 'setOpeninvoicedataNumberOfLines', + 'openinvoicedata_recipient_first_name' => 'setOpeninvoicedataRecipientFirstName', + 'openinvoicedata_recipient_last_name' => 'setOpeninvoicedataRecipientLastName', + 'openinvoicedata_line_item_nr_currency_code' => 'setOpeninvoicedataLineItemNrCurrencyCode', + 'openinvoicedata_line_item_nr_description' => 'setOpeninvoicedataLineItemNrDescription', + 'openinvoicedata_line_item_nr_item_amount' => 'setOpeninvoicedataLineItemNrItemAmount', + 'openinvoicedata_line_item_nr_item_id' => 'setOpeninvoicedataLineItemNrItemId', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'setOpeninvoicedataLineItemNrItemVatAmount', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'setOpeninvoicedataLineItemNrItemVatPercentage', + 'openinvoicedata_line_item_nr_number_of_items' => 'setOpeninvoicedataLineItemNrNumberOfItems', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'setOpeninvoicedataLineItemNrReturnShippingCompany', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'setOpeninvoicedataLineItemNrReturnTrackingNumber', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'setOpeninvoicedataLineItemNrReturnTrackingUri', + 'openinvoicedata_line_item_nr_shipping_company' => 'setOpeninvoicedataLineItemNrShippingCompany', + 'openinvoicedata_line_item_nr_shipping_method' => 'setOpeninvoicedataLineItemNrShippingMethod', + 'openinvoicedata_line_item_nr_tracking_number' => 'setOpeninvoicedataLineItemNrTrackingNumber', + 'openinvoicedata_line_item_nr_tracking_uri' => 'setOpeninvoicedataLineItemNrTrackingUri' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'openinvoicedata_merchant_data' => 'getOpeninvoicedataMerchantData', + 'openinvoicedata_number_of_lines' => 'getOpeninvoicedataNumberOfLines', + 'openinvoicedata_recipient_first_name' => 'getOpeninvoicedataRecipientFirstName', + 'openinvoicedata_recipient_last_name' => 'getOpeninvoicedataRecipientLastName', + 'openinvoicedata_line_item_nr_currency_code' => 'getOpeninvoicedataLineItemNrCurrencyCode', + 'openinvoicedata_line_item_nr_description' => 'getOpeninvoicedataLineItemNrDescription', + 'openinvoicedata_line_item_nr_item_amount' => 'getOpeninvoicedataLineItemNrItemAmount', + 'openinvoicedata_line_item_nr_item_id' => 'getOpeninvoicedataLineItemNrItemId', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'getOpeninvoicedataLineItemNrItemVatAmount', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'getOpeninvoicedataLineItemNrItemVatPercentage', + 'openinvoicedata_line_item_nr_number_of_items' => 'getOpeninvoicedataLineItemNrNumberOfItems', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'getOpeninvoicedataLineItemNrReturnShippingCompany', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'getOpeninvoicedataLineItemNrReturnTrackingNumber', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'getOpeninvoicedataLineItemNrReturnTrackingUri', + 'openinvoicedata_line_item_nr_shipping_company' => 'getOpeninvoicedataLineItemNrShippingCompany', + 'openinvoicedata_line_item_nr_shipping_method' => 'getOpeninvoicedataLineItemNrShippingMethod', + 'openinvoicedata_line_item_nr_tracking_number' => 'getOpeninvoicedataLineItemNrTrackingNumber', + 'openinvoicedata_line_item_nr_tracking_uri' => 'getOpeninvoicedataLineItemNrTrackingUri' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('openinvoicedata_merchant_data', $data ?? [], null); + $this->setIfExists('openinvoicedata_number_of_lines', $data ?? [], null); + $this->setIfExists('openinvoicedata_recipient_first_name', $data ?? [], null); + $this->setIfExists('openinvoicedata_recipient_last_name', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_currency_code', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_description', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_amount', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_id', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_vat_amount', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_vat_percentage', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_number_of_items', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_return_shipping_company', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_return_tracking_number', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_return_tracking_uri', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_shipping_company', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_shipping_method', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_tracking_number', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_tracking_uri', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets openinvoicedata_merchant_data + * + * @return string|null + */ + public function getOpeninvoicedataMerchantData() + { + return $this->container['openinvoicedata_merchant_data']; + } + + /** + * Sets openinvoicedata_merchant_data + * + * @param string|null $openinvoicedata_merchant_data Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. + * + * @return self + */ + public function setOpeninvoicedataMerchantData($openinvoicedata_merchant_data) + { + if (is_null($openinvoicedata_merchant_data)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_merchant_data cannot be null'); + } + $this->container['openinvoicedata_merchant_data'] = $openinvoicedata_merchant_data; + + return $this; + } + + /** + * Gets openinvoicedata_number_of_lines + * + * @return string|null + */ + public function getOpeninvoicedataNumberOfLines() + { + return $this->container['openinvoicedata_number_of_lines']; + } + + /** + * Sets openinvoicedata_number_of_lines + * + * @param string|null $openinvoicedata_number_of_lines The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. + * + * @return self + */ + public function setOpeninvoicedataNumberOfLines($openinvoicedata_number_of_lines) + { + if (is_null($openinvoicedata_number_of_lines)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_number_of_lines cannot be null'); + } + $this->container['openinvoicedata_number_of_lines'] = $openinvoicedata_number_of_lines; + + return $this; + } + + /** + * Gets openinvoicedata_recipient_first_name + * + * @return string|null + */ + public function getOpeninvoicedataRecipientFirstName() + { + return $this->container['openinvoicedata_recipient_first_name']; + } + + /** + * Sets openinvoicedata_recipient_first_name + * + * @param string|null $openinvoicedata_recipient_first_name First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. + * + * @return self + */ + public function setOpeninvoicedataRecipientFirstName($openinvoicedata_recipient_first_name) + { + if (is_null($openinvoicedata_recipient_first_name)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_recipient_first_name cannot be null'); + } + $this->container['openinvoicedata_recipient_first_name'] = $openinvoicedata_recipient_first_name; + + return $this; + } + + /** + * Gets openinvoicedata_recipient_last_name + * + * @return string|null + */ + public function getOpeninvoicedataRecipientLastName() + { + return $this->container['openinvoicedata_recipient_last_name']; + } + + /** + * Sets openinvoicedata_recipient_last_name + * + * @param string|null $openinvoicedata_recipient_last_name Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. + * + * @return self + */ + public function setOpeninvoicedataRecipientLastName($openinvoicedata_recipient_last_name) + { + if (is_null($openinvoicedata_recipient_last_name)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_recipient_last_name cannot be null'); + } + $this->container['openinvoicedata_recipient_last_name'] = $openinvoicedata_recipient_last_name; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_currency_code + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrCurrencyCode() + { + return $this->container['openinvoicedata_line_item_nr_currency_code']; + } + + /** + * Sets openinvoicedata_line_item_nr_currency_code + * + * @param string|null $openinvoicedata_line_item_nr_currency_code The three-character ISO currency code. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrCurrencyCode($openinvoicedata_line_item_nr_currency_code) + { + if (is_null($openinvoicedata_line_item_nr_currency_code)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_currency_code cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_currency_code'] = $openinvoicedata_line_item_nr_currency_code; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_description + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrDescription() + { + return $this->container['openinvoicedata_line_item_nr_description']; + } + + /** + * Sets openinvoicedata_line_item_nr_description + * + * @param string|null $openinvoicedata_line_item_nr_description A text description of the product the invoice line refers to. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrDescription($openinvoicedata_line_item_nr_description) + { + if (is_null($openinvoicedata_line_item_nr_description)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_description cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_description'] = $openinvoicedata_line_item_nr_description; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_amount + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemAmount() + { + return $this->container['openinvoicedata_line_item_nr_item_amount']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_amount + * + * @param string|null $openinvoicedata_line_item_nr_item_amount The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemAmount($openinvoicedata_line_item_nr_item_amount) + { + if (is_null($openinvoicedata_line_item_nr_item_amount)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_amount cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_amount'] = $openinvoicedata_line_item_nr_item_amount; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_id + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemId() + { + return $this->container['openinvoicedata_line_item_nr_item_id']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_id + * + * @param string|null $openinvoicedata_line_item_nr_item_id A unique id for this item. Required for RatePay if the description of each item is not unique. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemId($openinvoicedata_line_item_nr_item_id) + { + if (is_null($openinvoicedata_line_item_nr_item_id)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_id cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_id'] = $openinvoicedata_line_item_nr_item_id; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_vat_amount + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemVatAmount() + { + return $this->container['openinvoicedata_line_item_nr_item_vat_amount']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_vat_amount + * + * @param string|null $openinvoicedata_line_item_nr_item_vat_amount The VAT due for one item in the invoice line, represented in minor units. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemVatAmount($openinvoicedata_line_item_nr_item_vat_amount) + { + if (is_null($openinvoicedata_line_item_nr_item_vat_amount)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_vat_amount cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_vat_amount'] = $openinvoicedata_line_item_nr_item_vat_amount; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_vat_percentage + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemVatPercentage() + { + return $this->container['openinvoicedata_line_item_nr_item_vat_percentage']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_vat_percentage + * + * @param string|null $openinvoicedata_line_item_nr_item_vat_percentage The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemVatPercentage($openinvoicedata_line_item_nr_item_vat_percentage) + { + if (is_null($openinvoicedata_line_item_nr_item_vat_percentage)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_vat_percentage cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_vat_percentage'] = $openinvoicedata_line_item_nr_item_vat_percentage; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_number_of_items + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrNumberOfItems() + { + return $this->container['openinvoicedata_line_item_nr_number_of_items']; + } + + /** + * Sets openinvoicedata_line_item_nr_number_of_items + * + * @param string|null $openinvoicedata_line_item_nr_number_of_items The number of units purchased of a specific product. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrNumberOfItems($openinvoicedata_line_item_nr_number_of_items) + { + if (is_null($openinvoicedata_line_item_nr_number_of_items)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_number_of_items cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_number_of_items'] = $openinvoicedata_line_item_nr_number_of_items; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_return_shipping_company + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrReturnShippingCompany() + { + return $this->container['openinvoicedata_line_item_nr_return_shipping_company']; + } + + /** + * Sets openinvoicedata_line_item_nr_return_shipping_company + * + * @param string|null $openinvoicedata_line_item_nr_return_shipping_company Name of the shipping company handling the the return shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrReturnShippingCompany($openinvoicedata_line_item_nr_return_shipping_company) + { + if (is_null($openinvoicedata_line_item_nr_return_shipping_company)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_return_shipping_company cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_return_shipping_company'] = $openinvoicedata_line_item_nr_return_shipping_company; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_return_tracking_number + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrReturnTrackingNumber() + { + return $this->container['openinvoicedata_line_item_nr_return_tracking_number']; + } + + /** + * Sets openinvoicedata_line_item_nr_return_tracking_number + * + * @param string|null $openinvoicedata_line_item_nr_return_tracking_number The tracking number for the return of the shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrReturnTrackingNumber($openinvoicedata_line_item_nr_return_tracking_number) + { + if (is_null($openinvoicedata_line_item_nr_return_tracking_number)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_return_tracking_number cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_return_tracking_number'] = $openinvoicedata_line_item_nr_return_tracking_number; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_return_tracking_uri + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrReturnTrackingUri() + { + return $this->container['openinvoicedata_line_item_nr_return_tracking_uri']; + } + + /** + * Sets openinvoicedata_line_item_nr_return_tracking_uri + * + * @param string|null $openinvoicedata_line_item_nr_return_tracking_uri URI where the customer can track the return of their shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrReturnTrackingUri($openinvoicedata_line_item_nr_return_tracking_uri) + { + if (is_null($openinvoicedata_line_item_nr_return_tracking_uri)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_return_tracking_uri cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_return_tracking_uri'] = $openinvoicedata_line_item_nr_return_tracking_uri; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_shipping_company + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrShippingCompany() + { + return $this->container['openinvoicedata_line_item_nr_shipping_company']; + } + + /** + * Sets openinvoicedata_line_item_nr_shipping_company + * + * @param string|null $openinvoicedata_line_item_nr_shipping_company Name of the shipping company handling the delivery. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrShippingCompany($openinvoicedata_line_item_nr_shipping_company) + { + if (is_null($openinvoicedata_line_item_nr_shipping_company)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_shipping_company cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_shipping_company'] = $openinvoicedata_line_item_nr_shipping_company; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_shipping_method + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrShippingMethod() + { + return $this->container['openinvoicedata_line_item_nr_shipping_method']; + } + + /** + * Sets openinvoicedata_line_item_nr_shipping_method + * + * @param string|null $openinvoicedata_line_item_nr_shipping_method Shipping method. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrShippingMethod($openinvoicedata_line_item_nr_shipping_method) + { + if (is_null($openinvoicedata_line_item_nr_shipping_method)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_shipping_method cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_shipping_method'] = $openinvoicedata_line_item_nr_shipping_method; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_tracking_number + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrTrackingNumber() + { + return $this->container['openinvoicedata_line_item_nr_tracking_number']; + } + + /** + * Sets openinvoicedata_line_item_nr_tracking_number + * + * @param string|null $openinvoicedata_line_item_nr_tracking_number The tracking number for the shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrTrackingNumber($openinvoicedata_line_item_nr_tracking_number) + { + if (is_null($openinvoicedata_line_item_nr_tracking_number)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_tracking_number cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_tracking_number'] = $openinvoicedata_line_item_nr_tracking_number; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_tracking_uri + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrTrackingUri() + { + return $this->container['openinvoicedata_line_item_nr_tracking_uri']; + } + + /** + * Sets openinvoicedata_line_item_nr_tracking_uri + * + * @param string|null $openinvoicedata_line_item_nr_tracking_uri URI where the customer can track their shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrTrackingUri($openinvoicedata_line_item_nr_tracking_uri) + { + if (is_null($openinvoicedata_line_item_nr_tracking_uri)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_tracking_uri cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_tracking_uri'] = $openinvoicedata_line_item_nr_tracking_uri; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataOpi.php b/src/Adyen/Model/Checkout/AdditionalDataOpi.php new file mode 100644 index 000000000..982640a5b --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataOpi.php @@ -0,0 +1,387 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataOpi Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataOpi implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataOpi'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'opi_include_trans_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'opi_include_trans_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'opi_include_trans_token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'opi_include_trans_token' => 'opi.includeTransToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'opi_include_trans_token' => 'setOpiIncludeTransToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'opi_include_trans_token' => 'getOpiIncludeTransToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('opi_include_trans_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets opi_include_trans_token + * + * @return string|null + */ + public function getOpiIncludeTransToken() + { + return $this->container['opi_include_trans_token']; + } + + /** + * Sets opi_include_trans_token + * + * @param string|null $opi_include_trans_token Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + * + * @return self + */ + public function setOpiIncludeTransToken($opi_include_trans_token) + { + if (is_null($opi_include_trans_token)) { + throw new \InvalidArgumentException('non-nullable opi_include_trans_token cannot be null'); + } + $this->container['opi_include_trans_token'] = $opi_include_trans_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataRatepay.php b/src/Adyen/Model/Checkout/AdditionalDataRatepay.php new file mode 100644 index 000000000..3223ac879 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataRatepay.php @@ -0,0 +1,625 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataRatepay Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataRatepay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRatepay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ratepay_installment_amount' => 'string', + 'ratepay_interest_rate' => 'string', + 'ratepay_last_installment_amount' => 'string', + 'ratepay_payment_firstday' => 'string', + 'ratepaydata_delivery_date' => 'string', + 'ratepaydata_due_date' => 'string', + 'ratepaydata_invoice_date' => 'string', + 'ratepaydata_invoice_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ratepay_installment_amount' => null, + 'ratepay_interest_rate' => null, + 'ratepay_last_installment_amount' => null, + 'ratepay_payment_firstday' => null, + 'ratepaydata_delivery_date' => null, + 'ratepaydata_due_date' => null, + 'ratepaydata_invoice_date' => null, + 'ratepaydata_invoice_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'ratepay_installment_amount' => false, + 'ratepay_interest_rate' => false, + 'ratepay_last_installment_amount' => false, + 'ratepay_payment_firstday' => false, + 'ratepaydata_delivery_date' => false, + 'ratepaydata_due_date' => false, + 'ratepaydata_invoice_date' => false, + 'ratepaydata_invoice_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ratepay_installment_amount' => 'ratepay.installmentAmount', + 'ratepay_interest_rate' => 'ratepay.interestRate', + 'ratepay_last_installment_amount' => 'ratepay.lastInstallmentAmount', + 'ratepay_payment_firstday' => 'ratepay.paymentFirstday', + 'ratepaydata_delivery_date' => 'ratepaydata.deliveryDate', + 'ratepaydata_due_date' => 'ratepaydata.dueDate', + 'ratepaydata_invoice_date' => 'ratepaydata.invoiceDate', + 'ratepaydata_invoice_id' => 'ratepaydata.invoiceId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ratepay_installment_amount' => 'setRatepayInstallmentAmount', + 'ratepay_interest_rate' => 'setRatepayInterestRate', + 'ratepay_last_installment_amount' => 'setRatepayLastInstallmentAmount', + 'ratepay_payment_firstday' => 'setRatepayPaymentFirstday', + 'ratepaydata_delivery_date' => 'setRatepaydataDeliveryDate', + 'ratepaydata_due_date' => 'setRatepaydataDueDate', + 'ratepaydata_invoice_date' => 'setRatepaydataInvoiceDate', + 'ratepaydata_invoice_id' => 'setRatepaydataInvoiceId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ratepay_installment_amount' => 'getRatepayInstallmentAmount', + 'ratepay_interest_rate' => 'getRatepayInterestRate', + 'ratepay_last_installment_amount' => 'getRatepayLastInstallmentAmount', + 'ratepay_payment_firstday' => 'getRatepayPaymentFirstday', + 'ratepaydata_delivery_date' => 'getRatepaydataDeliveryDate', + 'ratepaydata_due_date' => 'getRatepaydataDueDate', + 'ratepaydata_invoice_date' => 'getRatepaydataInvoiceDate', + 'ratepaydata_invoice_id' => 'getRatepaydataInvoiceId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ratepay_installment_amount', $data ?? [], null); + $this->setIfExists('ratepay_interest_rate', $data ?? [], null); + $this->setIfExists('ratepay_last_installment_amount', $data ?? [], null); + $this->setIfExists('ratepay_payment_firstday', $data ?? [], null); + $this->setIfExists('ratepaydata_delivery_date', $data ?? [], null); + $this->setIfExists('ratepaydata_due_date', $data ?? [], null); + $this->setIfExists('ratepaydata_invoice_date', $data ?? [], null); + $this->setIfExists('ratepaydata_invoice_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ratepay_installment_amount + * + * @return string|null + */ + public function getRatepayInstallmentAmount() + { + return $this->container['ratepay_installment_amount']; + } + + /** + * Sets ratepay_installment_amount + * + * @param string|null $ratepay_installment_amount Amount the customer has to pay each month. + * + * @return self + */ + public function setRatepayInstallmentAmount($ratepay_installment_amount) + { + if (is_null($ratepay_installment_amount)) { + throw new \InvalidArgumentException('non-nullable ratepay_installment_amount cannot be null'); + } + $this->container['ratepay_installment_amount'] = $ratepay_installment_amount; + + return $this; + } + + /** + * Gets ratepay_interest_rate + * + * @return string|null + */ + public function getRatepayInterestRate() + { + return $this->container['ratepay_interest_rate']; + } + + /** + * Sets ratepay_interest_rate + * + * @param string|null $ratepay_interest_rate Interest rate of this installment. + * + * @return self + */ + public function setRatepayInterestRate($ratepay_interest_rate) + { + if (is_null($ratepay_interest_rate)) { + throw new \InvalidArgumentException('non-nullable ratepay_interest_rate cannot be null'); + } + $this->container['ratepay_interest_rate'] = $ratepay_interest_rate; + + return $this; + } + + /** + * Gets ratepay_last_installment_amount + * + * @return string|null + */ + public function getRatepayLastInstallmentAmount() + { + return $this->container['ratepay_last_installment_amount']; + } + + /** + * Sets ratepay_last_installment_amount + * + * @param string|null $ratepay_last_installment_amount Amount of the last installment. + * + * @return self + */ + public function setRatepayLastInstallmentAmount($ratepay_last_installment_amount) + { + if (is_null($ratepay_last_installment_amount)) { + throw new \InvalidArgumentException('non-nullable ratepay_last_installment_amount cannot be null'); + } + $this->container['ratepay_last_installment_amount'] = $ratepay_last_installment_amount; + + return $this; + } + + /** + * Gets ratepay_payment_firstday + * + * @return string|null + */ + public function getRatepayPaymentFirstday() + { + return $this->container['ratepay_payment_firstday']; + } + + /** + * Sets ratepay_payment_firstday + * + * @param string|null $ratepay_payment_firstday Calendar day of the first payment. + * + * @return self + */ + public function setRatepayPaymentFirstday($ratepay_payment_firstday) + { + if (is_null($ratepay_payment_firstday)) { + throw new \InvalidArgumentException('non-nullable ratepay_payment_firstday cannot be null'); + } + $this->container['ratepay_payment_firstday'] = $ratepay_payment_firstday; + + return $this; + } + + /** + * Gets ratepaydata_delivery_date + * + * @return string|null + */ + public function getRatepaydataDeliveryDate() + { + return $this->container['ratepaydata_delivery_date']; + } + + /** + * Sets ratepaydata_delivery_date + * + * @param string|null $ratepaydata_delivery_date Date the merchant delivered the goods to the customer. + * + * @return self + */ + public function setRatepaydataDeliveryDate($ratepaydata_delivery_date) + { + if (is_null($ratepaydata_delivery_date)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_delivery_date cannot be null'); + } + $this->container['ratepaydata_delivery_date'] = $ratepaydata_delivery_date; + + return $this; + } + + /** + * Gets ratepaydata_due_date + * + * @return string|null + */ + public function getRatepaydataDueDate() + { + return $this->container['ratepaydata_due_date']; + } + + /** + * Sets ratepaydata_due_date + * + * @param string|null $ratepaydata_due_date Date by which the customer must settle the payment. + * + * @return self + */ + public function setRatepaydataDueDate($ratepaydata_due_date) + { + if (is_null($ratepaydata_due_date)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_due_date cannot be null'); + } + $this->container['ratepaydata_due_date'] = $ratepaydata_due_date; + + return $this; + } + + /** + * Gets ratepaydata_invoice_date + * + * @return string|null + */ + public function getRatepaydataInvoiceDate() + { + return $this->container['ratepaydata_invoice_date']; + } + + /** + * Sets ratepaydata_invoice_date + * + * @param string|null $ratepaydata_invoice_date Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. + * + * @return self + */ + public function setRatepaydataInvoiceDate($ratepaydata_invoice_date) + { + if (is_null($ratepaydata_invoice_date)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_invoice_date cannot be null'); + } + $this->container['ratepaydata_invoice_date'] = $ratepaydata_invoice_date; + + return $this; + } + + /** + * Gets ratepaydata_invoice_id + * + * @return string|null + */ + public function getRatepaydataInvoiceId() + { + return $this->container['ratepaydata_invoice_id']; + } + + /** + * Sets ratepaydata_invoice_id + * + * @param string|null $ratepaydata_invoice_id Identification name or number for the invoice, defined by the merchant. + * + * @return self + */ + public function setRatepaydataInvoiceId($ratepaydata_invoice_id) + { + if (is_null($ratepaydata_invoice_id)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_invoice_id cannot be null'); + } + $this->container['ratepaydata_invoice_id'] = $ratepaydata_invoice_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataRetry.php b/src/Adyen/Model/Checkout/AdditionalDataRetry.php new file mode 100644 index 000000000..2c5f6aac4 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataRetry.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataRetry Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataRetry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRetry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'retry_chain_attempt_number' => 'string', + 'retry_order_attempt_number' => 'string', + 'retry_skip_retry' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'retry_chain_attempt_number' => null, + 'retry_order_attempt_number' => null, + 'retry_skip_retry' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'retry_chain_attempt_number' => false, + 'retry_order_attempt_number' => false, + 'retry_skip_retry' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'retry_chain_attempt_number' => 'retry.chainAttemptNumber', + 'retry_order_attempt_number' => 'retry.orderAttemptNumber', + 'retry_skip_retry' => 'retry.skipRetry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'retry_chain_attempt_number' => 'setRetryChainAttemptNumber', + 'retry_order_attempt_number' => 'setRetryOrderAttemptNumber', + 'retry_skip_retry' => 'setRetrySkipRetry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'retry_chain_attempt_number' => 'getRetryChainAttemptNumber', + 'retry_order_attempt_number' => 'getRetryOrderAttemptNumber', + 'retry_skip_retry' => 'getRetrySkipRetry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('retry_chain_attempt_number', $data ?? [], null); + $this->setIfExists('retry_order_attempt_number', $data ?? [], null); + $this->setIfExists('retry_skip_retry', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets retry_chain_attempt_number + * + * @return string|null + */ + public function getRetryChainAttemptNumber() + { + return $this->container['retry_chain_attempt_number']; + } + + /** + * Sets retry_chain_attempt_number + * + * @param string|null $retry_chain_attempt_number The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + * + * @return self + */ + public function setRetryChainAttemptNumber($retry_chain_attempt_number) + { + if (is_null($retry_chain_attempt_number)) { + throw new \InvalidArgumentException('non-nullable retry_chain_attempt_number cannot be null'); + } + $this->container['retry_chain_attempt_number'] = $retry_chain_attempt_number; + + return $this; + } + + /** + * Gets retry_order_attempt_number + * + * @return string|null + */ + public function getRetryOrderAttemptNumber() + { + return $this->container['retry_order_attempt_number']; + } + + /** + * Sets retry_order_attempt_number + * + * @param string|null $retry_order_attempt_number The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + * + * @return self + */ + public function setRetryOrderAttemptNumber($retry_order_attempt_number) + { + if (is_null($retry_order_attempt_number)) { + throw new \InvalidArgumentException('non-nullable retry_order_attempt_number cannot be null'); + } + $this->container['retry_order_attempt_number'] = $retry_order_attempt_number; + + return $this; + } + + /** + * Gets retry_skip_retry + * + * @return string|null + */ + public function getRetrySkipRetry() + { + return $this->container['retry_skip_retry']; + } + + /** + * Sets retry_skip_retry + * + * @param string|null $retry_skip_retry The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + * + * @return self + */ + public function setRetrySkipRetry($retry_skip_retry) + { + if (is_null($retry_skip_retry)) { + throw new \InvalidArgumentException('non-nullable retry_skip_retry cannot be null'); + } + $this->container['retry_skip_retry'] = $retry_skip_retry; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataRisk.php b/src/Adyen/Model/Checkout/AdditionalDataRisk.php new file mode 100644 index 000000000..48c7293a4 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataRisk.php @@ -0,0 +1,1067 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataRisk Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataRisk implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRisk'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'riskdata__custom_field_name' => 'string', + 'riskdata_basket_item_item_nr_amount_per_item' => 'string', + 'riskdata_basket_item_item_nr_brand' => 'string', + 'riskdata_basket_item_item_nr_category' => 'string', + 'riskdata_basket_item_item_nr_color' => 'string', + 'riskdata_basket_item_item_nr_currency' => 'string', + 'riskdata_basket_item_item_nr_item_id' => 'string', + 'riskdata_basket_item_item_nr_manufacturer' => 'string', + 'riskdata_basket_item_item_nr_product_title' => 'string', + 'riskdata_basket_item_item_nr_quantity' => 'string', + 'riskdata_basket_item_item_nr_receiver_email' => 'string', + 'riskdata_basket_item_item_nr_size' => 'string', + 'riskdata_basket_item_item_nr_sku' => 'string', + 'riskdata_basket_item_item_nr_upc' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'string', + 'riskdata_risk_profile_reference' => 'string', + 'riskdata_skip_risk' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'riskdata__custom_field_name' => null, + 'riskdata_basket_item_item_nr_amount_per_item' => null, + 'riskdata_basket_item_item_nr_brand' => null, + 'riskdata_basket_item_item_nr_category' => null, + 'riskdata_basket_item_item_nr_color' => null, + 'riskdata_basket_item_item_nr_currency' => null, + 'riskdata_basket_item_item_nr_item_id' => null, + 'riskdata_basket_item_item_nr_manufacturer' => null, + 'riskdata_basket_item_item_nr_product_title' => null, + 'riskdata_basket_item_item_nr_quantity' => null, + 'riskdata_basket_item_item_nr_receiver_email' => null, + 'riskdata_basket_item_item_nr_size' => null, + 'riskdata_basket_item_item_nr_sku' => null, + 'riskdata_basket_item_item_nr_upc' => null, + 'riskdata_promotions_promotion_item_nr_promotion_code' => null, + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => null, + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => null, + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => null, + 'riskdata_promotions_promotion_item_nr_promotion_name' => null, + 'riskdata_risk_profile_reference' => null, + 'riskdata_skip_risk' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'riskdata__custom_field_name' => false, + 'riskdata_basket_item_item_nr_amount_per_item' => false, + 'riskdata_basket_item_item_nr_brand' => false, + 'riskdata_basket_item_item_nr_category' => false, + 'riskdata_basket_item_item_nr_color' => false, + 'riskdata_basket_item_item_nr_currency' => false, + 'riskdata_basket_item_item_nr_item_id' => false, + 'riskdata_basket_item_item_nr_manufacturer' => false, + 'riskdata_basket_item_item_nr_product_title' => false, + 'riskdata_basket_item_item_nr_quantity' => false, + 'riskdata_basket_item_item_nr_receiver_email' => false, + 'riskdata_basket_item_item_nr_size' => false, + 'riskdata_basket_item_item_nr_sku' => false, + 'riskdata_basket_item_item_nr_upc' => false, + 'riskdata_promotions_promotion_item_nr_promotion_code' => false, + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => false, + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => false, + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => false, + 'riskdata_promotions_promotion_item_nr_promotion_name' => false, + 'riskdata_risk_profile_reference' => false, + 'riskdata_skip_risk' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'riskdata__custom_field_name' => 'riskdata.[customFieldName]', + 'riskdata_basket_item_item_nr_amount_per_item' => 'riskdata.basket.item[itemNr].amountPerItem', + 'riskdata_basket_item_item_nr_brand' => 'riskdata.basket.item[itemNr].brand', + 'riskdata_basket_item_item_nr_category' => 'riskdata.basket.item[itemNr].category', + 'riskdata_basket_item_item_nr_color' => 'riskdata.basket.item[itemNr].color', + 'riskdata_basket_item_item_nr_currency' => 'riskdata.basket.item[itemNr].currency', + 'riskdata_basket_item_item_nr_item_id' => 'riskdata.basket.item[itemNr].itemID', + 'riskdata_basket_item_item_nr_manufacturer' => 'riskdata.basket.item[itemNr].manufacturer', + 'riskdata_basket_item_item_nr_product_title' => 'riskdata.basket.item[itemNr].productTitle', + 'riskdata_basket_item_item_nr_quantity' => 'riskdata.basket.item[itemNr].quantity', + 'riskdata_basket_item_item_nr_receiver_email' => 'riskdata.basket.item[itemNr].receiverEmail', + 'riskdata_basket_item_item_nr_size' => 'riskdata.basket.item[itemNr].size', + 'riskdata_basket_item_item_nr_sku' => 'riskdata.basket.item[itemNr].sku', + 'riskdata_basket_item_item_nr_upc' => 'riskdata.basket.item[itemNr].upc', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'riskdata.promotions.promotion[itemNr].promotionCode', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'riskdata.promotions.promotion[itemNr].promotionDiscountAmount', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'riskdata.promotions.promotion[itemNr].promotionDiscountCurrency', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'riskdata.promotions.promotion[itemNr].promotionDiscountPercentage', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'riskdata.promotions.promotion[itemNr].promotionName', + 'riskdata_risk_profile_reference' => 'riskdata.riskProfileReference', + 'riskdata_skip_risk' => 'riskdata.skipRisk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'riskdata__custom_field_name' => 'setRiskdataCustomFieldName', + 'riskdata_basket_item_item_nr_amount_per_item' => 'setRiskdataBasketItemItemNrAmountPerItem', + 'riskdata_basket_item_item_nr_brand' => 'setRiskdataBasketItemItemNrBrand', + 'riskdata_basket_item_item_nr_category' => 'setRiskdataBasketItemItemNrCategory', + 'riskdata_basket_item_item_nr_color' => 'setRiskdataBasketItemItemNrColor', + 'riskdata_basket_item_item_nr_currency' => 'setRiskdataBasketItemItemNrCurrency', + 'riskdata_basket_item_item_nr_item_id' => 'setRiskdataBasketItemItemNrItemId', + 'riskdata_basket_item_item_nr_manufacturer' => 'setRiskdataBasketItemItemNrManufacturer', + 'riskdata_basket_item_item_nr_product_title' => 'setRiskdataBasketItemItemNrProductTitle', + 'riskdata_basket_item_item_nr_quantity' => 'setRiskdataBasketItemItemNrQuantity', + 'riskdata_basket_item_item_nr_receiver_email' => 'setRiskdataBasketItemItemNrReceiverEmail', + 'riskdata_basket_item_item_nr_size' => 'setRiskdataBasketItemItemNrSize', + 'riskdata_basket_item_item_nr_sku' => 'setRiskdataBasketItemItemNrSku', + 'riskdata_basket_item_item_nr_upc' => 'setRiskdataBasketItemItemNrUpc', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'setRiskdataPromotionsPromotionItemNrPromotionCode', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'setRiskdataPromotionsPromotionItemNrPromotionName', + 'riskdata_risk_profile_reference' => 'setRiskdataRiskProfileReference', + 'riskdata_skip_risk' => 'setRiskdataSkipRisk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'riskdata__custom_field_name' => 'getRiskdataCustomFieldName', + 'riskdata_basket_item_item_nr_amount_per_item' => 'getRiskdataBasketItemItemNrAmountPerItem', + 'riskdata_basket_item_item_nr_brand' => 'getRiskdataBasketItemItemNrBrand', + 'riskdata_basket_item_item_nr_category' => 'getRiskdataBasketItemItemNrCategory', + 'riskdata_basket_item_item_nr_color' => 'getRiskdataBasketItemItemNrColor', + 'riskdata_basket_item_item_nr_currency' => 'getRiskdataBasketItemItemNrCurrency', + 'riskdata_basket_item_item_nr_item_id' => 'getRiskdataBasketItemItemNrItemId', + 'riskdata_basket_item_item_nr_manufacturer' => 'getRiskdataBasketItemItemNrManufacturer', + 'riskdata_basket_item_item_nr_product_title' => 'getRiskdataBasketItemItemNrProductTitle', + 'riskdata_basket_item_item_nr_quantity' => 'getRiskdataBasketItemItemNrQuantity', + 'riskdata_basket_item_item_nr_receiver_email' => 'getRiskdataBasketItemItemNrReceiverEmail', + 'riskdata_basket_item_item_nr_size' => 'getRiskdataBasketItemItemNrSize', + 'riskdata_basket_item_item_nr_sku' => 'getRiskdataBasketItemItemNrSku', + 'riskdata_basket_item_item_nr_upc' => 'getRiskdataBasketItemItemNrUpc', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'getRiskdataPromotionsPromotionItemNrPromotionCode', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountAmount', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'getRiskdataPromotionsPromotionItemNrPromotionName', + 'riskdata_risk_profile_reference' => 'getRiskdataRiskProfileReference', + 'riskdata_skip_risk' => 'getRiskdataSkipRisk' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('riskdata__custom_field_name', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_amount_per_item', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_brand', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_category', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_color', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_currency', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_item_id', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_manufacturer', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_product_title', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_quantity', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_receiver_email', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_size', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_sku', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_upc', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_code', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_discount_amount', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_discount_currency', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_discount_percentage', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_name', $data ?? [], null); + $this->setIfExists('riskdata_risk_profile_reference', $data ?? [], null); + $this->setIfExists('riskdata_skip_risk', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets riskdata__custom_field_name + * + * @return string|null + */ + public function getRiskdataCustomFieldName() + { + return $this->container['riskdata__custom_field_name']; + } + + /** + * Sets riskdata__custom_field_name + * + * @param string|null $riskdata__custom_field_name The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). + * + * @return self + */ + public function setRiskdataCustomFieldName($riskdata__custom_field_name) + { + if (is_null($riskdata__custom_field_name)) { + throw new \InvalidArgumentException('non-nullable riskdata__custom_field_name cannot be null'); + } + $this->container['riskdata__custom_field_name'] = $riskdata__custom_field_name; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_amount_per_item + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrAmountPerItem() + { + return $this->container['riskdata_basket_item_item_nr_amount_per_item']; + } + + /** + * Sets riskdata_basket_item_item_nr_amount_per_item + * + * @param string|null $riskdata_basket_item_item_nr_amount_per_item The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setRiskdataBasketItemItemNrAmountPerItem($riskdata_basket_item_item_nr_amount_per_item) + { + if (is_null($riskdata_basket_item_item_nr_amount_per_item)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_amount_per_item cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_amount_per_item'] = $riskdata_basket_item_item_nr_amount_per_item; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_brand + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrBrand() + { + return $this->container['riskdata_basket_item_item_nr_brand']; + } + + /** + * Sets riskdata_basket_item_item_nr_brand + * + * @param string|null $riskdata_basket_item_item_nr_brand Brand of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrBrand($riskdata_basket_item_item_nr_brand) + { + if (is_null($riskdata_basket_item_item_nr_brand)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_brand cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_brand'] = $riskdata_basket_item_item_nr_brand; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_category + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrCategory() + { + return $this->container['riskdata_basket_item_item_nr_category']; + } + + /** + * Sets riskdata_basket_item_item_nr_category + * + * @param string|null $riskdata_basket_item_item_nr_category Category of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrCategory($riskdata_basket_item_item_nr_category) + { + if (is_null($riskdata_basket_item_item_nr_category)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_category cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_category'] = $riskdata_basket_item_item_nr_category; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_color + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrColor() + { + return $this->container['riskdata_basket_item_item_nr_color']; + } + + /** + * Sets riskdata_basket_item_item_nr_color + * + * @param string|null $riskdata_basket_item_item_nr_color Color of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrColor($riskdata_basket_item_item_nr_color) + { + if (is_null($riskdata_basket_item_item_nr_color)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_color cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_color'] = $riskdata_basket_item_item_nr_color; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_currency + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrCurrency() + { + return $this->container['riskdata_basket_item_item_nr_currency']; + } + + /** + * Sets riskdata_basket_item_item_nr_currency + * + * @param string|null $riskdata_basket_item_item_nr_currency The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + * + * @return self + */ + public function setRiskdataBasketItemItemNrCurrency($riskdata_basket_item_item_nr_currency) + { + if (is_null($riskdata_basket_item_item_nr_currency)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_currency cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_currency'] = $riskdata_basket_item_item_nr_currency; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_item_id + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrItemId() + { + return $this->container['riskdata_basket_item_item_nr_item_id']; + } + + /** + * Sets riskdata_basket_item_item_nr_item_id + * + * @param string|null $riskdata_basket_item_item_nr_item_id ID of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrItemId($riskdata_basket_item_item_nr_item_id) + { + if (is_null($riskdata_basket_item_item_nr_item_id)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_item_id cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_item_id'] = $riskdata_basket_item_item_nr_item_id; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_manufacturer + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrManufacturer() + { + return $this->container['riskdata_basket_item_item_nr_manufacturer']; + } + + /** + * Sets riskdata_basket_item_item_nr_manufacturer + * + * @param string|null $riskdata_basket_item_item_nr_manufacturer Manufacturer of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrManufacturer($riskdata_basket_item_item_nr_manufacturer) + { + if (is_null($riskdata_basket_item_item_nr_manufacturer)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_manufacturer cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_manufacturer'] = $riskdata_basket_item_item_nr_manufacturer; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_product_title + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrProductTitle() + { + return $this->container['riskdata_basket_item_item_nr_product_title']; + } + + /** + * Sets riskdata_basket_item_item_nr_product_title + * + * @param string|null $riskdata_basket_item_item_nr_product_title A text description of the product the invoice line refers to. + * + * @return self + */ + public function setRiskdataBasketItemItemNrProductTitle($riskdata_basket_item_item_nr_product_title) + { + if (is_null($riskdata_basket_item_item_nr_product_title)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_product_title cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_product_title'] = $riskdata_basket_item_item_nr_product_title; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_quantity + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrQuantity() + { + return $this->container['riskdata_basket_item_item_nr_quantity']; + } + + /** + * Sets riskdata_basket_item_item_nr_quantity + * + * @param string|null $riskdata_basket_item_item_nr_quantity Quantity of the item purchased. + * + * @return self + */ + public function setRiskdataBasketItemItemNrQuantity($riskdata_basket_item_item_nr_quantity) + { + if (is_null($riskdata_basket_item_item_nr_quantity)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_quantity cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_quantity'] = $riskdata_basket_item_item_nr_quantity; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_receiver_email + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrReceiverEmail() + { + return $this->container['riskdata_basket_item_item_nr_receiver_email']; + } + + /** + * Sets riskdata_basket_item_item_nr_receiver_email + * + * @param string|null $riskdata_basket_item_item_nr_receiver_email Email associated with the given product in the basket (usually in electronic gift cards). + * + * @return self + */ + public function setRiskdataBasketItemItemNrReceiverEmail($riskdata_basket_item_item_nr_receiver_email) + { + if (is_null($riskdata_basket_item_item_nr_receiver_email)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_receiver_email cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_receiver_email'] = $riskdata_basket_item_item_nr_receiver_email; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_size + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrSize() + { + return $this->container['riskdata_basket_item_item_nr_size']; + } + + /** + * Sets riskdata_basket_item_item_nr_size + * + * @param string|null $riskdata_basket_item_item_nr_size Size of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrSize($riskdata_basket_item_item_nr_size) + { + if (is_null($riskdata_basket_item_item_nr_size)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_size cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_size'] = $riskdata_basket_item_item_nr_size; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_sku + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrSku() + { + return $this->container['riskdata_basket_item_item_nr_sku']; + } + + /** + * Sets riskdata_basket_item_item_nr_sku + * + * @param string|null $riskdata_basket_item_item_nr_sku [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). + * + * @return self + */ + public function setRiskdataBasketItemItemNrSku($riskdata_basket_item_item_nr_sku) + { + if (is_null($riskdata_basket_item_item_nr_sku)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_sku cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_sku'] = $riskdata_basket_item_item_nr_sku; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_upc + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrUpc() + { + return $this->container['riskdata_basket_item_item_nr_upc']; + } + + /** + * Sets riskdata_basket_item_item_nr_upc + * + * @param string|null $riskdata_basket_item_item_nr_upc [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). + * + * @return self + */ + public function setRiskdataBasketItemItemNrUpc($riskdata_basket_item_item_nr_upc) + { + if (is_null($riskdata_basket_item_item_nr_upc)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_upc cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_upc'] = $riskdata_basket_item_item_nr_upc; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_code + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionCode() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_code']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_code + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_code Code of the promotion. + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionCode($riskdata_promotions_promotion_item_nr_promotion_code) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_code)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_code cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_code'] = $riskdata_promotions_promotion_item_nr_promotion_code; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_discount_amount + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionDiscountAmount() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_amount']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_discount_amount + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_discount_amount The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount($riskdata_promotions_promotion_item_nr_promotion_discount_amount) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_discount_amount)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_discount_amount cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_amount'] = $riskdata_promotions_promotion_item_nr_promotion_discount_amount; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_discount_currency + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_currency']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_discount_currency + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_discount_currency The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency($riskdata_promotions_promotion_item_nr_promotion_discount_currency) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_discount_currency)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_discount_currency cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_currency'] = $riskdata_promotions_promotion_item_nr_promotion_discount_currency; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_discount_percentage + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_percentage']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_discount_percentage + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_discount_percentage Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage($riskdata_promotions_promotion_item_nr_promotion_discount_percentage) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_discount_percentage)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_discount_percentage cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_percentage'] = $riskdata_promotions_promotion_item_nr_promotion_discount_percentage; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_name + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionName() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_name']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_name + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_name Name of the promotion. + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionName($riskdata_promotions_promotion_item_nr_promotion_name) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_name)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_name cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_name'] = $riskdata_promotions_promotion_item_nr_promotion_name; + + return $this; + } + + /** + * Gets riskdata_risk_profile_reference + * + * @return string|null + */ + public function getRiskdataRiskProfileReference() + { + return $this->container['riskdata_risk_profile_reference']; + } + + /** + * Sets riskdata_risk_profile_reference + * + * @param string|null $riskdata_risk_profile_reference Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). + * + * @return self + */ + public function setRiskdataRiskProfileReference($riskdata_risk_profile_reference) + { + if (is_null($riskdata_risk_profile_reference)) { + throw new \InvalidArgumentException('non-nullable riskdata_risk_profile_reference cannot be null'); + } + $this->container['riskdata_risk_profile_reference'] = $riskdata_risk_profile_reference; + + return $this; + } + + /** + * Gets riskdata_skip_risk + * + * @return string|null + */ + public function getRiskdataSkipRisk() + { + return $this->container['riskdata_skip_risk']; + } + + /** + * Sets riskdata_skip_risk + * + * @param string|null $riskdata_skip_risk If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. + * + * @return self + */ + public function setRiskdataSkipRisk($riskdata_skip_risk) + { + if (is_null($riskdata_skip_risk)) { + throw new \InvalidArgumentException('non-nullable riskdata_skip_risk cannot be null'); + } + $this->container['riskdata_skip_risk'] = $riskdata_skip_risk; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php b/src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php new file mode 100644 index 000000000..0702de691 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataRiskStandalone.php @@ -0,0 +1,863 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataRiskStandalone Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataRiskStandalone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRiskStandalone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pay_pal_country_code' => 'string', + 'pay_pal_email_id' => 'string', + 'pay_pal_first_name' => 'string', + 'pay_pal_last_name' => 'string', + 'pay_pal_payer_id' => 'string', + 'pay_pal_phone' => 'string', + 'pay_pal_protection_eligibility' => 'string', + 'pay_pal_transaction_id' => 'string', + 'avs_result_raw' => 'string', + 'bin' => 'string', + 'cvc_result_raw' => 'string', + 'risk_token' => 'string', + 'three_d_authenticated' => 'string', + 'three_d_offered' => 'string', + 'token_data_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pay_pal_country_code' => null, + 'pay_pal_email_id' => null, + 'pay_pal_first_name' => null, + 'pay_pal_last_name' => null, + 'pay_pal_payer_id' => null, + 'pay_pal_phone' => null, + 'pay_pal_protection_eligibility' => null, + 'pay_pal_transaction_id' => null, + 'avs_result_raw' => null, + 'bin' => null, + 'cvc_result_raw' => null, + 'risk_token' => null, + 'three_d_authenticated' => null, + 'three_d_offered' => null, + 'token_data_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'pay_pal_country_code' => false, + 'pay_pal_email_id' => false, + 'pay_pal_first_name' => false, + 'pay_pal_last_name' => false, + 'pay_pal_payer_id' => false, + 'pay_pal_phone' => false, + 'pay_pal_protection_eligibility' => false, + 'pay_pal_transaction_id' => false, + 'avs_result_raw' => false, + 'bin' => false, + 'cvc_result_raw' => false, + 'risk_token' => false, + 'three_d_authenticated' => false, + 'three_d_offered' => false, + 'token_data_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pay_pal_country_code' => 'PayPal.CountryCode', + 'pay_pal_email_id' => 'PayPal.EmailId', + 'pay_pal_first_name' => 'PayPal.FirstName', + 'pay_pal_last_name' => 'PayPal.LastName', + 'pay_pal_payer_id' => 'PayPal.PayerId', + 'pay_pal_phone' => 'PayPal.Phone', + 'pay_pal_protection_eligibility' => 'PayPal.ProtectionEligibility', + 'pay_pal_transaction_id' => 'PayPal.TransactionId', + 'avs_result_raw' => 'avsResultRaw', + 'bin' => 'bin', + 'cvc_result_raw' => 'cvcResultRaw', + 'risk_token' => 'riskToken', + 'three_d_authenticated' => 'threeDAuthenticated', + 'three_d_offered' => 'threeDOffered', + 'token_data_type' => 'tokenDataType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pay_pal_country_code' => 'setPayPalCountryCode', + 'pay_pal_email_id' => 'setPayPalEmailId', + 'pay_pal_first_name' => 'setPayPalFirstName', + 'pay_pal_last_name' => 'setPayPalLastName', + 'pay_pal_payer_id' => 'setPayPalPayerId', + 'pay_pal_phone' => 'setPayPalPhone', + 'pay_pal_protection_eligibility' => 'setPayPalProtectionEligibility', + 'pay_pal_transaction_id' => 'setPayPalTransactionId', + 'avs_result_raw' => 'setAvsResultRaw', + 'bin' => 'setBin', + 'cvc_result_raw' => 'setCvcResultRaw', + 'risk_token' => 'setRiskToken', + 'three_d_authenticated' => 'setThreeDAuthenticated', + 'three_d_offered' => 'setThreeDOffered', + 'token_data_type' => 'setTokenDataType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pay_pal_country_code' => 'getPayPalCountryCode', + 'pay_pal_email_id' => 'getPayPalEmailId', + 'pay_pal_first_name' => 'getPayPalFirstName', + 'pay_pal_last_name' => 'getPayPalLastName', + 'pay_pal_payer_id' => 'getPayPalPayerId', + 'pay_pal_phone' => 'getPayPalPhone', + 'pay_pal_protection_eligibility' => 'getPayPalProtectionEligibility', + 'pay_pal_transaction_id' => 'getPayPalTransactionId', + 'avs_result_raw' => 'getAvsResultRaw', + 'bin' => 'getBin', + 'cvc_result_raw' => 'getCvcResultRaw', + 'risk_token' => 'getRiskToken', + 'three_d_authenticated' => 'getThreeDAuthenticated', + 'three_d_offered' => 'getThreeDOffered', + 'token_data_type' => 'getTokenDataType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pay_pal_country_code', $data ?? [], null); + $this->setIfExists('pay_pal_email_id', $data ?? [], null); + $this->setIfExists('pay_pal_first_name', $data ?? [], null); + $this->setIfExists('pay_pal_last_name', $data ?? [], null); + $this->setIfExists('pay_pal_payer_id', $data ?? [], null); + $this->setIfExists('pay_pal_phone', $data ?? [], null); + $this->setIfExists('pay_pal_protection_eligibility', $data ?? [], null); + $this->setIfExists('pay_pal_transaction_id', $data ?? [], null); + $this->setIfExists('avs_result_raw', $data ?? [], null); + $this->setIfExists('bin', $data ?? [], null); + $this->setIfExists('cvc_result_raw', $data ?? [], null); + $this->setIfExists('risk_token', $data ?? [], null); + $this->setIfExists('three_d_authenticated', $data ?? [], null); + $this->setIfExists('three_d_offered', $data ?? [], null); + $this->setIfExists('token_data_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pay_pal_country_code + * + * @return string|null + */ + public function getPayPalCountryCode() + { + return $this->container['pay_pal_country_code']; + } + + /** + * Sets pay_pal_country_code + * + * @param string|null $pay_pal_country_code Shopper's country of residence in the form of ISO standard 3166 2-character country codes. + * + * @return self + */ + public function setPayPalCountryCode($pay_pal_country_code) + { + if (is_null($pay_pal_country_code)) { + throw new \InvalidArgumentException('non-nullable pay_pal_country_code cannot be null'); + } + $this->container['pay_pal_country_code'] = $pay_pal_country_code; + + return $this; + } + + /** + * Gets pay_pal_email_id + * + * @return string|null + */ + public function getPayPalEmailId() + { + return $this->container['pay_pal_email_id']; + } + + /** + * Sets pay_pal_email_id + * + * @param string|null $pay_pal_email_id Shopper's email. + * + * @return self + */ + public function setPayPalEmailId($pay_pal_email_id) + { + if (is_null($pay_pal_email_id)) { + throw new \InvalidArgumentException('non-nullable pay_pal_email_id cannot be null'); + } + $this->container['pay_pal_email_id'] = $pay_pal_email_id; + + return $this; + } + + /** + * Gets pay_pal_first_name + * + * @return string|null + */ + public function getPayPalFirstName() + { + return $this->container['pay_pal_first_name']; + } + + /** + * Sets pay_pal_first_name + * + * @param string|null $pay_pal_first_name Shopper's first name. + * + * @return self + */ + public function setPayPalFirstName($pay_pal_first_name) + { + if (is_null($pay_pal_first_name)) { + throw new \InvalidArgumentException('non-nullable pay_pal_first_name cannot be null'); + } + $this->container['pay_pal_first_name'] = $pay_pal_first_name; + + return $this; + } + + /** + * Gets pay_pal_last_name + * + * @return string|null + */ + public function getPayPalLastName() + { + return $this->container['pay_pal_last_name']; + } + + /** + * Sets pay_pal_last_name + * + * @param string|null $pay_pal_last_name Shopper's last name. + * + * @return self + */ + public function setPayPalLastName($pay_pal_last_name) + { + if (is_null($pay_pal_last_name)) { + throw new \InvalidArgumentException('non-nullable pay_pal_last_name cannot be null'); + } + $this->container['pay_pal_last_name'] = $pay_pal_last_name; + + return $this; + } + + /** + * Gets pay_pal_payer_id + * + * @return string|null + */ + public function getPayPalPayerId() + { + return $this->container['pay_pal_payer_id']; + } + + /** + * Sets pay_pal_payer_id + * + * @param string|null $pay_pal_payer_id Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. + * + * @return self + */ + public function setPayPalPayerId($pay_pal_payer_id) + { + if (is_null($pay_pal_payer_id)) { + throw new \InvalidArgumentException('non-nullable pay_pal_payer_id cannot be null'); + } + $this->container['pay_pal_payer_id'] = $pay_pal_payer_id; + + return $this; + } + + /** + * Gets pay_pal_phone + * + * @return string|null + */ + public function getPayPalPhone() + { + return $this->container['pay_pal_phone']; + } + + /** + * Sets pay_pal_phone + * + * @param string|null $pay_pal_phone Shopper's phone number. + * + * @return self + */ + public function setPayPalPhone($pay_pal_phone) + { + if (is_null($pay_pal_phone)) { + throw new \InvalidArgumentException('non-nullable pay_pal_phone cannot be null'); + } + $this->container['pay_pal_phone'] = $pay_pal_phone; + + return $this; + } + + /** + * Gets pay_pal_protection_eligibility + * + * @return string|null + */ + public function getPayPalProtectionEligibility() + { + return $this->container['pay_pal_protection_eligibility']; + } + + /** + * Sets pay_pal_protection_eligibility + * + * @param string|null $pay_pal_protection_eligibility Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. + * + * @return self + */ + public function setPayPalProtectionEligibility($pay_pal_protection_eligibility) + { + if (is_null($pay_pal_protection_eligibility)) { + throw new \InvalidArgumentException('non-nullable pay_pal_protection_eligibility cannot be null'); + } + $this->container['pay_pal_protection_eligibility'] = $pay_pal_protection_eligibility; + + return $this; + } + + /** + * Gets pay_pal_transaction_id + * + * @return string|null + */ + public function getPayPalTransactionId() + { + return $this->container['pay_pal_transaction_id']; + } + + /** + * Sets pay_pal_transaction_id + * + * @param string|null $pay_pal_transaction_id Unique transaction ID of the payment. + * + * @return self + */ + public function setPayPalTransactionId($pay_pal_transaction_id) + { + if (is_null($pay_pal_transaction_id)) { + throw new \InvalidArgumentException('non-nullable pay_pal_transaction_id cannot be null'); + } + $this->container['pay_pal_transaction_id'] = $pay_pal_transaction_id; + + return $this; + } + + /** + * Gets avs_result_raw + * + * @return string|null + */ + public function getAvsResultRaw() + { + return $this->container['avs_result_raw']; + } + + /** + * Sets avs_result_raw + * + * @param string|null $avs_result_raw Raw AVS result received from the acquirer, where available. Example: D + * + * @return self + */ + public function setAvsResultRaw($avs_result_raw) + { + if (is_null($avs_result_raw)) { + throw new \InvalidArgumentException('non-nullable avs_result_raw cannot be null'); + } + $this->container['avs_result_raw'] = $avs_result_raw; + + return $this; + } + + /** + * Gets bin + * + * @return string|null + */ + public function getBin() + { + return $this->container['bin']; + } + + /** + * Sets bin + * + * @param string|null $bin The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/risk-management/standalone-risk#tokenised-pan-request). + * + * @return self + */ + public function setBin($bin) + { + if (is_null($bin)) { + throw new \InvalidArgumentException('non-nullable bin cannot be null'); + } + $this->container['bin'] = $bin; + + return $this; + } + + /** + * Gets cvc_result_raw + * + * @return string|null + */ + public function getCvcResultRaw() + { + return $this->container['cvc_result_raw']; + } + + /** + * Sets cvc_result_raw + * + * @param string|null $cvc_result_raw Raw CVC result received from the acquirer, where available. Example: 1 + * + * @return self + */ + public function setCvcResultRaw($cvc_result_raw) + { + if (is_null($cvc_result_raw)) { + throw new \InvalidArgumentException('non-nullable cvc_result_raw cannot be null'); + } + $this->container['cvc_result_raw'] = $cvc_result_raw; + + return $this; + } + + /** + * Gets risk_token + * + * @return string|null + */ + public function getRiskToken() + { + return $this->container['risk_token']; + } + + /** + * Sets risk_token + * + * @param string|null $risk_token Unique identifier or token for the shopper's card details. + * + * @return self + */ + public function setRiskToken($risk_token) + { + if (is_null($risk_token)) { + throw new \InvalidArgumentException('non-nullable risk_token cannot be null'); + } + $this->container['risk_token'] = $risk_token; + + return $this; + } + + /** + * Gets three_d_authenticated + * + * @return string|null + */ + public function getThreeDAuthenticated() + { + return $this->container['three_d_authenticated']; + } + + /** + * Sets three_d_authenticated + * + * @param string|null $three_d_authenticated A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + * + * @return self + */ + public function setThreeDAuthenticated($three_d_authenticated) + { + if (is_null($three_d_authenticated)) { + throw new \InvalidArgumentException('non-nullable three_d_authenticated cannot be null'); + } + $this->container['three_d_authenticated'] = $three_d_authenticated; + + return $this; + } + + /** + * Gets three_d_offered + * + * @return string|null + */ + public function getThreeDOffered() + { + return $this->container['three_d_offered']; + } + + /** + * Sets three_d_offered + * + * @param string|null $three_d_offered A Boolean value indicating whether 3DS was offered for this payment. Example: true + * + * @return self + */ + public function setThreeDOffered($three_d_offered) + { + if (is_null($three_d_offered)) { + throw new \InvalidArgumentException('non-nullable three_d_offered cannot be null'); + } + $this->container['three_d_offered'] = $three_d_offered; + + return $this; + } + + /** + * Gets token_data_type + * + * @return string|null + */ + public function getTokenDataType() + { + return $this->container['token_data_type']; + } + + /** + * Sets token_data_type + * + * @param string|null $token_data_type Required for PayPal payments only. The only supported value is: **paypal**. + * + * @return self + */ + public function setTokenDataType($token_data_type) + { + if (is_null($token_data_type)) { + throw new \InvalidArgumentException('non-nullable token_data_type cannot be null'); + } + $this->container['token_data_type'] = $token_data_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php b/src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php new file mode 100644 index 000000000..545981046 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataSubMerchant.php @@ -0,0 +1,693 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataSubMerchant Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataSubMerchant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataSubMerchant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sub_merchant_number_of_sub_sellers' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sub_merchant_number_of_sub_sellers' => null, + 'sub_merchant_sub_seller_sub_seller_nr_city' => null, + 'sub_merchant_sub_seller_sub_seller_nr_country' => null, + 'sub_merchant_sub_seller_sub_seller_nr_id' => null, + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => null, + 'sub_merchant_sub_seller_sub_seller_nr_name' => null, + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => null, + 'sub_merchant_sub_seller_sub_seller_nr_state' => null, + 'sub_merchant_sub_seller_sub_seller_nr_street' => null, + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sub_merchant_number_of_sub_sellers' => false, + 'sub_merchant_sub_seller_sub_seller_nr_city' => false, + 'sub_merchant_sub_seller_sub_seller_nr_country' => false, + 'sub_merchant_sub_seller_sub_seller_nr_id' => false, + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => false, + 'sub_merchant_sub_seller_sub_seller_nr_name' => false, + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => false, + 'sub_merchant_sub_seller_sub_seller_nr_state' => false, + 'sub_merchant_sub_seller_sub_seller_nr_street' => false, + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sub_merchant_number_of_sub_sellers' => 'subMerchant.numberOfSubSellers', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'subMerchant.subSeller[subSellerNr].city', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'subMerchant.subSeller[subSellerNr].country', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'subMerchant.subSeller[subSellerNr].id', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'subMerchant.subSeller[subSellerNr].mcc', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'subMerchant.subSeller[subSellerNr].name', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'subMerchant.subSeller[subSellerNr].postalCode', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'subMerchant.subSeller[subSellerNr].state', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'subMerchant.subSeller[subSellerNr].street', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'subMerchant.subSeller[subSellerNr].taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sub_merchant_number_of_sub_sellers' => 'setSubMerchantNumberOfSubSellers', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'setSubMerchantSubSellerSubSellerNrCity', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'setSubMerchantSubSellerSubSellerNrCountry', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'setSubMerchantSubSellerSubSellerNrId', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'setSubMerchantSubSellerSubSellerNrMcc', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'setSubMerchantSubSellerSubSellerNrName', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'setSubMerchantSubSellerSubSellerNrPostalCode', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'setSubMerchantSubSellerSubSellerNrState', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'setSubMerchantSubSellerSubSellerNrStreet', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'setSubMerchantSubSellerSubSellerNrTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sub_merchant_number_of_sub_sellers' => 'getSubMerchantNumberOfSubSellers', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'getSubMerchantSubSellerSubSellerNrCity', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'getSubMerchantSubSellerSubSellerNrCountry', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'getSubMerchantSubSellerSubSellerNrId', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'getSubMerchantSubSellerSubSellerNrMcc', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'getSubMerchantSubSellerSubSellerNrName', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'getSubMerchantSubSellerSubSellerNrPostalCode', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'getSubMerchantSubSellerSubSellerNrState', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'getSubMerchantSubSellerSubSellerNrStreet', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'getSubMerchantSubSellerSubSellerNrTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('sub_merchant_number_of_sub_sellers', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_city', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_country', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_id', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_mcc', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_name', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_postal_code', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_state', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_street', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sub_merchant_number_of_sub_sellers + * + * @return string|null + */ + public function getSubMerchantNumberOfSubSellers() + { + return $this->container['sub_merchant_number_of_sub_sellers']; + } + + /** + * Sets sub_merchant_number_of_sub_sellers + * + * @param string|null $sub_merchant_number_of_sub_sellers Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. + * + * @return self + */ + public function setSubMerchantNumberOfSubSellers($sub_merchant_number_of_sub_sellers) + { + if (is_null($sub_merchant_number_of_sub_sellers)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_number_of_sub_sellers cannot be null'); + } + $this->container['sub_merchant_number_of_sub_sellers'] = $sub_merchant_number_of_sub_sellers; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_city + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrCity() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_city']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_city + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_city Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrCity($sub_merchant_sub_seller_sub_seller_nr_city) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_city)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_city cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_city'] = $sub_merchant_sub_seller_sub_seller_nr_city; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_country + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrCountry() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_country']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_country + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_country Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrCountry($sub_merchant_sub_seller_sub_seller_nr_country) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_country)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_country cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_country'] = $sub_merchant_sub_seller_sub_seller_nr_country; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_id + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrId() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_id']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_id + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_id Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrId($sub_merchant_sub_seller_sub_seller_nr_id) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_id cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_id'] = $sub_merchant_sub_seller_sub_seller_nr_id; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_mcc + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrMcc() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_mcc']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_mcc + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_mcc Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrMcc($sub_merchant_sub_seller_sub_seller_nr_mcc) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_mcc)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_mcc cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_mcc'] = $sub_merchant_sub_seller_sub_seller_nr_mcc; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_name + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrName() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_name']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_name + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_name Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrName($sub_merchant_sub_seller_sub_seller_nr_name) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_name)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_name cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_name'] = $sub_merchant_sub_seller_sub_seller_nr_name; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_postal_code + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrPostalCode() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_postal_code']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_postal_code + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_postal_code Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrPostalCode($sub_merchant_sub_seller_sub_seller_nr_postal_code) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_postal_code)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_postal_code cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_postal_code'] = $sub_merchant_sub_seller_sub_seller_nr_postal_code; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_state + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrState() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_state']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_state + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_state Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrState($sub_merchant_sub_seller_sub_seller_nr_state) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_state)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_state cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_state'] = $sub_merchant_sub_seller_sub_seller_nr_state; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_street + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrStreet() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_street']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_street + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_street Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrStreet($sub_merchant_sub_seller_sub_seller_nr_street) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_street)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_street cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_street'] = $sub_merchant_sub_seller_sub_seller_nr_street; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_tax_id + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrTaxId() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_tax_id']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_tax_id + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_tax_id Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrTaxId($sub_merchant_sub_seller_sub_seller_nr_tax_id) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_tax_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_tax_id cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_tax_id'] = $sub_merchant_sub_seller_sub_seller_nr_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php b/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php new file mode 100644 index 000000000..91476fa36 --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataTemporaryServices.php @@ -0,0 +1,659 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataTemporaryServices Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataTemporaryServices implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataTemporaryServices'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enhanced_scheme_data_customer_reference' => 'string', + 'enhanced_scheme_data_employee_name' => 'string', + 'enhanced_scheme_data_job_description' => 'string', + 'enhanced_scheme_data_regular_hours_rate' => 'string', + 'enhanced_scheme_data_regular_hours_worked' => 'string', + 'enhanced_scheme_data_request_name' => 'string', + 'enhanced_scheme_data_temp_start_date' => 'string', + 'enhanced_scheme_data_temp_week_ending' => 'string', + 'enhanced_scheme_data_total_tax_amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enhanced_scheme_data_customer_reference' => null, + 'enhanced_scheme_data_employee_name' => null, + 'enhanced_scheme_data_job_description' => null, + 'enhanced_scheme_data_regular_hours_rate' => null, + 'enhanced_scheme_data_regular_hours_worked' => null, + 'enhanced_scheme_data_request_name' => null, + 'enhanced_scheme_data_temp_start_date' => null, + 'enhanced_scheme_data_temp_week_ending' => null, + 'enhanced_scheme_data_total_tax_amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enhanced_scheme_data_customer_reference' => false, + 'enhanced_scheme_data_employee_name' => false, + 'enhanced_scheme_data_job_description' => false, + 'enhanced_scheme_data_regular_hours_rate' => false, + 'enhanced_scheme_data_regular_hours_worked' => false, + 'enhanced_scheme_data_request_name' => false, + 'enhanced_scheme_data_temp_start_date' => false, + 'enhanced_scheme_data_temp_week_ending' => false, + 'enhanced_scheme_data_total_tax_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enhanced_scheme_data_customer_reference' => 'enhancedSchemeData.customerReference', + 'enhanced_scheme_data_employee_name' => 'enhancedSchemeData.employeeName', + 'enhanced_scheme_data_job_description' => 'enhancedSchemeData.jobDescription', + 'enhanced_scheme_data_regular_hours_rate' => 'enhancedSchemeData.regularHoursRate', + 'enhanced_scheme_data_regular_hours_worked' => 'enhancedSchemeData.regularHoursWorked', + 'enhanced_scheme_data_request_name' => 'enhancedSchemeData.requestName', + 'enhanced_scheme_data_temp_start_date' => 'enhancedSchemeData.tempStartDate', + 'enhanced_scheme_data_temp_week_ending' => 'enhancedSchemeData.tempWeekEnding', + 'enhanced_scheme_data_total_tax_amount' => 'enhancedSchemeData.totalTaxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enhanced_scheme_data_customer_reference' => 'setEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_employee_name' => 'setEnhancedSchemeDataEmployeeName', + 'enhanced_scheme_data_job_description' => 'setEnhancedSchemeDataJobDescription', + 'enhanced_scheme_data_regular_hours_rate' => 'setEnhancedSchemeDataRegularHoursRate', + 'enhanced_scheme_data_regular_hours_worked' => 'setEnhancedSchemeDataRegularHoursWorked', + 'enhanced_scheme_data_request_name' => 'setEnhancedSchemeDataRequestName', + 'enhanced_scheme_data_temp_start_date' => 'setEnhancedSchemeDataTempStartDate', + 'enhanced_scheme_data_temp_week_ending' => 'setEnhancedSchemeDataTempWeekEnding', + 'enhanced_scheme_data_total_tax_amount' => 'setEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enhanced_scheme_data_customer_reference' => 'getEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_employee_name' => 'getEnhancedSchemeDataEmployeeName', + 'enhanced_scheme_data_job_description' => 'getEnhancedSchemeDataJobDescription', + 'enhanced_scheme_data_regular_hours_rate' => 'getEnhancedSchemeDataRegularHoursRate', + 'enhanced_scheme_data_regular_hours_worked' => 'getEnhancedSchemeDataRegularHoursWorked', + 'enhanced_scheme_data_request_name' => 'getEnhancedSchemeDataRequestName', + 'enhanced_scheme_data_temp_start_date' => 'getEnhancedSchemeDataTempStartDate', + 'enhanced_scheme_data_temp_week_ending' => 'getEnhancedSchemeDataTempWeekEnding', + 'enhanced_scheme_data_total_tax_amount' => 'getEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enhanced_scheme_data_customer_reference', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_employee_name', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_job_description', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_regular_hours_rate', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_regular_hours_worked', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_request_name', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_temp_start_date', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_temp_week_ending', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_total_tax_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enhanced_scheme_data_customer_reference + * + * @return string|null + */ + public function getEnhancedSchemeDataCustomerReference() + { + return $this->container['enhanced_scheme_data_customer_reference']; + } + + /** + * Sets enhanced_scheme_data_customer_reference + * + * @param string|null $enhanced_scheme_data_customer_reference Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + * + * @return self + */ + public function setEnhancedSchemeDataCustomerReference($enhanced_scheme_data_customer_reference) + { + if (is_null($enhanced_scheme_data_customer_reference)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_customer_reference cannot be null'); + } + $this->container['enhanced_scheme_data_customer_reference'] = $enhanced_scheme_data_customer_reference; + + return $this; + } + + /** + * Gets enhanced_scheme_data_employee_name + * + * @return string|null + */ + public function getEnhancedSchemeDataEmployeeName() + { + return $this->container['enhanced_scheme_data_employee_name']; + } + + /** + * Sets enhanced_scheme_data_employee_name + * + * @param string|null $enhanced_scheme_data_employee_name Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 + * + * @return self + */ + public function setEnhancedSchemeDataEmployeeName($enhanced_scheme_data_employee_name) + { + if (is_null($enhanced_scheme_data_employee_name)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_employee_name cannot be null'); + } + $this->container['enhanced_scheme_data_employee_name'] = $enhanced_scheme_data_employee_name; + + return $this; + } + + /** + * Gets enhanced_scheme_data_job_description + * + * @return string|null + */ + public function getEnhancedSchemeDataJobDescription() + { + return $this->container['enhanced_scheme_data_job_description']; + } + + /** + * Sets enhanced_scheme_data_job_description + * + * @param string|null $enhanced_scheme_data_job_description Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 + * + * @return self + */ + public function setEnhancedSchemeDataJobDescription($enhanced_scheme_data_job_description) + { + if (is_null($enhanced_scheme_data_job_description)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_job_description cannot be null'); + } + $this->container['enhanced_scheme_data_job_description'] = $enhanced_scheme_data_job_description; + + return $this; + } + + /** + * Gets enhanced_scheme_data_regular_hours_rate + * + * @return string|null + */ + public function getEnhancedSchemeDataRegularHoursRate() + { + return $this->container['enhanced_scheme_data_regular_hours_rate']; + } + + /** + * Sets enhanced_scheme_data_regular_hours_rate + * + * @param string|null $enhanced_scheme_data_regular_hours_rate Amount paid per regular hours worked, minor units. * maxLength: 7 + * + * @return self + */ + public function setEnhancedSchemeDataRegularHoursRate($enhanced_scheme_data_regular_hours_rate) + { + if (is_null($enhanced_scheme_data_regular_hours_rate)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_regular_hours_rate cannot be null'); + } + $this->container['enhanced_scheme_data_regular_hours_rate'] = $enhanced_scheme_data_regular_hours_rate; + + return $this; + } + + /** + * Gets enhanced_scheme_data_regular_hours_worked + * + * @return string|null + */ + public function getEnhancedSchemeDataRegularHoursWorked() + { + return $this->container['enhanced_scheme_data_regular_hours_worked']; + } + + /** + * Sets enhanced_scheme_data_regular_hours_worked + * + * @param string|null $enhanced_scheme_data_regular_hours_worked Amount of time worked during a normal operation for the task or job. * maxLength: 7 + * + * @return self + */ + public function setEnhancedSchemeDataRegularHoursWorked($enhanced_scheme_data_regular_hours_worked) + { + if (is_null($enhanced_scheme_data_regular_hours_worked)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_regular_hours_worked cannot be null'); + } + $this->container['enhanced_scheme_data_regular_hours_worked'] = $enhanced_scheme_data_regular_hours_worked; + + return $this; + } + + /** + * Gets enhanced_scheme_data_request_name + * + * @return string|null + */ + public function getEnhancedSchemeDataRequestName() + { + return $this->container['enhanced_scheme_data_request_name']; + } + + /** + * Sets enhanced_scheme_data_request_name + * + * @param string|null $enhanced_scheme_data_request_name Name of the individual requesting temporary services. * maxLength: 40 + * + * @return self + */ + public function setEnhancedSchemeDataRequestName($enhanced_scheme_data_request_name) + { + if (is_null($enhanced_scheme_data_request_name)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_request_name cannot be null'); + } + $this->container['enhanced_scheme_data_request_name'] = $enhanced_scheme_data_request_name; + + return $this; + } + + /** + * Gets enhanced_scheme_data_temp_start_date + * + * @return string|null + */ + public function getEnhancedSchemeDataTempStartDate() + { + return $this->container['enhanced_scheme_data_temp_start_date']; + } + + /** + * Sets enhanced_scheme_data_temp_start_date + * + * @param string|null $enhanced_scheme_data_temp_start_date Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 + * + * @return self + */ + public function setEnhancedSchemeDataTempStartDate($enhanced_scheme_data_temp_start_date) + { + if (is_null($enhanced_scheme_data_temp_start_date)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_temp_start_date cannot be null'); + } + $this->container['enhanced_scheme_data_temp_start_date'] = $enhanced_scheme_data_temp_start_date; + + return $this; + } + + /** + * Gets enhanced_scheme_data_temp_week_ending + * + * @return string|null + */ + public function getEnhancedSchemeDataTempWeekEnding() + { + return $this->container['enhanced_scheme_data_temp_week_ending']; + } + + /** + * Sets enhanced_scheme_data_temp_week_ending + * + * @param string|null $enhanced_scheme_data_temp_week_ending Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 + * + * @return self + */ + public function setEnhancedSchemeDataTempWeekEnding($enhanced_scheme_data_temp_week_ending) + { + if (is_null($enhanced_scheme_data_temp_week_ending)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_temp_week_ending cannot be null'); + } + $this->container['enhanced_scheme_data_temp_week_ending'] = $enhanced_scheme_data_temp_week_ending; + + return $this; + } + + /** + * Gets enhanced_scheme_data_total_tax_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataTotalTaxAmount() + { + return $this->container['enhanced_scheme_data_total_tax_amount']; + } + + /** + * Sets enhanced_scheme_data_total_tax_amount + * + * @param string|null $enhanced_scheme_data_total_tax_amount Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 + * + * @return self + */ + public function setEnhancedSchemeDataTotalTaxAmount($enhanced_scheme_data_total_tax_amount) + { + if (is_null($enhanced_scheme_data_total_tax_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_total_tax_amount cannot be null'); + } + $this->container['enhanced_scheme_data_total_tax_amount'] = $enhanced_scheme_data_total_tax_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AdditionalDataWallets.php b/src/Adyen/Model/Checkout/AdditionalDataWallets.php new file mode 100644 index 000000000..1920cf35c --- /dev/null +++ b/src/Adyen/Model/Checkout/AdditionalDataWallets.php @@ -0,0 +1,557 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AdditionalDataWallets Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AdditionalDataWallets implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataWallets'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'androidpay_token' => 'string', + 'masterpass_transaction_id' => 'string', + 'payment_token' => 'string', + 'paywithgoogle_token' => 'string', + 'samsungpay_token' => 'string', + 'visacheckout_call_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'androidpay_token' => null, + 'masterpass_transaction_id' => null, + 'payment_token' => null, + 'paywithgoogle_token' => null, + 'samsungpay_token' => null, + 'visacheckout_call_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'androidpay_token' => false, + 'masterpass_transaction_id' => false, + 'payment_token' => false, + 'paywithgoogle_token' => false, + 'samsungpay_token' => false, + 'visacheckout_call_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'androidpay_token' => 'androidpay.token', + 'masterpass_transaction_id' => 'masterpass.transactionId', + 'payment_token' => 'payment.token', + 'paywithgoogle_token' => 'paywithgoogle.token', + 'samsungpay_token' => 'samsungpay.token', + 'visacheckout_call_id' => 'visacheckout.callId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'androidpay_token' => 'setAndroidpayToken', + 'masterpass_transaction_id' => 'setMasterpassTransactionId', + 'payment_token' => 'setPaymentToken', + 'paywithgoogle_token' => 'setPaywithgoogleToken', + 'samsungpay_token' => 'setSamsungpayToken', + 'visacheckout_call_id' => 'setVisacheckoutCallId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'androidpay_token' => 'getAndroidpayToken', + 'masterpass_transaction_id' => 'getMasterpassTransactionId', + 'payment_token' => 'getPaymentToken', + 'paywithgoogle_token' => 'getPaywithgoogleToken', + 'samsungpay_token' => 'getSamsungpayToken', + 'visacheckout_call_id' => 'getVisacheckoutCallId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('androidpay_token', $data ?? [], null); + $this->setIfExists('masterpass_transaction_id', $data ?? [], null); + $this->setIfExists('payment_token', $data ?? [], null); + $this->setIfExists('paywithgoogle_token', $data ?? [], null); + $this->setIfExists('samsungpay_token', $data ?? [], null); + $this->setIfExists('visacheckout_call_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets androidpay_token + * + * @return string|null + */ + public function getAndroidpayToken() + { + return $this->container['androidpay_token']; + } + + /** + * Sets androidpay_token + * + * @param string|null $androidpay_token The Android Pay token retrieved from the SDK. + * + * @return self + */ + public function setAndroidpayToken($androidpay_token) + { + if (is_null($androidpay_token)) { + throw new \InvalidArgumentException('non-nullable androidpay_token cannot be null'); + } + $this->container['androidpay_token'] = $androidpay_token; + + return $this; + } + + /** + * Gets masterpass_transaction_id + * + * @return string|null + */ + public function getMasterpassTransactionId() + { + return $this->container['masterpass_transaction_id']; + } + + /** + * Sets masterpass_transaction_id + * + * @param string|null $masterpass_transaction_id The Mastercard Masterpass Transaction ID retrieved from the SDK. + * + * @return self + */ + public function setMasterpassTransactionId($masterpass_transaction_id) + { + if (is_null($masterpass_transaction_id)) { + throw new \InvalidArgumentException('non-nullable masterpass_transaction_id cannot be null'); + } + $this->container['masterpass_transaction_id'] = $masterpass_transaction_id; + + return $this; + } + + /** + * Gets payment_token + * + * @return string|null + */ + public function getPaymentToken() + { + return $this->container['payment_token']; + } + + /** + * Sets payment_token + * + * @param string|null $payment_token The Apple Pay token retrieved from the SDK. + * + * @return self + */ + public function setPaymentToken($payment_token) + { + if (is_null($payment_token)) { + throw new \InvalidArgumentException('non-nullable payment_token cannot be null'); + } + $this->container['payment_token'] = $payment_token; + + return $this; + } + + /** + * Gets paywithgoogle_token + * + * @return string|null + */ + public function getPaywithgoogleToken() + { + return $this->container['paywithgoogle_token']; + } + + /** + * Sets paywithgoogle_token + * + * @param string|null $paywithgoogle_token The Google Pay token retrieved from the SDK. + * + * @return self + */ + public function setPaywithgoogleToken($paywithgoogle_token) + { + if (is_null($paywithgoogle_token)) { + throw new \InvalidArgumentException('non-nullable paywithgoogle_token cannot be null'); + } + $this->container['paywithgoogle_token'] = $paywithgoogle_token; + + return $this; + } + + /** + * Gets samsungpay_token + * + * @return string|null + */ + public function getSamsungpayToken() + { + return $this->container['samsungpay_token']; + } + + /** + * Sets samsungpay_token + * + * @param string|null $samsungpay_token The Samsung Pay token retrieved from the SDK. + * + * @return self + */ + public function setSamsungpayToken($samsungpay_token) + { + if (is_null($samsungpay_token)) { + throw new \InvalidArgumentException('non-nullable samsungpay_token cannot be null'); + } + $this->container['samsungpay_token'] = $samsungpay_token; + + return $this; + } + + /** + * Gets visacheckout_call_id + * + * @return string|null + */ + public function getVisacheckoutCallId() + { + return $this->container['visacheckout_call_id']; + } + + /** + * Sets visacheckout_call_id + * + * @param string|null $visacheckout_call_id The Visa Checkout Call ID retrieved from the SDK. + * + * @return self + */ + public function setVisacheckoutCallId($visacheckout_call_id) + { + if (is_null($visacheckout_call_id)) { + throw new \InvalidArgumentException('non-nullable visacheckout_call_id cannot be null'); + } + $this->container['visacheckout_call_id'] = $visacheckout_call_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Address.php b/src/Adyen/Model/Checkout/Address.php new file mode 100644 index 000000000..19930d9ed --- /dev/null +++ b/src/Adyen/Model/Checkout/Address.php @@ -0,0 +1,572 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Address Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'house_number_or_name' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'house_number_or_name' => null, + 'postal_code' => null, + 'state_or_province' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'house_number_or_name' => 'houseNumberOrName', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'house_number_or_name' => 'setHouseNumberOrName', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'house_number_or_name' => 'getHouseNumberOrName', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('house_number_or_name', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ($this->container['house_number_or_name'] === null) { + $invalidProperties[] = "'house_number_or_name' can't be null"; + } + if ($this->container['postal_code'] === null) { + $invalidProperties[] = "'postal_code' can't be null"; + } + if ($this->container['street'] === null) { + $invalidProperties[] = "'street' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The name of the city. Maximum length: 3000 characters. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets house_number_or_name + * + * @return string + */ + public function getHouseNumberOrName() + { + return $this->container['house_number_or_name']; + } + + /** + * Sets house_number_or_name + * + * @param string $house_number_or_name The number or name of the house. Maximum length: 3000 characters. + * + * @return self + */ + public function setHouseNumberOrName($house_number_or_name) + { + if (is_null($house_number_or_name)) { + throw new \InvalidArgumentException('non-nullable house_number_or_name cannot be null'); + } + $this->container['house_number_or_name'] = $house_number_or_name; + + return $this; + } + + /** + * Gets postal_code + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string $postal_code A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AfterpayDetails.php b/src/Adyen/Model/Checkout/AfterpayDetails.php new file mode 100644 index 000000000..145436828 --- /dev/null +++ b/src/Adyen/Model/Checkout/AfterpayDetails.php @@ -0,0 +1,631 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AfterpayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AfterpayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AfterpayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address' => 'string', + 'checkout_attempt_id' => 'string', + 'delivery_address' => 'string', + 'personal_details' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address' => null, + 'checkout_attempt_id' => null, + 'delivery_address' => null, + 'personal_details' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address' => false, + 'checkout_attempt_id' => false, + 'delivery_address' => false, + 'personal_details' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'delivery_address' => 'deliveryAddress', + 'personal_details' => 'personalDetails', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'delivery_address' => 'setDeliveryAddress', + 'personal_details' => 'setPersonalDetails', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'delivery_address' => 'getDeliveryAddress', + 'personal_details' => 'getPersonalDetails', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_AFTERPAY_DEFAULT = 'afterpay_default'; + public const TYPE_AFTERPAYTOUCH = 'afterpaytouch'; + public const TYPE_AFTERPAY_B2B = 'afterpay_b2b'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AFTERPAY_DEFAULT, + self::TYPE_AFTERPAYTOUCH, + self::TYPE_AFTERPAY_B2B, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('personal_details', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'afterpay_default'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_address + * + * @return string|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param string|null $billing_address The address where to send the invoice. + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets delivery_address + * + * @return string|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param string|null $delivery_address The address where the goods should be delivered. + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets personal_details + * + * @return string|null + */ + public function getPersonalDetails() + { + return $this->container['personal_details']; + } + + /** + * Sets personal_details + * + * @param string|null $personal_details Shopper name, date of birth, phone number, and email address. + * + * @return self + */ + public function setPersonalDetails($personal_details) + { + if (is_null($personal_details)) { + throw new \InvalidArgumentException('non-nullable personal_details cannot be null'); + } + $this->container['personal_details'] = $personal_details; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **afterpay_default** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AmazonPayDetails.php b/src/Adyen/Model/Checkout/AmazonPayDetails.php new file mode 100644 index 000000000..bb7b44847 --- /dev/null +++ b/src/Adyen/Model/Checkout/AmazonPayDetails.php @@ -0,0 +1,486 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AmazonPayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AmazonPayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AmazonPayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amazon_pay_token' => 'string', + 'checkout_attempt_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amazon_pay_token' => null, + 'checkout_attempt_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amazon_pay_token' => false, + 'checkout_attempt_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amazon_pay_token' => 'amazonPayToken', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amazon_pay_token' => 'setAmazonPayToken', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amazon_pay_token' => 'getAmazonPayToken', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_AMAZONPAY = 'amazonpay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AMAZONPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amazon_pay_token', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'amazonpay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amazon_pay_token + * + * @return string|null + */ + public function getAmazonPayToken() + { + return $this->container['amazon_pay_token']; + } + + /** + * Sets amazon_pay_token + * + * @param string|null $amazon_pay_token This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. + * + * @return self + */ + public function setAmazonPayToken($amazon_pay_token) + { + if (is_null($amazon_pay_token)) { + throw new \InvalidArgumentException('non-nullable amazon_pay_token cannot be null'); + } + $this->container['amazon_pay_token'] = $amazon_pay_token; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **amazonpay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Amount.php b/src/Adyen/Model/Checkout/Amount.php new file mode 100644 index 000000000..9b79ae83d --- /dev/null +++ b/src/Adyen/Model/Checkout/Amount.php @@ -0,0 +1,427 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Amount Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AndroidPayDetails.php b/src/Adyen/Model/Checkout/AndroidPayDetails.php new file mode 100644 index 000000000..4d2d17176 --- /dev/null +++ b/src/Adyen/Model/Checkout/AndroidPayDetails.php @@ -0,0 +1,452 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AndroidPayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AndroidPayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AndroidPayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_ANDROIDPAY = 'androidpay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ANDROIDPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'androidpay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **androidpay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ApplePayDetails.php b/src/Adyen/Model/Checkout/ApplePayDetails.php new file mode 100644 index 000000000..1ee666746 --- /dev/null +++ b/src/Adyen/Model/Checkout/ApplePayDetails.php @@ -0,0 +1,624 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ApplePayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ApplePayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApplePayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'apple_pay_token' => 'string', + 'checkout_attempt_id' => 'string', + 'funding_source' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'apple_pay_token' => null, + 'checkout_attempt_id' => null, + 'funding_source' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'apple_pay_token' => false, + 'checkout_attempt_id' => false, + 'funding_source' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'apple_pay_token' => 'applePayToken', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'funding_source' => 'fundingSource', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'apple_pay_token' => 'setApplePayToken', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'funding_source' => 'setFundingSource', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'apple_pay_token' => 'getApplePayToken', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'funding_source' => 'getFundingSource', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_APPLEPAY = 'applepay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_APPLEPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('apple_pay_token', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'applepay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['apple_pay_token'] === null) { + $invalidProperties[] = "'apple_pay_token' can't be null"; + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets apple_pay_token + * + * @return string + */ + public function getApplePayToken() + { + return $this->container['apple_pay_token']; + } + + /** + * Sets apple_pay_token + * + * @param string $apple_pay_token The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. + * + * @return self + */ + public function setApplePayToken($apple_pay_token) + { + if (is_null($apple_pay_token)) { + throw new \InvalidArgumentException('non-nullable apple_pay_token cannot be null'); + } + $this->container['apple_pay_token'] = $apple_pay_token; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **applepay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ApplePaySessionResponse.php b/src/Adyen/Model/Checkout/ApplePaySessionResponse.php new file mode 100644 index 000000000..4f038deea --- /dev/null +++ b/src/Adyen/Model/Checkout/ApplePaySessionResponse.php @@ -0,0 +1,390 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ApplePaySessionResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ApplePaySessionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApplePaySessionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' 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 data + * + * @return string + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string $data Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ApplicationInfo.php b/src/Adyen/Model/Checkout/ApplicationInfo.php new file mode 100644 index 000000000..abafe9c2c --- /dev/null +++ b/src/Adyen/Model/Checkout/ApplicationInfo.php @@ -0,0 +1,557 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ApplicationInfo Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ApplicationInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApplicationInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'adyen_library' => '\Adyen\Model\Checkout\CommonField', + 'adyen_payment_source' => '\Adyen\Model\Checkout\CommonField', + 'external_platform' => '\Adyen\Model\Checkout\ExternalPlatform', + 'merchant_application' => '\Adyen\Model\Checkout\CommonField', + 'merchant_device' => '\Adyen\Model\Checkout\MerchantDevice', + 'shopper_interaction_device' => '\Adyen\Model\Checkout\ShopperInteractionDevice' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'adyen_library' => null, + 'adyen_payment_source' => null, + 'external_platform' => null, + 'merchant_application' => null, + 'merchant_device' => null, + 'shopper_interaction_device' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'adyen_library' => false, + 'adyen_payment_source' => false, + 'external_platform' => false, + 'merchant_application' => false, + 'merchant_device' => false, + 'shopper_interaction_device' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'adyen_library' => 'adyenLibrary', + 'adyen_payment_source' => 'adyenPaymentSource', + 'external_platform' => 'externalPlatform', + 'merchant_application' => 'merchantApplication', + 'merchant_device' => 'merchantDevice', + 'shopper_interaction_device' => 'shopperInteractionDevice' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'adyen_library' => 'setAdyenLibrary', + 'adyen_payment_source' => 'setAdyenPaymentSource', + 'external_platform' => 'setExternalPlatform', + 'merchant_application' => 'setMerchantApplication', + 'merchant_device' => 'setMerchantDevice', + 'shopper_interaction_device' => 'setShopperInteractionDevice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'adyen_library' => 'getAdyenLibrary', + 'adyen_payment_source' => 'getAdyenPaymentSource', + 'external_platform' => 'getExternalPlatform', + 'merchant_application' => 'getMerchantApplication', + 'merchant_device' => 'getMerchantDevice', + 'shopper_interaction_device' => 'getShopperInteractionDevice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('adyen_library', $data ?? [], null); + $this->setIfExists('adyen_payment_source', $data ?? [], null); + $this->setIfExists('external_platform', $data ?? [], null); + $this->setIfExists('merchant_application', $data ?? [], null); + $this->setIfExists('merchant_device', $data ?? [], null); + $this->setIfExists('shopper_interaction_device', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets adyen_library + * + * @return \Adyen\Model\Checkout\CommonField|null + */ + public function getAdyenLibrary() + { + return $this->container['adyen_library']; + } + + /** + * Sets adyen_library + * + * @param \Adyen\Model\Checkout\CommonField|null $adyen_library adyen_library + * + * @return self + */ + public function setAdyenLibrary($adyen_library) + { + if (is_null($adyen_library)) { + throw new \InvalidArgumentException('non-nullable adyen_library cannot be null'); + } + $this->container['adyen_library'] = $adyen_library; + + return $this; + } + + /** + * Gets adyen_payment_source + * + * @return \Adyen\Model\Checkout\CommonField|null + */ + public function getAdyenPaymentSource() + { + return $this->container['adyen_payment_source']; + } + + /** + * Sets adyen_payment_source + * + * @param \Adyen\Model\Checkout\CommonField|null $adyen_payment_source adyen_payment_source + * + * @return self + */ + public function setAdyenPaymentSource($adyen_payment_source) + { + if (is_null($adyen_payment_source)) { + throw new \InvalidArgumentException('non-nullable adyen_payment_source cannot be null'); + } + $this->container['adyen_payment_source'] = $adyen_payment_source; + + return $this; + } + + /** + * Gets external_platform + * + * @return \Adyen\Model\Checkout\ExternalPlatform|null + */ + public function getExternalPlatform() + { + return $this->container['external_platform']; + } + + /** + * Sets external_platform + * + * @param \Adyen\Model\Checkout\ExternalPlatform|null $external_platform external_platform + * + * @return self + */ + public function setExternalPlatform($external_platform) + { + if (is_null($external_platform)) { + throw new \InvalidArgumentException('non-nullable external_platform cannot be null'); + } + $this->container['external_platform'] = $external_platform; + + return $this; + } + + /** + * Gets merchant_application + * + * @return \Adyen\Model\Checkout\CommonField|null + */ + public function getMerchantApplication() + { + return $this->container['merchant_application']; + } + + /** + * Sets merchant_application + * + * @param \Adyen\Model\Checkout\CommonField|null $merchant_application merchant_application + * + * @return self + */ + public function setMerchantApplication($merchant_application) + { + if (is_null($merchant_application)) { + throw new \InvalidArgumentException('non-nullable merchant_application cannot be null'); + } + $this->container['merchant_application'] = $merchant_application; + + return $this; + } + + /** + * Gets merchant_device + * + * @return \Adyen\Model\Checkout\MerchantDevice|null + */ + public function getMerchantDevice() + { + return $this->container['merchant_device']; + } + + /** + * Sets merchant_device + * + * @param \Adyen\Model\Checkout\MerchantDevice|null $merchant_device merchant_device + * + * @return self + */ + public function setMerchantDevice($merchant_device) + { + if (is_null($merchant_device)) { + throw new \InvalidArgumentException('non-nullable merchant_device cannot be null'); + } + $this->container['merchant_device'] = $merchant_device; + + return $this; + } + + /** + * Gets shopper_interaction_device + * + * @return \Adyen\Model\Checkout\ShopperInteractionDevice|null + */ + public function getShopperInteractionDevice() + { + return $this->container['shopper_interaction_device']; + } + + /** + * Sets shopper_interaction_device + * + * @param \Adyen\Model\Checkout\ShopperInteractionDevice|null $shopper_interaction_device shopper_interaction_device + * + * @return self + */ + public function setShopperInteractionDevice($shopper_interaction_device) + { + if (is_null($shopper_interaction_device)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction_device cannot be null'); + } + $this->container['shopper_interaction_device'] = $shopper_interaction_device; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/AuthenticationData.php b/src/Adyen/Model/Checkout/AuthenticationData.php new file mode 100644 index 000000000..2a907b0e9 --- /dev/null +++ b/src/Adyen/Model/Checkout/AuthenticationData.php @@ -0,0 +1,488 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * AuthenticationData Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class AuthenticationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'attempt_authentication' => 'string', + 'authentication_only' => 'bool', + 'three_ds_request_data' => '\Adyen\Model\Checkout\ThreeDSRequestData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'attempt_authentication' => null, + 'authentication_only' => null, + 'three_ds_request_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'attempt_authentication' => false, + 'authentication_only' => false, + 'three_ds_request_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attempt_authentication' => 'attemptAuthentication', + 'authentication_only' => 'authenticationOnly', + 'three_ds_request_data' => 'threeDSRequestData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attempt_authentication' => 'setAttemptAuthentication', + 'authentication_only' => 'setAuthenticationOnly', + 'three_ds_request_data' => 'setThreeDsRequestData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attempt_authentication' => 'getAttemptAuthentication', + 'authentication_only' => 'getAuthenticationOnly', + 'three_ds_request_data' => 'getThreeDsRequestData' + ]; + + /** + * 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 ATTEMPT_AUTHENTICATION_ALWAYS = 'always'; + public const ATTEMPT_AUTHENTICATION_NEVER = 'never'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAttemptAuthenticationAllowableValues() + { + return [ + self::ATTEMPT_AUTHENTICATION_ALWAYS, + self::ATTEMPT_AUTHENTICATION_NEVER, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('attempt_authentication', $data ?? [], null); + $this->setIfExists('authentication_only', $data ?? [], false); + $this->setIfExists('three_ds_request_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAttemptAuthenticationAllowableValues(); + if (!is_null($this->container['attempt_authentication']) && !in_array($this->container['attempt_authentication'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'attempt_authentication', must be one of '%s'", + $this->container['attempt_authentication'], + 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 attempt_authentication + * + * @return string|null + */ + public function getAttemptAuthentication() + { + return $this->container['attempt_authentication']; + } + + /** + * Sets attempt_authentication + * + * @param string|null $attempt_authentication Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. * **preferNo**: Do not perform 3D Secure authentication if not required by PSD2 SCA or other national regulations. + * + * @return self + */ + public function setAttemptAuthentication($attempt_authentication) + { + if (is_null($attempt_authentication)) { + throw new \InvalidArgumentException('non-nullable attempt_authentication cannot be null'); + } + $allowedValues = $this->getAttemptAuthenticationAllowableValues(); + if (!in_array($attempt_authentication, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'attempt_authentication', must be one of '%s'", + $attempt_authentication, + implode("', '", $allowedValues) + ) + ); + } + $this->container['attempt_authentication'] = $attempt_authentication; + + return $this; + } + + /** + * Gets authentication_only + * + * @return bool|null + */ + public function getAuthenticationOnly() + { + return $this->container['authentication_only']; + } + + /** + * Sets authentication_only + * + * @param bool|null $authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. + * + * @return self + */ + public function setAuthenticationOnly($authentication_only) + { + if (is_null($authentication_only)) { + throw new \InvalidArgumentException('non-nullable authentication_only cannot be null'); + } + $this->container['authentication_only'] = $authentication_only; + + return $this; + } + + /** + * Gets three_ds_request_data + * + * @return \Adyen\Model\Checkout\ThreeDSRequestData|null + */ + public function getThreeDsRequestData() + { + return $this->container['three_ds_request_data']; + } + + /** + * Sets three_ds_request_data + * + * @param \Adyen\Model\Checkout\ThreeDSRequestData|null $three_ds_request_data three_ds_request_data + * + * @return self + */ + public function setThreeDsRequestData($three_ds_request_data) + { + if (is_null($three_ds_request_data)) { + throw new \InvalidArgumentException('non-nullable three_ds_request_data cannot be null'); + } + $this->container['three_ds_request_data'] = $three_ds_request_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Avs.php b/src/Adyen/Model/Checkout/Avs.php new file mode 100644 index 000000000..5a2b9fd4f --- /dev/null +++ b/src/Adyen/Model/Checkout/Avs.php @@ -0,0 +1,456 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Avs Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Avs implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Avs'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address_editable' => 'bool', + 'enabled' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address_editable' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address_editable' => false, + 'enabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address_editable' => 'addressEditable', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address_editable' => 'setAddressEditable', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address_editable' => 'getAddressEditable', + 'enabled' => 'getEnabled' + ]; + + /** + * 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 ENABLED_YES = 'yes'; + public const ENABLED_NO = 'no'; + public const ENABLED_AUTOMATIC = 'automatic'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEnabledAllowableValues() + { + return [ + self::ENABLED_YES, + self::ENABLED_NO, + self::ENABLED_AUTOMATIC, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address_editable', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getEnabledAllowableValues(); + if (!is_null($this->container['enabled']) && !in_array($this->container['enabled'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'enabled', must be one of '%s'", + $this->container['enabled'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address_editable + * + * @return bool|null + */ + public function getAddressEditable() + { + return $this->container['address_editable']; + } + + /** + * Sets address_editable + * + * @param bool|null $address_editable Indicates whether the shopper is allowed to modify the billing address for the current payment request. + * + * @return self + */ + public function setAddressEditable($address_editable) + { + if (is_null($address_editable)) { + throw new \InvalidArgumentException('non-nullable address_editable cannot be null'); + } + $this->container['address_editable'] = $address_editable; + + return $this; + } + + /** + * Gets enabled + * + * @return string|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param string|null $enabled Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $allowedValues = $this->getEnabledAllowableValues(); + if (!in_array($enabled, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'enabled', must be one of '%s'", + $enabled, + implode("', '", $allowedValues) + ) + ); + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php b/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php new file mode 100644 index 000000000..c8292bf93 --- /dev/null +++ b/src/Adyen/Model/Checkout/BacsDirectDebitDetails.php @@ -0,0 +1,624 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * BacsDirectDebitDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class BacsDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BacsDirectDebitDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank_account_number' => 'string', + 'bank_location_id' => 'string', + 'checkout_attempt_id' => 'string', + 'holder_name' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank_account_number' => null, + 'bank_location_id' => null, + 'checkout_attempt_id' => null, + 'holder_name' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank_account_number' => false, + 'bank_location_id' => false, + 'checkout_attempt_id' => false, + 'holder_name' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bank_account_number' => 'bankAccountNumber', + 'bank_location_id' => 'bankLocationId', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'holder_name' => 'holderName', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank_account_number' => 'setBankAccountNumber', + 'bank_location_id' => 'setBankLocationId', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'holder_name' => 'setHolderName', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank_account_number' => 'getBankAccountNumber', + 'bank_location_id' => 'getBankLocationId', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'holder_name' => 'getHolderName', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DIRECTDEBIT_GB = 'directdebit_GB'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DIRECTDEBIT_GB, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bank_account_number', $data ?? [], null); + $this->setIfExists('bank_location_id', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('holder_name', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'directdebit_GB'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank_account_number + * + * @return string|null + */ + public function getBankAccountNumber() + { + return $this->container['bank_account_number']; + } + + /** + * Sets bank_account_number + * + * @param string|null $bank_account_number The bank account number (without separators). + * + * @return self + */ + public function setBankAccountNumber($bank_account_number) + { + if (is_null($bank_account_number)) { + throw new \InvalidArgumentException('non-nullable bank_account_number cannot be null'); + } + $this->container['bank_account_number'] = $bank_account_number; + + return $this; + } + + /** + * Gets bank_location_id + * + * @return string|null + */ + public function getBankLocationId() + { + return $this->container['bank_location_id']; + } + + /** + * Sets bank_location_id + * + * @param string|null $bank_location_id The bank routing number of the account. + * + * @return self + */ + public function setBankLocationId($bank_location_id) + { + if (is_null($bank_location_id)) { + throw new \InvalidArgumentException('non-nullable bank_location_id cannot be null'); + } + $this->container['bank_location_id'] = $bank_location_id; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets holder_name + * + * @return string|null + */ + public function getHolderName() + { + return $this->container['holder_name']; + } + + /** + * Sets holder_name + * + * @param string|null $holder_name The name of the bank account holder. + * + * @return self + */ + public function setHolderName($holder_name) + { + if (is_null($holder_name)) { + throw new \InvalidArgumentException('non-nullable holder_name cannot be null'); + } + $this->container['holder_name'] = $holder_name; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **directdebit_GB** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/BankAccount.php b/src/Adyen/Model/Checkout/BankAccount.php new file mode 100644 index 000000000..413be5a97 --- /dev/null +++ b/src/Adyen/Model/Checkout/BankAccount.php @@ -0,0 +1,659 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * BankAccount Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank_account_number' => 'string', + 'bank_city' => 'string', + 'bank_location_id' => 'string', + 'bank_name' => 'string', + 'bic' => 'string', + 'country_code' => 'string', + 'iban' => 'string', + 'owner_name' => 'string', + 'tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank_account_number' => null, + 'bank_city' => null, + 'bank_location_id' => null, + 'bank_name' => null, + 'bic' => null, + 'country_code' => null, + 'iban' => null, + 'owner_name' => null, + 'tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank_account_number' => false, + 'bank_city' => false, + 'bank_location_id' => false, + 'bank_name' => false, + 'bic' => false, + 'country_code' => false, + 'iban' => false, + 'owner_name' => false, + 'tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bank_account_number' => 'bankAccountNumber', + 'bank_city' => 'bankCity', + 'bank_location_id' => 'bankLocationId', + 'bank_name' => 'bankName', + 'bic' => 'bic', + 'country_code' => 'countryCode', + 'iban' => 'iban', + 'owner_name' => 'ownerName', + 'tax_id' => 'taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank_account_number' => 'setBankAccountNumber', + 'bank_city' => 'setBankCity', + 'bank_location_id' => 'setBankLocationId', + 'bank_name' => 'setBankName', + 'bic' => 'setBic', + 'country_code' => 'setCountryCode', + 'iban' => 'setIban', + 'owner_name' => 'setOwnerName', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank_account_number' => 'getBankAccountNumber', + 'bank_city' => 'getBankCity', + 'bank_location_id' => 'getBankLocationId', + 'bank_name' => 'getBankName', + 'bic' => 'getBic', + 'country_code' => 'getCountryCode', + 'iban' => 'getIban', + 'owner_name' => 'getOwnerName', + '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->setIfExists('bank_account_number', $data ?? [], null); + $this->setIfExists('bank_city', $data ?? [], null); + $this->setIfExists('bank_location_id', $data ?? [], null); + $this->setIfExists('bank_name', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank_account_number + * + * @return string|null + */ + public function getBankAccountNumber() + { + return $this->container['bank_account_number']; + } + + /** + * Sets bank_account_number + * + * @param string|null $bank_account_number The bank account number (without separators). + * + * @return self + */ + public function setBankAccountNumber($bank_account_number) + { + if (is_null($bank_account_number)) { + throw new \InvalidArgumentException('non-nullable bank_account_number cannot be null'); + } + $this->container['bank_account_number'] = $bank_account_number; + + return $this; + } + + /** + * Gets bank_city + * + * @return string|null + */ + public function getBankCity() + { + return $this->container['bank_city']; + } + + /** + * Sets bank_city + * + * @param string|null $bank_city The bank city. + * + * @return self + */ + public function setBankCity($bank_city) + { + if (is_null($bank_city)) { + throw new \InvalidArgumentException('non-nullable bank_city cannot be null'); + } + $this->container['bank_city'] = $bank_city; + + return $this; + } + + /** + * Gets bank_location_id + * + * @return string|null + */ + public function getBankLocationId() + { + return $this->container['bank_location_id']; + } + + /** + * Sets bank_location_id + * + * @param string|null $bank_location_id The location id of the bank. The field value is `nil` in most cases. + * + * @return self + */ + public function setBankLocationId($bank_location_id) + { + if (is_null($bank_location_id)) { + throw new \InvalidArgumentException('non-nullable bank_location_id cannot be null'); + } + $this->container['bank_location_id'] = $bank_location_id; + + return $this; + } + + /** + * Gets bank_name + * + * @return string|null + */ + public function getBankName() + { + return $this->container['bank_name']; + } + + /** + * Sets bank_name + * + * @param string|null $bank_name The name of the bank. + * + * @return self + */ + public function setBankName($bank_name) + { + if (is_null($bank_name)) { + throw new \InvalidArgumentException('non-nullable bank_name cannot be null'); + } + $this->container['bank_name'] = $bank_name; + + return $this; + } + + /** + * Gets bic + * + * @return string|null + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string|null $bic The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets tax_id + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param string|null $tax_id The bank account holder's tax ID. + * + * @return self + */ + public function setTaxId($tax_id) + { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } + $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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/BillDeskDetails.php b/src/Adyen/Model/Checkout/BillDeskDetails.php new file mode 100644 index 000000000..e6143c510 --- /dev/null +++ b/src/Adyen/Model/Checkout/BillDeskDetails.php @@ -0,0 +1,498 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * BillDeskDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class BillDeskDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillDeskDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'issuer' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'issuer' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'issuer' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BILLDESK_ONLINE = 'billdesk_online'; + public const TYPE_BILLDESK_WALLET = 'billdesk_wallet'; + public const TYPE_ONLINEBANKING_IN = 'onlinebanking_IN'; + public const TYPE_WALLET_IN = 'wallet_IN'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BILLDESK_ONLINE, + self::TYPE_BILLDESK_WALLET, + self::TYPE_ONLINEBANKING_IN, + self::TYPE_WALLET_IN, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The issuer id of the shopper's selected bank. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **billdesk** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/BlikDetails.php b/src/Adyen/Model/Checkout/BlikDetails.php new file mode 100644 index 000000000..3d011e369 --- /dev/null +++ b/src/Adyen/Model/Checkout/BlikDetails.php @@ -0,0 +1,556 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * BlikDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class BlikDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BlikDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'blik_code' => 'string', + 'checkout_attempt_id' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'blik_code' => null, + 'checkout_attempt_id' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'blik_code' => false, + 'checkout_attempt_id' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'blik_code' => 'blikCode', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'blik_code' => 'setBlikCode', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'blik_code' => 'getBlikCode', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BLIK = 'blik'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BLIK, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('blik_code', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets blik_code + * + * @return string|null + */ + public function getBlikCode() + { + return $this->container['blik_code']; + } + + /** + * Sets blik_code + * + * @param string|null $blik_code BLIK code consisting of 6 digits. + * + * @return self + */ + public function setBlikCode($blik_code) + { + if (is_null($blik_code)) { + throw new \InvalidArgumentException('non-nullable blik_code cannot be null'); + } + $this->container['blik_code'] = $blik_code; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **blik** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/BrowserInfo.php b/src/Adyen/Model/Checkout/BrowserInfo.php new file mode 100644 index 000000000..17e780cc0 --- /dev/null +++ b/src/Adyen/Model/Checkout/BrowserInfo.php @@ -0,0 +1,675 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * BrowserInfo Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class BrowserInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BrowserInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accept_header' => 'string', + 'color_depth' => 'int', + 'java_enabled' => 'bool', + 'java_script_enabled' => 'bool', + 'language' => 'string', + 'screen_height' => 'int', + 'screen_width' => 'int', + 'time_zone_offset' => 'int', + 'user_agent' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accept_header' => null, + 'color_depth' => 'int32', + 'java_enabled' => null, + 'java_script_enabled' => null, + 'language' => null, + 'screen_height' => 'int32', + 'screen_width' => 'int32', + 'time_zone_offset' => 'int32', + 'user_agent' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accept_header' => false, + 'color_depth' => true, + 'java_enabled' => false, + 'java_script_enabled' => false, + 'language' => false, + 'screen_height' => true, + 'screen_width' => true, + 'time_zone_offset' => true, + 'user_agent' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accept_header' => 'acceptHeader', + 'color_depth' => 'colorDepth', + 'java_enabled' => 'javaEnabled', + 'java_script_enabled' => 'javaScriptEnabled', + 'language' => 'language', + 'screen_height' => 'screenHeight', + 'screen_width' => 'screenWidth', + 'time_zone_offset' => 'timeZoneOffset', + 'user_agent' => 'userAgent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accept_header' => 'setAcceptHeader', + 'color_depth' => 'setColorDepth', + 'java_enabled' => 'setJavaEnabled', + 'java_script_enabled' => 'setJavaScriptEnabled', + 'language' => 'setLanguage', + 'screen_height' => 'setScreenHeight', + 'screen_width' => 'setScreenWidth', + 'time_zone_offset' => 'setTimeZoneOffset', + 'user_agent' => 'setUserAgent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accept_header' => 'getAcceptHeader', + 'color_depth' => 'getColorDepth', + 'java_enabled' => 'getJavaEnabled', + 'java_script_enabled' => 'getJavaScriptEnabled', + 'language' => 'getLanguage', + 'screen_height' => 'getScreenHeight', + 'screen_width' => 'getScreenWidth', + 'time_zone_offset' => 'getTimeZoneOffset', + 'user_agent' => 'getUserAgent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accept_header', $data ?? [], null); + $this->setIfExists('color_depth', $data ?? [], null); + $this->setIfExists('java_enabled', $data ?? [], null); + $this->setIfExists('java_script_enabled', $data ?? [], true); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('screen_height', $data ?? [], null); + $this->setIfExists('screen_width', $data ?? [], null); + $this->setIfExists('time_zone_offset', $data ?? [], null); + $this->setIfExists('user_agent', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accept_header'] === null) { + $invalidProperties[] = "'accept_header' can't be null"; + } + if ($this->container['color_depth'] === null) { + $invalidProperties[] = "'color_depth' can't be null"; + } + if ($this->container['java_enabled'] === null) { + $invalidProperties[] = "'java_enabled' can't be null"; + } + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' 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_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 accept_header + * + * @return string + */ + public function getAcceptHeader() + { + return $this->container['accept_header']; + } + + /** + * Sets accept_header + * + * @param string $accept_header The accept header value of the shopper's browser. + * + * @return self + */ + public function setAcceptHeader($accept_header) + { + if (is_null($accept_header)) { + throw new \InvalidArgumentException('non-nullable accept_header cannot be null'); + } + $this->container['accept_header'] = $accept_header; + + return $this; + } + + /** + * Gets color_depth + * + * @return int + */ + public function getColorDepth() + { + return $this->container['color_depth']; + } + + /** + * Sets color_depth + * + * @param int $color_depth The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. + * + * @return self + */ + public function setColorDepth($color_depth) + { + // Do nothing for nullable integers + $this->container['color_depth'] = $color_depth; + + return $this; + } + + /** + * Gets java_enabled + * + * @return bool + */ + public function getJavaEnabled() + { + return $this->container['java_enabled']; + } + + /** + * Sets java_enabled + * + * @param bool $java_enabled Boolean value indicating if the shopper's browser is able to execute Java. + * + * @return self + */ + public function setJavaEnabled($java_enabled) + { + if (is_null($java_enabled)) { + throw new \InvalidArgumentException('non-nullable java_enabled cannot be null'); + } + $this->container['java_enabled'] = $java_enabled; + + return $this; + } + + /** + * Gets java_script_enabled + * + * @return bool|null + */ + public function getJavaScriptEnabled() + { + return $this->container['java_script_enabled']; + } + + /** + * Sets java_script_enabled + * + * @param bool|null $java_script_enabled Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + * + * @return self + */ + public function setJavaScriptEnabled($java_script_enabled) + { + if (is_null($java_script_enabled)) { + throw new \InvalidArgumentException('non-nullable java_script_enabled cannot be null'); + } + $this->container['java_script_enabled'] = $java_script_enabled; + + return $this; + } + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets screen_height + * + * @return int + */ + public function getScreenHeight() + { + return $this->container['screen_height']; + } + + /** + * Sets screen_height + * + * @param int $screen_height The total height of the shopper's device screen in pixels. + * + * @return self + */ + public function setScreenHeight($screen_height) + { + // Do nothing for nullable integers + $this->container['screen_height'] = $screen_height; + + return $this; + } + + /** + * Gets screen_width + * + * @return int + */ + public function getScreenWidth() + { + return $this->container['screen_width']; + } + + /** + * Sets screen_width + * + * @param int $screen_width The total width of the shopper's device screen in pixels. + * + * @return self + */ + public function setScreenWidth($screen_width) + { + // Do nothing for nullable integers + $this->container['screen_width'] = $screen_width; + + return $this; + } + + /** + * Gets time_zone_offset + * + * @return int + */ + public function getTimeZoneOffset() + { + return $this->container['time_zone_offset']; + } + + /** + * Sets time_zone_offset + * + * @param int $time_zone_offset Time difference between UTC time and the shopper's browser local time, in minutes. + * + * @return self + */ + public function setTimeZoneOffset($time_zone_offset) + { + // Do nothing for nullable integers + $this->container['time_zone_offset'] = $time_zone_offset; + + 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 value of the shopper's browser. + * + * @return self + */ + public function setUserAgent($user_agent) + { + if (is_null($user_agent)) { + throw new \InvalidArgumentException('non-nullable user_agent cannot be null'); + } + $this->container['user_agent'] = $user_agent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Card.php b/src/Adyen/Model/Checkout/Card.php new file mode 100644 index 000000000..cc22133a9 --- /dev/null +++ b/src/Adyen/Model/Checkout/Card.php @@ -0,0 +1,631 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Card Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Card implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Card'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cvc' => 'string', + 'expiry_month' => 'string', + 'expiry_year' => 'string', + 'holder_name' => 'string', + 'issue_number' => 'string', + 'number' => 'string', + 'start_month' => 'string', + 'start_year' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cvc' => null, + 'expiry_month' => null, + 'expiry_year' => null, + 'holder_name' => null, + 'issue_number' => null, + 'number' => null, + 'start_month' => null, + 'start_year' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cvc' => false, + 'expiry_month' => false, + 'expiry_year' => false, + 'holder_name' => false, + 'issue_number' => false, + 'number' => false, + 'start_month' => false, + 'start_year' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cvc' => 'cvc', + 'expiry_month' => 'expiryMonth', + 'expiry_year' => 'expiryYear', + 'holder_name' => 'holderName', + 'issue_number' => 'issueNumber', + 'number' => 'number', + 'start_month' => 'startMonth', + 'start_year' => 'startYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cvc' => 'setCvc', + 'expiry_month' => 'setExpiryMonth', + 'expiry_year' => 'setExpiryYear', + 'holder_name' => 'setHolderName', + 'issue_number' => 'setIssueNumber', + 'number' => 'setNumber', + 'start_month' => 'setStartMonth', + 'start_year' => 'setStartYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cvc' => 'getCvc', + 'expiry_month' => 'getExpiryMonth', + 'expiry_year' => 'getExpiryYear', + 'holder_name' => 'getHolderName', + 'issue_number' => 'getIssueNumber', + 'number' => 'getNumber', + 'start_month' => 'getStartMonth', + 'start_year' => 'getStartYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('expiry_month', $data ?? [], null); + $this->setIfExists('expiry_year', $data ?? [], null); + $this->setIfExists('holder_name', $data ?? [], null); + $this->setIfExists('issue_number', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('start_month', $data ?? [], null); + $this->setIfExists('start_year', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['expiry_year'] === null) { + $invalidProperties[] = "'expiry_year' can't be null"; + } + if ($this->container['holder_name'] === null) { + $invalidProperties[] = "'holder_name' 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 cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The [card verification code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets expiry_month + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiry_month']; + } + + /** + * Sets expiry_month + * + * @param string|null $expiry_month The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November + * + * @return self + */ + public function setExpiryMonth($expiry_month) + { + if (is_null($expiry_month)) { + throw new \InvalidArgumentException('non-nullable expiry_month cannot be null'); + } + $this->container['expiry_month'] = $expiry_month; + + return $this; + } + + /** + * Gets expiry_year + * + * @return string + */ + public function getExpiryYear() + { + return $this->container['expiry_year']; + } + + /** + * Sets expiry_year + * + * @param string $expiry_year The card expiry year. Format: 4 digits. For example: 2020 + * + * @return self + */ + public function setExpiryYear($expiry_year) + { + if (is_null($expiry_year)) { + throw new \InvalidArgumentException('non-nullable expiry_year cannot be null'); + } + $this->container['expiry_year'] = $expiry_year; + + return $this; + } + + /** + * Gets holder_name + * + * @return string + */ + public function getHolderName() + { + return $this->container['holder_name']; + } + + /** + * Sets holder_name + * + * @param string $holder_name The name of the cardholder, as printed on the card. + * + * @return self + */ + public function setHolderName($holder_name) + { + if (is_null($holder_name)) { + throw new \InvalidArgumentException('non-nullable holder_name cannot be null'); + } + $this->container['holder_name'] = $holder_name; + + return $this; + } + + /** + * Gets issue_number + * + * @return string|null + */ + public function getIssueNumber() + { + return $this->container['issue_number']; + } + + /** + * Sets issue_number + * + * @param string|null $issue_number The issue number of the card (for some UK debit cards only). + * + * @return self + */ + public function setIssueNumber($issue_number) + { + if (is_null($issue_number)) { + throw new \InvalidArgumentException('non-nullable issue_number cannot be null'); + } + $this->container['issue_number'] = $issue_number; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets start_month + * + * @return string|null + */ + public function getStartMonth() + { + return $this->container['start_month']; + } + + /** + * Sets start_month + * + * @param string|null $start_month The month component of the start date (for some UK debit cards only). + * + * @return self + */ + public function setStartMonth($start_month) + { + if (is_null($start_month)) { + throw new \InvalidArgumentException('non-nullable start_month cannot be null'); + } + $this->container['start_month'] = $start_month; + + return $this; + } + + /** + * Gets start_year + * + * @return string|null + */ + public function getStartYear() + { + return $this->container['start_year']; + } + + /** + * Sets start_year + * + * @param string|null $start_year The year component of the start date (for some UK debit cards only). + * + * @return self + */ + public function setStartYear($start_year) + { + if (is_null($start_year)) { + throw new \InvalidArgumentException('non-nullable start_year cannot be null'); + } + $this->container['start_year'] = $start_year; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CardBrandDetails.php b/src/Adyen/Model/Checkout/CardBrandDetails.php new file mode 100644 index 000000000..31600ccd4 --- /dev/null +++ b/src/Adyen/Model/Checkout/CardBrandDetails.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CardBrandDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CardBrandDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardBrandDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'supported' => 'bool', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'supported' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'supported' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'supported' => 'supported', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'supported' => 'setSupported', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'supported' => 'getSupported', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('supported', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets supported + * + * @return bool|null + */ + public function getSupported() + { + return $this->container['supported']; + } + + /** + * Sets supported + * + * @param bool|null $supported Indicates if you support the card brand. + * + * @return self + */ + public function setSupported($supported) + { + if (is_null($supported)) { + throw new \InvalidArgumentException('non-nullable supported cannot be null'); + } + $this->container['supported'] = $supported; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The name of the card brand. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CardDetails.php b/src/Adyen/Model/Checkout/CardDetails.php new file mode 100644 index 000000000..b020309bc --- /dev/null +++ b/src/Adyen/Model/Checkout/CardDetails.php @@ -0,0 +1,1073 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CardDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CardDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brand' => 'string', + 'checkout_attempt_id' => 'string', + 'cupsecureplus_smscode' => 'string', + 'cvc' => 'string', + 'encrypted_card_number' => 'string', + 'encrypted_expiry_month' => 'string', + 'encrypted_expiry_year' => 'string', + 'encrypted_security_code' => 'string', + 'expiry_month' => 'string', + 'expiry_year' => 'string', + 'funding_source' => 'string', + 'holder_name' => 'string', + 'network_payment_reference' => 'string', + 'number' => 'string', + 'recurring_detail_reference' => 'string', + 'shopper_notification_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'three_ds2_sdk_version' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brand' => null, + 'checkout_attempt_id' => null, + 'cupsecureplus_smscode' => null, + 'cvc' => null, + 'encrypted_card_number' => null, + 'encrypted_expiry_month' => null, + 'encrypted_expiry_year' => null, + 'encrypted_security_code' => null, + 'expiry_month' => null, + 'expiry_year' => null, + 'funding_source' => null, + 'holder_name' => null, + 'network_payment_reference' => null, + 'number' => null, + 'recurring_detail_reference' => null, + 'shopper_notification_reference' => null, + 'stored_payment_method_id' => null, + 'three_ds2_sdk_version' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brand' => false, + 'checkout_attempt_id' => false, + 'cupsecureplus_smscode' => false, + 'cvc' => false, + 'encrypted_card_number' => false, + 'encrypted_expiry_month' => false, + 'encrypted_expiry_year' => false, + 'encrypted_security_code' => false, + 'expiry_month' => false, + 'expiry_year' => false, + 'funding_source' => false, + 'holder_name' => false, + 'network_payment_reference' => false, + 'number' => false, + 'recurring_detail_reference' => false, + 'shopper_notification_reference' => false, + 'stored_payment_method_id' => false, + 'three_ds2_sdk_version' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brand' => 'brand', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'cupsecureplus_smscode' => 'cupsecureplus.smscode', + 'cvc' => 'cvc', + 'encrypted_card_number' => 'encryptedCardNumber', + 'encrypted_expiry_month' => 'encryptedExpiryMonth', + 'encrypted_expiry_year' => 'encryptedExpiryYear', + 'encrypted_security_code' => 'encryptedSecurityCode', + 'expiry_month' => 'expiryMonth', + 'expiry_year' => 'expiryYear', + 'funding_source' => 'fundingSource', + 'holder_name' => 'holderName', + 'network_payment_reference' => 'networkPaymentReference', + 'number' => 'number', + 'recurring_detail_reference' => 'recurringDetailReference', + 'shopper_notification_reference' => 'shopperNotificationReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'three_ds2_sdk_version' => 'threeDS2SdkVersion', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brand' => 'setBrand', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'cupsecureplus_smscode' => 'setCupsecureplusSmscode', + 'cvc' => 'setCvc', + 'encrypted_card_number' => 'setEncryptedCardNumber', + 'encrypted_expiry_month' => 'setEncryptedExpiryMonth', + 'encrypted_expiry_year' => 'setEncryptedExpiryYear', + 'encrypted_security_code' => 'setEncryptedSecurityCode', + 'expiry_month' => 'setExpiryMonth', + 'expiry_year' => 'setExpiryYear', + 'funding_source' => 'setFundingSource', + 'holder_name' => 'setHolderName', + 'network_payment_reference' => 'setNetworkPaymentReference', + 'number' => 'setNumber', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'shopper_notification_reference' => 'setShopperNotificationReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'three_ds2_sdk_version' => 'setThreeDs2SdkVersion', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brand' => 'getBrand', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'cupsecureplus_smscode' => 'getCupsecureplusSmscode', + 'cvc' => 'getCvc', + 'encrypted_card_number' => 'getEncryptedCardNumber', + 'encrypted_expiry_month' => 'getEncryptedExpiryMonth', + 'encrypted_expiry_year' => 'getEncryptedExpiryYear', + 'encrypted_security_code' => 'getEncryptedSecurityCode', + 'expiry_month' => 'getExpiryMonth', + 'expiry_year' => 'getExpiryYear', + 'funding_source' => 'getFundingSource', + 'holder_name' => 'getHolderName', + 'network_payment_reference' => 'getNetworkPaymentReference', + 'number' => 'getNumber', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'shopper_notification_reference' => 'getShopperNotificationReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'three_ds2_sdk_version' => 'getThreeDs2SdkVersion', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_SCHEME = 'scheme'; + public const TYPE_NETWORK_TOKEN = 'networkToken'; + public const TYPE_GIFTCARD = 'giftcard'; + public const TYPE_ALLIANCEDATA = 'alliancedata'; + public const TYPE_CARD = 'card'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SCHEME, + self::TYPE_NETWORK_TOKEN, + self::TYPE_GIFTCARD, + self::TYPE_ALLIANCEDATA, + self::TYPE_CARD, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('cupsecureplus_smscode', $data ?? [], null); + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('encrypted_card_number', $data ?? [], null); + $this->setIfExists('encrypted_expiry_month', $data ?? [], null); + $this->setIfExists('encrypted_expiry_year', $data ?? [], null); + $this->setIfExists('encrypted_security_code', $data ?? [], null); + $this->setIfExists('expiry_month', $data ?? [], null); + $this->setIfExists('expiry_year', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('holder_name', $data ?? [], null); + $this->setIfExists('network_payment_reference', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('shopper_notification_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('three_ds2_sdk_version', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'scheme'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand Secondary brand of the card. For example: **plastix**, **hmclub**. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets cupsecureplus_smscode + * + * @return string|null + * @deprecated + */ + public function getCupsecureplusSmscode() + { + return $this->container['cupsecureplus_smscode']; + } + + /** + * Sets cupsecureplus_smscode + * + * @param string|null $cupsecureplus_smscode cupsecureplus_smscode + * + * @return self + * @deprecated + */ + public function setCupsecureplusSmscode($cupsecureplus_smscode) + { + if (is_null($cupsecureplus_smscode)) { + throw new \InvalidArgumentException('non-nullable cupsecureplus_smscode cannot be null'); + } + $this->container['cupsecureplus_smscode'] = $cupsecureplus_smscode; + + return $this; + } + + /** + * Gets cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets encrypted_card_number + * + * @return string|null + */ + public function getEncryptedCardNumber() + { + return $this->container['encrypted_card_number']; + } + + /** + * Sets encrypted_card_number + * + * @param string|null $encrypted_card_number The encrypted card number. + * + * @return self + */ + public function setEncryptedCardNumber($encrypted_card_number) + { + if (is_null($encrypted_card_number)) { + throw new \InvalidArgumentException('non-nullable encrypted_card_number cannot be null'); + } + $this->container['encrypted_card_number'] = $encrypted_card_number; + + return $this; + } + + /** + * Gets encrypted_expiry_month + * + * @return string|null + */ + public function getEncryptedExpiryMonth() + { + return $this->container['encrypted_expiry_month']; + } + + /** + * Sets encrypted_expiry_month + * + * @param string|null $encrypted_expiry_month The encrypted card expiry month. + * + * @return self + */ + public function setEncryptedExpiryMonth($encrypted_expiry_month) + { + if (is_null($encrypted_expiry_month)) { + throw new \InvalidArgumentException('non-nullable encrypted_expiry_month cannot be null'); + } + $this->container['encrypted_expiry_month'] = $encrypted_expiry_month; + + return $this; + } + + /** + * Gets encrypted_expiry_year + * + * @return string|null + */ + public function getEncryptedExpiryYear() + { + return $this->container['encrypted_expiry_year']; + } + + /** + * Sets encrypted_expiry_year + * + * @param string|null $encrypted_expiry_year The encrypted card expiry year. + * + * @return self + */ + public function setEncryptedExpiryYear($encrypted_expiry_year) + { + if (is_null($encrypted_expiry_year)) { + throw new \InvalidArgumentException('non-nullable encrypted_expiry_year cannot be null'); + } + $this->container['encrypted_expiry_year'] = $encrypted_expiry_year; + + return $this; + } + + /** + * Gets encrypted_security_code + * + * @return string|null + */ + public function getEncryptedSecurityCode() + { + return $this->container['encrypted_security_code']; + } + + /** + * Sets encrypted_security_code + * + * @param string|null $encrypted_security_code The encrypted card verification code. + * + * @return self + */ + public function setEncryptedSecurityCode($encrypted_security_code) + { + if (is_null($encrypted_security_code)) { + throw new \InvalidArgumentException('non-nullable encrypted_security_code cannot be null'); + } + $this->container['encrypted_security_code'] = $encrypted_security_code; + + return $this; + } + + /** + * Gets expiry_month + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiry_month']; + } + + /** + * Sets expiry_month + * + * @param string|null $expiry_month The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setExpiryMonth($expiry_month) + { + if (is_null($expiry_month)) { + throw new \InvalidArgumentException('non-nullable expiry_month cannot be null'); + } + $this->container['expiry_month'] = $expiry_month; + + return $this; + } + + /** + * Gets expiry_year + * + * @return string|null + */ + public function getExpiryYear() + { + return $this->container['expiry_year']; + } + + /** + * Sets expiry_year + * + * @param string|null $expiry_year The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setExpiryYear($expiry_year) + { + if (is_null($expiry_year)) { + throw new \InvalidArgumentException('non-nullable expiry_year cannot be null'); + } + $this->container['expiry_year'] = $expiry_year; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets holder_name + * + * @return string|null + */ + public function getHolderName() + { + return $this->container['holder_name']; + } + + /** + * Sets holder_name + * + * @param string|null $holder_name The name of the card holder. + * + * @return self + */ + public function setHolderName($holder_name) + { + if (is_null($holder_name)) { + throw new \InvalidArgumentException('non-nullable holder_name cannot be null'); + } + $this->container['holder_name'] = $holder_name; + + return $this; + } + + /** + * Gets network_payment_reference + * + * @return string|null + */ + public function getNetworkPaymentReference() + { + return $this->container['network_payment_reference']; + } + + /** + * Sets network_payment_reference + * + * @param string|null $network_payment_reference The network token reference. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + * + * @return self + */ + public function setNetworkPaymentReference($network_payment_reference) + { + if (is_null($network_payment_reference)) { + throw new \InvalidArgumentException('non-nullable network_payment_reference cannot be null'); + } + $this->container['network_payment_reference'] = $network_payment_reference; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets shopper_notification_reference + * + * @return string|null + */ + public function getShopperNotificationReference() + { + return $this->container['shopper_notification_reference']; + } + + /** + * Sets shopper_notification_reference + * + * @param string|null $shopper_notification_reference The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. + * + * @return self + */ + public function setShopperNotificationReference($shopper_notification_reference) + { + if (is_null($shopper_notification_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_notification_reference cannot be null'); + } + $this->container['shopper_notification_reference'] = $shopper_notification_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets three_ds2_sdk_version + * + * @return string|null + */ + public function getThreeDs2SdkVersion() + { + return $this->container['three_ds2_sdk_version']; + } + + /** + * Sets three_ds2_sdk_version + * + * @param string|null $three_ds2_sdk_version Version of the 3D Secure 2 mobile SDK. + * + * @return self + */ + public function setThreeDs2SdkVersion($three_ds2_sdk_version) + { + if (is_null($three_ds2_sdk_version)) { + throw new \InvalidArgumentException('non-nullable three_ds2_sdk_version cannot be null'); + } + $this->container['three_ds2_sdk_version'] = $three_ds2_sdk_version; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Default payment method details. Common for scheme payment methods, and for simple payment method details. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CardDetailsRequest.php b/src/Adyen/Model/Checkout/CardDetailsRequest.php new file mode 100644 index 000000000..ab1c585c4 --- /dev/null +++ b/src/Adyen/Model/Checkout/CardDetailsRequest.php @@ -0,0 +1,529 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CardDetailsRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CardDetailsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardDetailsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'card_number' => 'string', + 'country_code' => 'string', + 'encrypted_card_number' => 'string', + 'merchant_account' => 'string', + 'supported_brands' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'card_number' => null, + 'country_code' => null, + 'encrypted_card_number' => null, + 'merchant_account' => null, + 'supported_brands' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'card_number' => false, + 'country_code' => false, + 'encrypted_card_number' => false, + 'merchant_account' => false, + 'supported_brands' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_number' => 'cardNumber', + 'country_code' => 'countryCode', + 'encrypted_card_number' => 'encryptedCardNumber', + 'merchant_account' => 'merchantAccount', + 'supported_brands' => 'supportedBrands' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_number' => 'setCardNumber', + 'country_code' => 'setCountryCode', + 'encrypted_card_number' => 'setEncryptedCardNumber', + 'merchant_account' => 'setMerchantAccount', + 'supported_brands' => 'setSupportedBrands' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_number' => 'getCardNumber', + 'country_code' => 'getCountryCode', + 'encrypted_card_number' => 'getEncryptedCardNumber', + 'merchant_account' => 'getMerchantAccount', + 'supported_brands' => 'getSupportedBrands' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('card_number', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('encrypted_card_number', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('supported_brands', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['card_number'] === null) { + $invalidProperties[] = "'card_number' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' 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 card_number + * + * @return string + */ + public function getCardNumber() + { + return $this->container['card_number']; + } + + /** + * Sets card_number + * + * @param string $card_number A minimum of the first 8 digits of the card number and a maximum of the full card number. 11 digits gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. + * + * @return self + */ + public function setCardNumber($card_number) + { + if (is_null($card_number)) { + throw new \InvalidArgumentException('non-nullable card_number cannot be null'); + } + $this->container['card_number'] = $card_number; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets encrypted_card_number + * + * @return string|null + */ + public function getEncryptedCardNumber() + { + return $this->container['encrypted_card_number']; + } + + /** + * Sets encrypted_card_number + * + * @param string|null $encrypted_card_number The encrypted card number. + * + * @return self + */ + public function setEncryptedCardNumber($encrypted_card_number) + { + if (is_null($encrypted_card_number)) { + throw new \InvalidArgumentException('non-nullable encrypted_card_number cannot be null'); + } + $this->container['encrypted_card_number'] = $encrypted_card_number; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets supported_brands + * + * @return string[]|null + */ + public function getSupportedBrands() + { + return $this->container['supported_brands']; + } + + /** + * Sets supported_brands + * + * @param string[]|null $supported_brands The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code. + * + * @return self + */ + public function setSupportedBrands($supported_brands) + { + if (is_null($supported_brands)) { + throw new \InvalidArgumentException('non-nullable supported_brands cannot be null'); + } + $this->container['supported_brands'] = $supported_brands; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CardDetailsResponse.php b/src/Adyen/Model/Checkout/CardDetailsResponse.php new file mode 100644 index 000000000..27eec291b --- /dev/null +++ b/src/Adyen/Model/Checkout/CardDetailsResponse.php @@ -0,0 +1,387 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CardDetailsResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CardDetailsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brands' => '\Adyen\Model\Checkout\CardBrandDetails[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brands' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brands' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brands' => 'brands' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brands' => 'setBrands' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brands' => 'getBrands' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brands', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brands + * + * @return \Adyen\Model\Checkout\CardBrandDetails[]|null + */ + public function getBrands() + { + return $this->container['brands']; + } + + /** + * Sets brands + * + * @param \Adyen\Model\Checkout\CardBrandDetails[]|null $brands The list of brands identified for the card. + * + * @return self + */ + public function setBrands($brands) + { + if (is_null($brands)) { + throw new \InvalidArgumentException('non-nullable brands cannot be null'); + } + $this->container['brands'] = $brands; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CellulantDetails.php b/src/Adyen/Model/Checkout/CellulantDetails.php new file mode 100644 index 000000000..54cd82588 --- /dev/null +++ b/src/Adyen/Model/Checkout/CellulantDetails.php @@ -0,0 +1,486 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CellulantDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CellulantDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CellulantDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'issuer' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'issuer' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'issuer' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CELLULANT = 'cellulant'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CELLULANT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'cellulant'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets issuer + * + * @return string|null + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string|null $issuer The Cellulant issuer. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **Cellulant** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutAwaitAction.php b/src/Adyen/Model/Checkout/CheckoutAwaitAction.php new file mode 100644 index 000000000..2503f3ba6 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutAwaitAction.php @@ -0,0 +1,523 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutAwaitAction Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutAwaitAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutAwaitAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_data' => 'string', + 'payment_method_type' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_data' => null, + 'payment_method_type' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_data' => false, + 'payment_method_type' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_data' => 'paymentData', + 'payment_method_type' => 'paymentMethodType', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_data' => 'setPaymentData', + 'payment_method_type' => 'setPaymentMethodType', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_data' => 'getPaymentData', + 'payment_method_type' => 'getPaymentMethodType', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_AWAIT = 'await'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AWAIT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_data', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_data + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['payment_data']; + } + + /** + * Sets payment_data + * + * @param string|null $payment_data A value that must be submitted to the `/payments/details` endpoint to verify this payment. + * + * @return self + */ + public function setPaymentData($payment_data) + { + if (is_null($payment_data)) { + throw new \InvalidArgumentException('non-nullable payment_data cannot be null'); + } + $this->container['payment_data'] = $payment_data; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **await** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.php b/src/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.php new file mode 100644 index 000000000..bbba18ee4 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.php @@ -0,0 +1,1925 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutBalanceCheckRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutBalanceCheckRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutBalanceCheckRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Checkout\AccountInfo', + 'additional_amount' => '\Adyen\Model\Checkout\Amount', + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'application_info' => '\Adyen\Model\Checkout\ApplicationInfo', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'browser_info' => '\Adyen\Model\Checkout\BrowserInfo', + 'capture_delay_hours' => 'int', + 'date_of_birth' => '\DateTime', + 'dcc_quote' => '\Adyen\Model\Checkout\ForexQuote', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'delivery_date' => '\DateTime', + 'device_fingerprint' => 'string', + 'fraud_offset' => 'int', + 'installments' => '\Adyen\Model\Checkout\Installments', + 'localized_shopper_statement' => 'array', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'merchant_risk_indicator' => '\Adyen\Model\Checkout\MerchantRiskIndicator', + 'metadata' => 'array', + 'order_reference' => 'string', + 'payment_method' => 'array', + 'recurring' => '\Adyen\Model\Checkout\Recurring', + 'recurring_processing_model' => 'string', + 'reference' => 'string', + 'selected_brand' => 'string', + 'selected_recurring_detail_reference' => 'string', + 'session_id' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'store' => 'string', + 'telephone_number' => 'string', + 'three_ds2_request_data' => '\Adyen\Model\Checkout\ThreeDS2RequestData', + 'three_ds_authentication_only' => 'bool', + 'totals_group' => 'string', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_amount' => null, + 'additional_data' => null, + 'amount' => null, + 'application_info' => null, + 'billing_address' => null, + 'browser_info' => null, + 'capture_delay_hours' => 'int32', + 'date_of_birth' => 'date', + 'dcc_quote' => null, + 'delivery_address' => null, + 'delivery_date' => 'date-time', + 'device_fingerprint' => null, + 'fraud_offset' => 'int32', + 'installments' => null, + 'localized_shopper_statement' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'merchant_risk_indicator' => null, + 'metadata' => null, + 'order_reference' => null, + 'payment_method' => null, + 'recurring' => null, + 'recurring_processing_model' => null, + 'reference' => null, + 'selected_brand' => null, + 'selected_recurring_detail_reference' => null, + 'session_id' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'splits' => null, + 'store' => null, + 'telephone_number' => null, + 'three_ds2_request_data' => null, + 'three_ds_authentication_only' => null, + 'totals_group' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_amount' => false, + 'additional_data' => false, + 'amount' => false, + 'application_info' => false, + 'billing_address' => false, + 'browser_info' => false, + 'capture_delay_hours' => true, + 'date_of_birth' => false, + 'dcc_quote' => false, + 'delivery_address' => false, + 'delivery_date' => false, + 'device_fingerprint' => false, + 'fraud_offset' => true, + 'installments' => false, + 'localized_shopper_statement' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'merchant_risk_indicator' => false, + 'metadata' => false, + 'order_reference' => false, + 'payment_method' => false, + 'recurring' => false, + 'recurring_processing_model' => false, + 'reference' => false, + 'selected_brand' => false, + 'selected_recurring_detail_reference' => false, + 'session_id' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'splits' => false, + 'store' => false, + 'telephone_number' => false, + 'three_ds2_request_data' => false, + 'three_ds_authentication_only' => false, + 'totals_group' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_amount' => 'additionalAmount', + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'billing_address' => 'billingAddress', + 'browser_info' => 'browserInfo', + 'capture_delay_hours' => 'captureDelayHours', + 'date_of_birth' => 'dateOfBirth', + 'dcc_quote' => 'dccQuote', + 'delivery_address' => 'deliveryAddress', + 'delivery_date' => 'deliveryDate', + 'device_fingerprint' => 'deviceFingerprint', + 'fraud_offset' => 'fraudOffset', + 'installments' => 'installments', + 'localized_shopper_statement' => 'localizedShopperStatement', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'merchant_risk_indicator' => 'merchantRiskIndicator', + 'metadata' => 'metadata', + 'order_reference' => 'orderReference', + 'payment_method' => 'paymentMethod', + 'recurring' => 'recurring', + 'recurring_processing_model' => 'recurringProcessingModel', + 'reference' => 'reference', + 'selected_brand' => 'selectedBrand', + 'selected_recurring_detail_reference' => 'selectedRecurringDetailReference', + 'session_id' => 'sessionId', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'splits' => 'splits', + 'store' => 'store', + 'telephone_number' => 'telephoneNumber', + 'three_ds2_request_data' => 'threeDS2RequestData', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'totals_group' => 'totalsGroup', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_amount' => 'setAdditionalAmount', + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'billing_address' => 'setBillingAddress', + 'browser_info' => 'setBrowserInfo', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'date_of_birth' => 'setDateOfBirth', + 'dcc_quote' => 'setDccQuote', + 'delivery_address' => 'setDeliveryAddress', + 'delivery_date' => 'setDeliveryDate', + 'device_fingerprint' => 'setDeviceFingerprint', + 'fraud_offset' => 'setFraudOffset', + 'installments' => 'setInstallments', + 'localized_shopper_statement' => 'setLocalizedShopperStatement', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'merchant_risk_indicator' => 'setMerchantRiskIndicator', + 'metadata' => 'setMetadata', + 'order_reference' => 'setOrderReference', + 'payment_method' => 'setPaymentMethod', + 'recurring' => 'setRecurring', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'reference' => 'setReference', + 'selected_brand' => 'setSelectedBrand', + 'selected_recurring_detail_reference' => 'setSelectedRecurringDetailReference', + 'session_id' => 'setSessionId', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds2_request_data' => 'setThreeDs2RequestData', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'totals_group' => 'setTotalsGroup', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_amount' => 'getAdditionalAmount', + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'billing_address' => 'getBillingAddress', + 'browser_info' => 'getBrowserInfo', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'date_of_birth' => 'getDateOfBirth', + 'dcc_quote' => 'getDccQuote', + 'delivery_address' => 'getDeliveryAddress', + 'delivery_date' => 'getDeliveryDate', + 'device_fingerprint' => 'getDeviceFingerprint', + 'fraud_offset' => 'getFraudOffset', + 'installments' => 'getInstallments', + 'localized_shopper_statement' => 'getLocalizedShopperStatement', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'merchant_risk_indicator' => 'getMerchantRiskIndicator', + 'metadata' => 'getMetadata', + 'order_reference' => 'getOrderReference', + 'payment_method' => 'getPaymentMethod', + 'recurring' => 'getRecurring', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'reference' => 'getReference', + 'selected_brand' => 'getSelectedBrand', + 'selected_recurring_detail_reference' => 'getSelectedRecurringDetailReference', + 'session_id' => 'getSessionId', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds2_request_data' => 'getThreeDs2RequestData', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'totals_group' => 'getTotalsGroup', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_amount', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('browser_info', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('dcc_quote', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('delivery_date', $data ?? [], null); + $this->setIfExists('device_fingerprint', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('localized_shopper_statement', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('merchant_risk_indicator', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('order_reference', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('recurring', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('selected_brand', $data ?? [], null); + $this->setIfExists('selected_recurring_detail_reference', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds2_request_data', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('totals_group', $data ?? [], null); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + 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 account_info + * + * @return \Adyen\Model\Checkout\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Checkout\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additional_amount']; + } + + /** + * Sets additional_amount + * + * @param \Adyen\Model\Checkout\Amount|null $additional_amount additional_amount + * + * @return self + */ + public function setAdditionalAmount($additional_amount) + { + if (is_null($additional_amount)) { + throw new \InvalidArgumentException('non-nullable additional_amount cannot be null'); + } + $this->container['additional_amount'] = $additional_amount; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets browser_info + * + * @return \Adyen\Model\Checkout\BrowserInfo|null + */ + public function getBrowserInfo() + { + return $this->container['browser_info']; + } + + /** + * Sets browser_info + * + * @param \Adyen\Model\Checkout\BrowserInfo|null $browser_info browser_info + * + * @return self + */ + public function setBrowserInfo($browser_info) + { + if (is_null($browser_info)) { + throw new \InvalidArgumentException('non-nullable browser_info cannot be null'); + } + $this->container['browser_info'] = $browser_info; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets dcc_quote + * + * @return \Adyen\Model\Checkout\ForexQuote|null + */ + public function getDccQuote() + { + return $this->container['dcc_quote']; + } + + /** + * Sets dcc_quote + * + * @param \Adyen\Model\Checkout\ForexQuote|null $dcc_quote dcc_quote + * + * @return self + */ + public function setDccQuote($dcc_quote) + { + if (is_null($dcc_quote)) { + throw new \InvalidArgumentException('non-nullable dcc_quote cannot be null'); + } + $this->container['dcc_quote'] = $dcc_quote; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets delivery_date + * + * @return \DateTime|null + */ + public function getDeliveryDate() + { + return $this->container['delivery_date']; + } + + /** + * Sets delivery_date + * + * @param \DateTime|null $delivery_date The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliveryDate($delivery_date) + { + if (is_null($delivery_date)) { + throw new \InvalidArgumentException('non-nullable delivery_date cannot be null'); + } + $this->container['delivery_date'] = $delivery_date; + + return $this; + } + + /** + * Gets device_fingerprint + * + * @return string|null + */ + public function getDeviceFingerprint() + { + return $this->container['device_fingerprint']; + } + + /** + * Sets device_fingerprint + * + * @param string|null $device_fingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + * + * @return self + */ + public function setDeviceFingerprint($device_fingerprint) + { + if (is_null($device_fingerprint)) { + throw new \InvalidArgumentException('non-nullable device_fingerprint cannot be null'); + } + $this->container['device_fingerprint'] = $device_fingerprint; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Checkout\Installments|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Checkout\Installments|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets localized_shopper_statement + * + * @return array|null + */ + public function getLocalizedShopperStatement() + { + return $this->container['localized_shopper_statement']; + } + + /** + * Sets localized_shopper_statement + * + * @param array|null $localized_shopper_statement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * + * @return self + */ + public function setLocalizedShopperStatement($localized_shopper_statement) + { + if (is_null($localized_shopper_statement)) { + throw new \InvalidArgumentException('non-nullable localized_shopper_statement cannot be null'); + } + $this->container['localized_shopper_statement'] = $localized_shopper_statement; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets merchant_risk_indicator + * + * @return \Adyen\Model\Checkout\MerchantRiskIndicator|null + */ + public function getMerchantRiskIndicator() + { + return $this->container['merchant_risk_indicator']; + } + + /** + * Sets merchant_risk_indicator + * + * @param \Adyen\Model\Checkout\MerchantRiskIndicator|null $merchant_risk_indicator merchant_risk_indicator + * + * @return self + */ + public function setMerchantRiskIndicator($merchant_risk_indicator) + { + if (is_null($merchant_risk_indicator)) { + throw new \InvalidArgumentException('non-nullable merchant_risk_indicator cannot be null'); + } + $this->container['merchant_risk_indicator'] = $merchant_risk_indicator; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets order_reference + * + * @return string|null + */ + public function getOrderReference() + { + return $this->container['order_reference']; + } + + /** + * Sets order_reference + * + * @param string|null $order_reference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + * + * @return self + */ + public function setOrderReference($order_reference) + { + if (is_null($order_reference)) { + throw new \InvalidArgumentException('non-nullable order_reference cannot be null'); + } + $this->container['order_reference'] = $order_reference; + + return $this; + } + + /** + * Gets payment_method + * + * @return array + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param array $payment_method The collection that contains the type of the payment method and its specific information. + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets recurring + * + * @return \Adyen\Model\Checkout\Recurring|null + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param \Adyen\Model\Checkout\Recurring|null $recurring recurring + * + * @return self + */ + public function setRecurring($recurring) + { + if (is_null($recurring)) { + throw new \InvalidArgumentException('non-nullable recurring cannot be null'); + } + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets selected_brand + * + * @return string|null + */ + public function getSelectedBrand() + { + return $this->container['selected_brand']; + } + + /** + * Sets selected_brand + * + * @param string|null $selected_brand Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + * + * @return self + */ + public function setSelectedBrand($selected_brand) + { + if (is_null($selected_brand)) { + throw new \InvalidArgumentException('non-nullable selected_brand cannot be null'); + } + $this->container['selected_brand'] = $selected_brand; + + return $this; + } + + /** + * Gets selected_recurring_detail_reference + * + * @return string|null + */ + public function getSelectedRecurringDetailReference() + { + return $this->container['selected_recurring_detail_reference']; + } + + /** + * Sets selected_recurring_detail_reference + * + * @param string|null $selected_recurring_detail_reference The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + * + * @return self + */ + public function setSelectedRecurringDetailReference($selected_recurring_detail_reference) + { + if (is_null($selected_recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable selected_recurring_detail_reference cannot be null'); + } + $this->container['selected_recurring_detail_reference'] = $selected_recurring_detail_reference; + + return $this; + } + + /** + * Gets session_id + * + * @return string|null + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string|null $session_id A session ID used to identify a payment session. + * + * @return self + */ + public function setSessionId($session_id) + { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } + $this->container['session_id'] = $session_id; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds2_request_data + * + * @return \Adyen\Model\Checkout\ThreeDS2RequestData|null + */ + public function getThreeDs2RequestData() + { + return $this->container['three_ds2_request_data']; + } + + /** + * Sets three_ds2_request_data + * + * @param \Adyen\Model\Checkout\ThreeDS2RequestData|null $three_ds2_request_data three_ds2_request_data + * + * @return self + */ + public function setThreeDs2RequestData($three_ds2_request_data) + { + if (is_null($three_ds2_request_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_request_data cannot be null'); + } + $this->container['three_ds2_request_data'] = $three_ds2_request_data; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + * @deprecated + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + * @deprecated + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets totals_group + * + * @return string|null + */ + public function getTotalsGroup() + { + return $this->container['totals_group']; + } + + /** + * Sets totals_group + * + * @param string|null $totals_group The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + * + * @return self + */ + public function setTotalsGroup($totals_group) + { + if (is_null($totals_group)) { + throw new \InvalidArgumentException('non-nullable totals_group cannot be null'); + } + $this->container['totals_group'] = $totals_group; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.php b/src/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.php new file mode 100644 index 000000000..95b32cfa9 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.php @@ -0,0 +1,632 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutBalanceCheckResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutBalanceCheckResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutBalanceCheckResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'balance' => '\Adyen\Model\Checkout\Amount', + 'fraud_result' => '\Adyen\Model\Checkout\FraudResult', + 'psp_reference' => 'string', + 'refusal_reason' => 'string', + 'result_code' => 'string', + 'transaction_limit' => '\Adyen\Model\Checkout\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'balance' => null, + 'fraud_result' => null, + 'psp_reference' => null, + 'refusal_reason' => null, + 'result_code' => null, + 'transaction_limit' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'balance' => false, + 'fraud_result' => false, + 'psp_reference' => false, + 'refusal_reason' => false, + 'result_code' => false, + 'transaction_limit' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'balance' => 'balance', + 'fraud_result' => 'fraudResult', + 'psp_reference' => 'pspReference', + 'refusal_reason' => 'refusalReason', + 'result_code' => 'resultCode', + 'transaction_limit' => 'transactionLimit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'balance' => 'setBalance', + 'fraud_result' => 'setFraudResult', + 'psp_reference' => 'setPspReference', + 'refusal_reason' => 'setRefusalReason', + 'result_code' => 'setResultCode', + 'transaction_limit' => 'setTransactionLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'balance' => 'getBalance', + 'fraud_result' => 'getFraudResult', + 'psp_reference' => 'getPspReference', + 'refusal_reason' => 'getRefusalReason', + 'result_code' => 'getResultCode', + 'transaction_limit' => 'getTransactionLimit' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_CODE_SUCCESS = 'Success'; + public const RESULT_CODE_NOT_ENOUGH_BALANCE = 'NotEnoughBalance'; + public const RESULT_CODE_FAILED = 'Failed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultCodeAllowableValues() + { + return [ + self::RESULT_CODE_SUCCESS, + self::RESULT_CODE_NOT_ENOUGH_BALANCE, + self::RESULT_CODE_FAILED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('balance', $data ?? [], null); + $this->setIfExists('fraud_result', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('refusal_reason', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + $this->setIfExists('transaction_limit', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balance'] === null) { + $invalidProperties[] = "'balance' can't be null"; + } + if ($this->container['result_code'] === null) { + $invalidProperties[] = "'result_code' can't be null"; + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!is_null($this->container['result_code']) && !in_array($this->container['result_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result_code', must be one of '%s'", + $this->container['result_code'], + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets balance + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getBalance() + { + return $this->container['balance']; + } + + /** + * Sets balance + * + * @param \Adyen\Model\Checkout\Amount $balance balance + * + * @return self + */ + public function setBalance($balance) + { + if (is_null($balance)) { + throw new \InvalidArgumentException('non-nullable balance cannot be null'); + } + $this->container['balance'] = $balance; + + return $this; + } + + /** + * Gets fraud_result + * + * @return \Adyen\Model\Checkout\FraudResult|null + */ + public function getFraudResult() + { + return $this->container['fraud_result']; + } + + /** + * Sets fraud_result + * + * @param \Adyen\Model\Checkout\FraudResult|null $fraud_result fraud_result + * + * @return self + */ + public function setFraudResult($fraud_result) + { + if (is_null($fraud_result)) { + throw new \InvalidArgumentException('non-nullable fraud_result cannot be null'); + } + $this->container['fraud_result'] = $fraud_result; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets refusal_reason + * + * @return string|null + */ + public function getRefusalReason() + { + return $this->container['refusal_reason']; + } + + /** + * Sets refusal_reason + * + * @param string|null $refusal_reason If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReason($refusal_reason) + { + if (is_null($refusal_reason)) { + throw new \InvalidArgumentException('non-nullable refusal_reason cannot be null'); + } + $this->container['refusal_reason'] = $refusal_reason; + + return $this; + } + + /** + * Gets result_code + * + * @return string + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string $result_code The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!in_array($result_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result_code', must be one of '%s'", + $result_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result_code'] = $result_code; + + return $this; + } + + /** + * Gets transaction_limit + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getTransactionLimit() + { + return $this->container['transaction_limit']; + } + + /** + * Sets transaction_limit + * + * @param \Adyen\Model\Checkout\Amount|null $transaction_limit transaction_limit + * + * @return self + */ + public function setTransactionLimit($transaction_limit) + { + if (is_null($transaction_limit)) { + throw new \InvalidArgumentException('non-nullable transaction_limit cannot be null'); + } + $this->container['transaction_limit'] = $transaction_limit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutCancelOrderRequest.php b/src/Adyen/Model/Checkout/CheckoutCancelOrderRequest.php new file mode 100644 index 000000000..9fbd39152 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutCancelOrderRequest.php @@ -0,0 +1,427 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutCancelOrderRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutCancelOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutCancelOrderRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'order' => '\Adyen\Model\Checkout\CheckoutOrder' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'order' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'order' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'order' => 'order' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'order' => 'setOrder' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'order' => 'getOrder' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['order'] === null) { + $invalidProperties[] = "'order' 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 merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier that orderData belongs to. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets order + * + * @return \Adyen\Model\Checkout\CheckoutOrder + */ + public function getOrder() + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param \Adyen\Model\Checkout\CheckoutOrder $order order + * + * @return self + */ + public function setOrder($order) + { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutCancelOrderResponse.php b/src/Adyen/Model/Checkout/CheckoutCancelOrderResponse.php new file mode 100644 index 000000000..2d3e14bb5 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutCancelOrderResponse.php @@ -0,0 +1,458 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutCancelOrderResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutCancelOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutCancelOrderResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'psp_reference' => 'string', + 'result_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'psp_reference' => null, + 'result_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'psp_reference' => false, + 'result_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'psp_reference' => 'pspReference', + 'result_code' => 'resultCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'psp_reference' => 'setPspReference', + 'result_code' => 'setResultCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'psp_reference' => 'getPspReference', + 'result_code' => 'getResultCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_CODE_RECEIVED = 'Received'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultCodeAllowableValues() + { + return [ + self::RESULT_CODE_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['result_code'] === null) { + $invalidProperties[] = "'result_code' can't be null"; + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!is_null($this->container['result_code']) && !in_array($this->container['result_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result_code', must be one of '%s'", + $this->container['result_code'], + 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 psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference A unique reference of the cancellation request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets result_code + * + * @return string + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string $result_code The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!in_array($result_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result_code', must be one of '%s'", + $result_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result_code'] = $result_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutCreateOrderRequest.php b/src/Adyen/Model/Checkout/CheckoutCreateOrderRequest.php new file mode 100644 index 000000000..ee00d6a92 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutCreateOrderRequest.php @@ -0,0 +1,498 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutCreateOrderRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutCreateOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutCreateOrderRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'expires_at' => 'string', + 'merchant_account' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'expires_at' => null, + 'merchant_account' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'expires_at' => false, + 'merchant_account' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'expires_at' => 'expiresAt', + 'merchant_account' => 'merchantAccount', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'expires_at' => 'setExpiresAt', + 'merchant_account' => 'setMerchantAccount', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'expires_at' => 'getExpiresAt', + 'merchant_account' => 'getMerchantAccount', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets expires_at + * + * @return string|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string|null $expires_at The date that order expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the order. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference A custom reference identifying the order. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutCreateOrderResponse.php b/src/Adyen/Model/Checkout/CheckoutCreateOrderResponse.php new file mode 100644 index 000000000..06acede1b --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutCreateOrderResponse.php @@ -0,0 +1,739 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutCreateOrderResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutCreateOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutCreateOrderResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'expires_at' => 'string', + 'fraud_result' => '\Adyen\Model\Checkout\FraudResult', + 'order_data' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'refusal_reason' => 'string', + 'remaining_amount' => '\Adyen\Model\Checkout\Amount', + 'result_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'amount' => null, + 'expires_at' => null, + 'fraud_result' => null, + 'order_data' => null, + 'psp_reference' => null, + 'reference' => null, + 'refusal_reason' => null, + 'remaining_amount' => null, + 'result_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'amount' => false, + 'expires_at' => false, + 'fraud_result' => false, + 'order_data' => false, + 'psp_reference' => false, + 'reference' => false, + 'refusal_reason' => false, + 'remaining_amount' => false, + 'result_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'expires_at' => 'expiresAt', + 'fraud_result' => 'fraudResult', + 'order_data' => 'orderData', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'refusal_reason' => 'refusalReason', + 'remaining_amount' => 'remainingAmount', + 'result_code' => 'resultCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'expires_at' => 'setExpiresAt', + 'fraud_result' => 'setFraudResult', + 'order_data' => 'setOrderData', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'refusal_reason' => 'setRefusalReason', + 'remaining_amount' => 'setRemainingAmount', + 'result_code' => 'setResultCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'expires_at' => 'getExpiresAt', + 'fraud_result' => 'getFraudResult', + 'order_data' => 'getOrderData', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'refusal_reason' => 'getRefusalReason', + 'remaining_amount' => 'getRemainingAmount', + 'result_code' => 'getResultCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_CODE_SUCCESS = 'Success'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultCodeAllowableValues() + { + return [ + self::RESULT_CODE_SUCCESS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('fraud_result', $data ?? [], null); + $this->setIfExists('order_data', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('refusal_reason', $data ?? [], null); + $this->setIfExists('remaining_amount', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['expires_at'] === null) { + $invalidProperties[] = "'expires_at' can't be null"; + } + if ($this->container['order_data'] === null) { + $invalidProperties[] = "'order_data' can't be null"; + } + if ($this->container['remaining_amount'] === null) { + $invalidProperties[] = "'remaining_amount' can't be null"; + } + if ($this->container['result_code'] === null) { + $invalidProperties[] = "'result_code' can't be null"; + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!is_null($this->container['result_code']) && !in_array($this->container['result_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result_code', must be one of '%s'", + $this->container['result_code'], + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets expires_at + * + * @return string + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string $expires_at The date that the order will expire. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets fraud_result + * + * @return \Adyen\Model\Checkout\FraudResult|null + */ + public function getFraudResult() + { + return $this->container['fraud_result']; + } + + /** + * Sets fraud_result + * + * @param \Adyen\Model\Checkout\FraudResult|null $fraud_result fraud_result + * + * @return self + */ + public function setFraudResult($fraud_result) + { + if (is_null($fraud_result)) { + throw new \InvalidArgumentException('non-nullable fraud_result cannot be null'); + } + $this->container['fraud_result'] = $fraud_result; + + return $this; + } + + /** + * Gets order_data + * + * @return string + */ + public function getOrderData() + { + return $this->container['order_data']; + } + + /** + * Sets order_data + * + * @param string $order_data The encrypted data that will be used by merchant for adding payments to the order. + * + * @return self + */ + public function setOrderData($order_data) + { + if (is_null($order_data)) { + throw new \InvalidArgumentException('non-nullable order_data cannot be null'); + } + $this->container['order_data'] = $order_data; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference provided by merchant for creating the order. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets refusal_reason + * + * @return string|null + */ + public function getRefusalReason() + { + return $this->container['refusal_reason']; + } + + /** + * Sets refusal_reason + * + * @param string|null $refusal_reason If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReason($refusal_reason) + { + if (is_null($refusal_reason)) { + throw new \InvalidArgumentException('non-nullable refusal_reason cannot be null'); + } + $this->container['refusal_reason'] = $refusal_reason; + + return $this; + } + + /** + * Gets remaining_amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getRemainingAmount() + { + return $this->container['remaining_amount']; + } + + /** + * Sets remaining_amount + * + * @param \Adyen\Model\Checkout\Amount $remaining_amount remaining_amount + * + * @return self + */ + public function setRemainingAmount($remaining_amount) + { + if (is_null($remaining_amount)) { + throw new \InvalidArgumentException('non-nullable remaining_amount cannot be null'); + } + $this->container['remaining_amount'] = $remaining_amount; + + return $this; + } + + /** + * Gets result_code + * + * @return string + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string $result_code The result of the order creation request. The value is always **Success**. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!in_array($result_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result_code', must be one of '%s'", + $result_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result_code'] = $result_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php b/src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php new file mode 100644 index 000000000..8061c63c3 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutNativeRedirectAction.php @@ -0,0 +1,591 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutNativeRedirectAction Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutNativeRedirectAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutNativeRedirectAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'array', + 'method' => 'string', + 'native_redirect_data' => 'string', + 'payment_method_type' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'method' => null, + 'native_redirect_data' => null, + 'payment_method_type' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'method' => false, + 'native_redirect_data' => false, + 'payment_method_type' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'method' => 'method', + 'native_redirect_data' => 'nativeRedirectData', + 'payment_method_type' => 'paymentMethodType', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'method' => 'setMethod', + 'native_redirect_data' => 'setNativeRedirectData', + 'payment_method_type' => 'setPaymentMethodType', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'method' => 'getMethod', + 'native_redirect_data' => 'getNativeRedirectData', + 'payment_method_type' => 'getPaymentMethodType', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_NATIVE_REDIRECT = 'nativeRedirect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NATIVE_REDIRECT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('native_redirect_data', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return array|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param array|null $data When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets method + * + * @return string|null + */ + public function getMethod() + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param string|null $method Specifies the HTTP method, for example GET or POST. + * + * @return self + */ + public function setMethod($method) + { + if (is_null($method)) { + throw new \InvalidArgumentException('non-nullable method cannot be null'); + } + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets native_redirect_data + * + * @return string|null + */ + public function getNativeRedirectData() + { + return $this->container['native_redirect_data']; + } + + /** + * Sets native_redirect_data + * + * @param string|null $native_redirect_data Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. + * + * @return self + */ + public function setNativeRedirectData($native_redirect_data) + { + if (is_null($native_redirect_data)) { + throw new \InvalidArgumentException('non-nullable native_redirect_data cannot be null'); + } + $this->container['native_redirect_data'] = $native_redirect_data; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **nativeRedirect** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutOrder.php b/src/Adyen/Model/Checkout/CheckoutOrder.php new file mode 100644 index 000000000..e43932657 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutOrder.php @@ -0,0 +1,427 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutOrder Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutOrder implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutOrder'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'order_data' => 'string', + 'psp_reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'order_data' => null, + 'psp_reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'order_data' => false, + 'psp_reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_data' => 'orderData', + 'psp_reference' => 'pspReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_data' => 'setOrderData', + 'psp_reference' => 'setPspReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_data' => 'getOrderData', + 'psp_reference' => 'getPspReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('order_data', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['order_data'] === null) { + $invalidProperties[] = "'order_data' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' 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 order_data + * + * @return string + */ + public function getOrderData() + { + return $this->container['order_data']; + } + + /** + * Sets order_data + * + * @param string $order_data The encrypted order data. + * + * @return self + */ + public function setOrderData($order_data) + { + if (is_null($order_data)) { + throw new \InvalidArgumentException('non-nullable order_data cannot be null'); + } + $this->container['order_data'] = $order_data; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference The `pspReference` that belongs to the order. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutOrderResponse.php b/src/Adyen/Model/Checkout/CheckoutOrderResponse.php new file mode 100644 index 000000000..16251a6d1 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutOrderResponse.php @@ -0,0 +1,560 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutOrderResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutOrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutOrderResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'expires_at' => 'string', + 'order_data' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'remaining_amount' => '\Adyen\Model\Checkout\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'expires_at' => null, + 'order_data' => null, + 'psp_reference' => null, + 'reference' => null, + 'remaining_amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'expires_at' => false, + 'order_data' => false, + 'psp_reference' => false, + 'reference' => false, + 'remaining_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'expires_at' => 'expiresAt', + 'order_data' => 'orderData', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'remaining_amount' => 'remainingAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'expires_at' => 'setExpiresAt', + 'order_data' => 'setOrderData', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'remaining_amount' => 'setRemainingAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'expires_at' => 'getExpiresAt', + 'order_data' => 'getOrderData', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'remaining_amount' => 'getRemainingAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('order_data', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('remaining_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets expires_at + * + * @return string|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string|null $expires_at The expiry date for the order. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets order_data + * + * @return string|null + */ + public function getOrderData() + { + return $this->container['order_data']; + } + + /** + * Sets order_data + * + * @param string|null $order_data The encrypted order data. + * + * @return self + */ + public function setOrderData($order_data) + { + if (is_null($order_data)) { + throw new \InvalidArgumentException('non-nullable order_data cannot be null'); + } + $this->container['order_data'] = $order_data; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference The `pspReference` that belongs to the order. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The merchant reference for the order. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets remaining_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getRemainingAmount() + { + return $this->container['remaining_amount']; + } + + /** + * Sets remaining_amount + * + * @param \Adyen\Model\Checkout\Amount|null $remaining_amount remaining_amount + * + * @return self + */ + public function setRemainingAmount($remaining_amount) + { + if (is_null($remaining_amount)) { + throw new \InvalidArgumentException('non-nullable remaining_amount cannot be null'); + } + $this->container['remaining_amount'] = $remaining_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php new file mode 100644 index 000000000..2c2cee3ad --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutPaymentMethod.php @@ -0,0 +1,2037 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutPaymentMethod Class Doc Comment + * + * @category Class + * @description The type and required details of a payment method to use. + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutPaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutPaymentMethod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank_account_number' => 'string', + 'bank_location_id' => 'string', + 'checkout_attempt_id' => 'string', + 'encrypted_bank_account_number' => 'string', + 'encrypted_bank_location_id' => 'string', + 'owner_name' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string', + 'billing_address' => 'string', + 'delivery_address' => 'string', + 'personal_details' => 'string', + 'amazon_pay_token' => 'string', + 'apple_pay_token' => 'string', + 'funding_source' => 'string', + 'holder_name' => 'string', + 'issuer' => 'string', + 'blik_code' => 'string', + 'brand' => 'string', + 'cupsecureplus_smscode' => 'string', + 'cvc' => 'string', + 'encrypted_card_number' => 'string', + 'encrypted_expiry_month' => 'string', + 'encrypted_expiry_year' => 'string', + 'encrypted_security_code' => 'string', + 'expiry_month' => 'string', + 'expiry_year' => 'string', + 'network_payment_reference' => 'string', + 'number' => 'string', + 'shopper_notification_reference' => 'string', + 'three_ds2_sdk_version' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'shopper_email' => 'string', + 'telephone_number' => 'string', + 'google_pay_token' => 'string', + 'masterpass_transaction_id' => 'string', + 'order_id' => 'string', + 'payer_id' => 'string', + 'subtype' => 'string', + 'virtual_payment_address' => 'string', + 'samsung_pay_token' => 'string', + 'iban' => 'string', + 'billing_sequence_number' => 'string', + 'visa_checkout_call_id' => 'string', + 'app_id' => 'string', + 'openid' => 'string', + 'click_and_collect' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank_account_number' => null, + 'bank_location_id' => null, + 'checkout_attempt_id' => null, + 'encrypted_bank_account_number' => null, + 'encrypted_bank_location_id' => null, + 'owner_name' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null, + 'billing_address' => null, + 'delivery_address' => null, + 'personal_details' => null, + 'amazon_pay_token' => null, + 'apple_pay_token' => null, + 'funding_source' => null, + 'holder_name' => null, + 'issuer' => null, + 'blik_code' => null, + 'brand' => null, + 'cupsecureplus_smscode' => null, + 'cvc' => null, + 'encrypted_card_number' => null, + 'encrypted_expiry_month' => null, + 'encrypted_expiry_year' => null, + 'encrypted_security_code' => null, + 'expiry_month' => null, + 'expiry_year' => null, + 'network_payment_reference' => null, + 'number' => null, + 'shopper_notification_reference' => null, + 'three_ds2_sdk_version' => null, + 'first_name' => null, + 'last_name' => null, + 'shopper_email' => null, + 'telephone_number' => null, + 'google_pay_token' => null, + 'masterpass_transaction_id' => null, + 'order_id' => null, + 'payer_id' => null, + 'subtype' => null, + 'virtual_payment_address' => null, + 'samsung_pay_token' => null, + 'iban' => null, + 'billing_sequence_number' => null, + 'visa_checkout_call_id' => null, + 'app_id' => null, + 'openid' => null, + 'click_and_collect' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank_account_number' => false, + 'bank_location_id' => false, + 'checkout_attempt_id' => false, + 'encrypted_bank_account_number' => false, + 'encrypted_bank_location_id' => false, + 'owner_name' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false, + 'billing_address' => false, + 'delivery_address' => false, + 'personal_details' => false, + 'amazon_pay_token' => false, + 'apple_pay_token' => false, + 'funding_source' => false, + 'holder_name' => false, + 'issuer' => false, + 'blik_code' => false, + 'brand' => false, + 'cupsecureplus_smscode' => false, + 'cvc' => false, + 'encrypted_card_number' => false, + 'encrypted_expiry_month' => false, + 'encrypted_expiry_year' => false, + 'encrypted_security_code' => false, + 'expiry_month' => false, + 'expiry_year' => false, + 'network_payment_reference' => false, + 'number' => false, + 'shopper_notification_reference' => false, + 'three_ds2_sdk_version' => false, + 'first_name' => false, + 'last_name' => false, + 'shopper_email' => false, + 'telephone_number' => false, + 'google_pay_token' => false, + 'masterpass_transaction_id' => false, + 'order_id' => false, + 'payer_id' => false, + 'subtype' => false, + 'virtual_payment_address' => false, + 'samsung_pay_token' => false, + 'iban' => false, + 'billing_sequence_number' => false, + 'visa_checkout_call_id' => false, + 'app_id' => false, + 'openid' => false, + 'click_and_collect' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bank_account_number' => 'bankAccountNumber', + 'bank_location_id' => 'bankLocationId', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'encrypted_bank_account_number' => 'encryptedBankAccountNumber', + 'encrypted_bank_location_id' => 'encryptedBankLocationId', + 'owner_name' => 'ownerName', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type', + 'billing_address' => 'billingAddress', + 'delivery_address' => 'deliveryAddress', + 'personal_details' => 'personalDetails', + 'amazon_pay_token' => 'amazonPayToken', + 'apple_pay_token' => 'applePayToken', + 'funding_source' => 'fundingSource', + 'holder_name' => 'holderName', + 'issuer' => 'issuer', + 'blik_code' => 'blikCode', + 'brand' => 'brand', + 'cupsecureplus_smscode' => 'cupsecureplus.smscode', + 'cvc' => 'cvc', + 'encrypted_card_number' => 'encryptedCardNumber', + 'encrypted_expiry_month' => 'encryptedExpiryMonth', + 'encrypted_expiry_year' => 'encryptedExpiryYear', + 'encrypted_security_code' => 'encryptedSecurityCode', + 'expiry_month' => 'expiryMonth', + 'expiry_year' => 'expiryYear', + 'network_payment_reference' => 'networkPaymentReference', + 'number' => 'number', + 'shopper_notification_reference' => 'shopperNotificationReference', + 'three_ds2_sdk_version' => 'threeDS2SdkVersion', + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'shopper_email' => 'shopperEmail', + 'telephone_number' => 'telephoneNumber', + 'google_pay_token' => 'googlePayToken', + 'masterpass_transaction_id' => 'masterpassTransactionId', + 'order_id' => 'orderID', + 'payer_id' => 'payerID', + 'subtype' => 'subtype', + 'virtual_payment_address' => 'virtualPaymentAddress', + 'samsung_pay_token' => 'samsungPayToken', + 'iban' => 'iban', + 'billing_sequence_number' => 'billingSequenceNumber', + 'visa_checkout_call_id' => 'visaCheckoutCallId', + 'app_id' => 'appId', + 'openid' => 'openid', + 'click_and_collect' => 'clickAndCollect' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank_account_number' => 'setBankAccountNumber', + 'bank_location_id' => 'setBankLocationId', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'encrypted_bank_account_number' => 'setEncryptedBankAccountNumber', + 'encrypted_bank_location_id' => 'setEncryptedBankLocationId', + 'owner_name' => 'setOwnerName', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType', + 'billing_address' => 'setBillingAddress', + 'delivery_address' => 'setDeliveryAddress', + 'personal_details' => 'setPersonalDetails', + 'amazon_pay_token' => 'setAmazonPayToken', + 'apple_pay_token' => 'setApplePayToken', + 'funding_source' => 'setFundingSource', + 'holder_name' => 'setHolderName', + 'issuer' => 'setIssuer', + 'blik_code' => 'setBlikCode', + 'brand' => 'setBrand', + 'cupsecureplus_smscode' => 'setCupsecureplusSmscode', + 'cvc' => 'setCvc', + 'encrypted_card_number' => 'setEncryptedCardNumber', + 'encrypted_expiry_month' => 'setEncryptedExpiryMonth', + 'encrypted_expiry_year' => 'setEncryptedExpiryYear', + 'encrypted_security_code' => 'setEncryptedSecurityCode', + 'expiry_month' => 'setExpiryMonth', + 'expiry_year' => 'setExpiryYear', + 'network_payment_reference' => 'setNetworkPaymentReference', + 'number' => 'setNumber', + 'shopper_notification_reference' => 'setShopperNotificationReference', + 'three_ds2_sdk_version' => 'setThreeDs2SdkVersion', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'shopper_email' => 'setShopperEmail', + 'telephone_number' => 'setTelephoneNumber', + 'google_pay_token' => 'setGooglePayToken', + 'masterpass_transaction_id' => 'setMasterpassTransactionId', + 'order_id' => 'setOrderId', + 'payer_id' => 'setPayerId', + 'subtype' => 'setSubtype', + 'virtual_payment_address' => 'setVirtualPaymentAddress', + 'samsung_pay_token' => 'setSamsungPayToken', + 'iban' => 'setIban', + 'billing_sequence_number' => 'setBillingSequenceNumber', + 'visa_checkout_call_id' => 'setVisaCheckoutCallId', + 'app_id' => 'setAppId', + 'openid' => 'setOpenid', + 'click_and_collect' => 'setClickAndCollect' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank_account_number' => 'getBankAccountNumber', + 'bank_location_id' => 'getBankLocationId', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'encrypted_bank_account_number' => 'getEncryptedBankAccountNumber', + 'encrypted_bank_location_id' => 'getEncryptedBankLocationId', + 'owner_name' => 'getOwnerName', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType', + 'billing_address' => 'getBillingAddress', + 'delivery_address' => 'getDeliveryAddress', + 'personal_details' => 'getPersonalDetails', + 'amazon_pay_token' => 'getAmazonPayToken', + 'apple_pay_token' => 'getApplePayToken', + 'funding_source' => 'getFundingSource', + 'holder_name' => 'getHolderName', + 'issuer' => 'getIssuer', + 'blik_code' => 'getBlikCode', + 'brand' => 'getBrand', + 'cupsecureplus_smscode' => 'getCupsecureplusSmscode', + 'cvc' => 'getCvc', + 'encrypted_card_number' => 'getEncryptedCardNumber', + 'encrypted_expiry_month' => 'getEncryptedExpiryMonth', + 'encrypted_expiry_year' => 'getEncryptedExpiryYear', + 'encrypted_security_code' => 'getEncryptedSecurityCode', + 'expiry_month' => 'getExpiryMonth', + 'expiry_year' => 'getExpiryYear', + 'network_payment_reference' => 'getNetworkPaymentReference', + 'number' => 'getNumber', + 'shopper_notification_reference' => 'getShopperNotificationReference', + 'three_ds2_sdk_version' => 'getThreeDs2SdkVersion', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'shopper_email' => 'getShopperEmail', + 'telephone_number' => 'getTelephoneNumber', + 'google_pay_token' => 'getGooglePayToken', + 'masterpass_transaction_id' => 'getMasterpassTransactionId', + 'order_id' => 'getOrderId', + 'payer_id' => 'getPayerId', + 'subtype' => 'getSubtype', + 'virtual_payment_address' => 'getVirtualPaymentAddress', + 'samsung_pay_token' => 'getSamsungPayToken', + 'iban' => 'getIban', + 'billing_sequence_number' => 'getBillingSequenceNumber', + 'visa_checkout_call_id' => 'getVisaCheckoutCallId', + 'app_id' => 'getAppId', + 'openid' => 'getOpenid', + 'click_and_collect' => 'getClickAndCollect' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bank_account_number', $data ?? [], null); + $this->setIfExists('bank_location_id', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('encrypted_bank_account_number', $data ?? [], null); + $this->setIfExists('encrypted_bank_location_id', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'zip'); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('personal_details', $data ?? [], null); + $this->setIfExists('amazon_pay_token', $data ?? [], null); + $this->setIfExists('apple_pay_token', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('holder_name', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('blik_code', $data ?? [], null); + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('cupsecureplus_smscode', $data ?? [], null); + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('encrypted_card_number', $data ?? [], null); + $this->setIfExists('encrypted_expiry_month', $data ?? [], null); + $this->setIfExists('encrypted_expiry_year', $data ?? [], null); + $this->setIfExists('encrypted_security_code', $data ?? [], null); + $this->setIfExists('expiry_month', $data ?? [], null); + $this->setIfExists('expiry_year', $data ?? [], null); + $this->setIfExists('network_payment_reference', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('shopper_notification_reference', $data ?? [], null); + $this->setIfExists('three_ds2_sdk_version', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('google_pay_token', $data ?? [], null); + $this->setIfExists('masterpass_transaction_id', $data ?? [], null); + $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('payer_id', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); + $this->setIfExists('virtual_payment_address', $data ?? [], null); + $this->setIfExists('samsung_pay_token', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('billing_sequence_number', $data ?? [], null); + $this->setIfExists('visa_checkout_call_id', $data ?? [], null); + $this->setIfExists('app_id', $data ?? [], null); + $this->setIfExists('openid', $data ?? [], null); + $this->setIfExists('click_and_collect', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['bank_account_number'] === null) { + $invalidProperties[] = "'bank_account_number' can't be null"; + } + if ($this->container['owner_name'] === null) { + $invalidProperties[] = "'owner_name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['apple_pay_token'] === null) { + $invalidProperties[] = "'apple_pay_token' can't be null"; + } + + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' can't be null"; + } + if ($this->container['first_name'] === null) { + $invalidProperties[] = "'first_name' can't be null"; + } + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' can't be null"; + } + if ($this->container['shopper_email'] === null) { + $invalidProperties[] = "'shopper_email' can't be null"; + } + if ($this->container['telephone_number'] === null) { + $invalidProperties[] = "'telephone_number' can't be null"; + } + if ($this->container['google_pay_token'] === null) { + $invalidProperties[] = "'google_pay_token' can't be null"; + } + if ($this->container['masterpass_transaction_id'] === null) { + $invalidProperties[] = "'masterpass_transaction_id' can't be null"; + } + + if ($this->container['samsung_pay_token'] === null) { + $invalidProperties[] = "'samsung_pay_token' can't be null"; + } + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['billing_sequence_number'] === null) { + $invalidProperties[] = "'billing_sequence_number' can't be null"; + } + if ($this->container['visa_checkout_call_id'] === null) { + $invalidProperties[] = "'visa_checkout_call_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank_account_number + * + * @return string + */ + public function getBankAccountNumber() + { + return $this->container['bank_account_number']; + } + + /** + * Sets bank_account_number + * + * @param string $bank_account_number The bank account number (without separators). + * + * @return self + */ + public function setBankAccountNumber($bank_account_number) + { + if (is_null($bank_account_number)) { + throw new \InvalidArgumentException('non-nullable bank_account_number cannot be null'); + } + $this->container['bank_account_number'] = $bank_account_number; + + return $this; + } + + /** + * Gets bank_location_id + * + * @return string|null + */ + public function getBankLocationId() + { + return $this->container['bank_location_id']; + } + + /** + * Sets bank_location_id + * + * @param string|null $bank_location_id The bank routing number of the account. + * + * @return self + */ + public function setBankLocationId($bank_location_id) + { + if (is_null($bank_location_id)) { + throw new \InvalidArgumentException('non-nullable bank_location_id cannot be null'); + } + $this->container['bank_location_id'] = $bank_location_id; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets encrypted_bank_account_number + * + * @return string|null + */ + public function getEncryptedBankAccountNumber() + { + return $this->container['encrypted_bank_account_number']; + } + + /** + * Sets encrypted_bank_account_number + * + * @param string|null $encrypted_bank_account_number Encrypted bank account number. The bank account number (without separators). + * + * @return self + */ + public function setEncryptedBankAccountNumber($encrypted_bank_account_number) + { + if (is_null($encrypted_bank_account_number)) { + throw new \InvalidArgumentException('non-nullable encrypted_bank_account_number cannot be null'); + } + $this->container['encrypted_bank_account_number'] = $encrypted_bank_account_number; + + return $this; + } + + /** + * Gets encrypted_bank_location_id + * + * @return string|null + */ + public function getEncryptedBankLocationId() + { + return $this->container['encrypted_bank_location_id']; + } + + /** + * Sets encrypted_bank_location_id + * + * @param string|null $encrypted_bank_location_id Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. + * + * @return self + */ + public function setEncryptedBankLocationId($encrypted_bank_location_id) + { + if (is_null($encrypted_bank_location_id)) { + throw new \InvalidArgumentException('non-nullable encrypted_bank_location_id cannot be null'); + } + $this->container['encrypted_bank_location_id'] = $encrypted_bank_location_id; + + return $this; + } + + /** + * Gets owner_name + * + * @return string + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string $owner_name The name of the bank account holder. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **zip** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets billing_address + * + * @return string|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param string|null $billing_address The address where to send the invoice. + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets delivery_address + * + * @return string|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param string|null $delivery_address The address where the goods should be delivered. + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets personal_details + * + * @return string|null + */ + public function getPersonalDetails() + { + return $this->container['personal_details']; + } + + /** + * Sets personal_details + * + * @param string|null $personal_details Shopper name, date of birth, phone number, and email address. + * + * @return self + */ + public function setPersonalDetails($personal_details) + { + if (is_null($personal_details)) { + throw new \InvalidArgumentException('non-nullable personal_details cannot be null'); + } + $this->container['personal_details'] = $personal_details; + + return $this; + } + + /** + * Gets amazon_pay_token + * + * @return string|null + */ + public function getAmazonPayToken() + { + return $this->container['amazon_pay_token']; + } + + /** + * Sets amazon_pay_token + * + * @param string|null $amazon_pay_token This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. + * + * @return self + */ + public function setAmazonPayToken($amazon_pay_token) + { + if (is_null($amazon_pay_token)) { + throw new \InvalidArgumentException('non-nullable amazon_pay_token cannot be null'); + } + $this->container['amazon_pay_token'] = $amazon_pay_token; + + return $this; + } + + /** + * Gets apple_pay_token + * + * @return string + */ + public function getApplePayToken() + { + return $this->container['apple_pay_token']; + } + + /** + * Sets apple_pay_token + * + * @param string $apple_pay_token The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. + * + * @return self + */ + public function setApplePayToken($apple_pay_token) + { + if (is_null($apple_pay_token)) { + throw new \InvalidArgumentException('non-nullable apple_pay_token cannot be null'); + } + $this->container['apple_pay_token'] = $apple_pay_token; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets holder_name + * + * @return string|null + */ + public function getHolderName() + { + return $this->container['holder_name']; + } + + /** + * Sets holder_name + * + * @param string|null $holder_name The name of the card holder. + * + * @return self + */ + public function setHolderName($holder_name) + { + if (is_null($holder_name)) { + throw new \InvalidArgumentException('non-nullable holder_name cannot be null'); + } + $this->container['holder_name'] = $holder_name; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The shopper's bank. Specify this with the issuer value that corresponds to this bank. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets blik_code + * + * @return string|null + */ + public function getBlikCode() + { + return $this->container['blik_code']; + } + + /** + * Sets blik_code + * + * @param string|null $blik_code BLIK code consisting of 6 digits. + * + * @return self + */ + public function setBlikCode($blik_code) + { + if (is_null($blik_code)) { + throw new \InvalidArgumentException('non-nullable blik_code cannot be null'); + } + $this->container['blik_code'] = $blik_code; + + return $this; + } + + /** + * Gets brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand Secondary brand of the card. For example: **plastix**, **hmclub**. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets cupsecureplus_smscode + * + * @return string|null + * @deprecated + */ + public function getCupsecureplusSmscode() + { + return $this->container['cupsecureplus_smscode']; + } + + /** + * Sets cupsecureplus_smscode + * + * @param string|null $cupsecureplus_smscode cupsecureplus_smscode + * + * @return self + * @deprecated + */ + public function setCupsecureplusSmscode($cupsecureplus_smscode) + { + if (is_null($cupsecureplus_smscode)) { + throw new \InvalidArgumentException('non-nullable cupsecureplus_smscode cannot be null'); + } + $this->container['cupsecureplus_smscode'] = $cupsecureplus_smscode; + + return $this; + } + + /** + * Gets cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets encrypted_card_number + * + * @return string|null + */ + public function getEncryptedCardNumber() + { + return $this->container['encrypted_card_number']; + } + + /** + * Sets encrypted_card_number + * + * @param string|null $encrypted_card_number The encrypted card number. + * + * @return self + */ + public function setEncryptedCardNumber($encrypted_card_number) + { + if (is_null($encrypted_card_number)) { + throw new \InvalidArgumentException('non-nullable encrypted_card_number cannot be null'); + } + $this->container['encrypted_card_number'] = $encrypted_card_number; + + return $this; + } + + /** + * Gets encrypted_expiry_month + * + * @return string|null + */ + public function getEncryptedExpiryMonth() + { + return $this->container['encrypted_expiry_month']; + } + + /** + * Sets encrypted_expiry_month + * + * @param string|null $encrypted_expiry_month The encrypted card expiry month. + * + * @return self + */ + public function setEncryptedExpiryMonth($encrypted_expiry_month) + { + if (is_null($encrypted_expiry_month)) { + throw new \InvalidArgumentException('non-nullable encrypted_expiry_month cannot be null'); + } + $this->container['encrypted_expiry_month'] = $encrypted_expiry_month; + + return $this; + } + + /** + * Gets encrypted_expiry_year + * + * @return string|null + */ + public function getEncryptedExpiryYear() + { + return $this->container['encrypted_expiry_year']; + } + + /** + * Sets encrypted_expiry_year + * + * @param string|null $encrypted_expiry_year The encrypted card expiry year. + * + * @return self + */ + public function setEncryptedExpiryYear($encrypted_expiry_year) + { + if (is_null($encrypted_expiry_year)) { + throw new \InvalidArgumentException('non-nullable encrypted_expiry_year cannot be null'); + } + $this->container['encrypted_expiry_year'] = $encrypted_expiry_year; + + return $this; + } + + /** + * Gets encrypted_security_code + * + * @return string|null + */ + public function getEncryptedSecurityCode() + { + return $this->container['encrypted_security_code']; + } + + /** + * Sets encrypted_security_code + * + * @param string|null $encrypted_security_code The encrypted card verification code. + * + * @return self + */ + public function setEncryptedSecurityCode($encrypted_security_code) + { + if (is_null($encrypted_security_code)) { + throw new \InvalidArgumentException('non-nullable encrypted_security_code cannot be null'); + } + $this->container['encrypted_security_code'] = $encrypted_security_code; + + return $this; + } + + /** + * Gets expiry_month + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiry_month']; + } + + /** + * Sets expiry_month + * + * @param string|null $expiry_month The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setExpiryMonth($expiry_month) + { + if (is_null($expiry_month)) { + throw new \InvalidArgumentException('non-nullable expiry_month cannot be null'); + } + $this->container['expiry_month'] = $expiry_month; + + return $this; + } + + /** + * Gets expiry_year + * + * @return string|null + */ + public function getExpiryYear() + { + return $this->container['expiry_year']; + } + + /** + * Sets expiry_year + * + * @param string|null $expiry_year The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setExpiryYear($expiry_year) + { + if (is_null($expiry_year)) { + throw new \InvalidArgumentException('non-nullable expiry_year cannot be null'); + } + $this->container['expiry_year'] = $expiry_year; + + return $this; + } + + /** + * Gets network_payment_reference + * + * @return string|null + */ + public function getNetworkPaymentReference() + { + return $this->container['network_payment_reference']; + } + + /** + * Sets network_payment_reference + * + * @param string|null $network_payment_reference The network token reference. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + * + * @return self + */ + public function setNetworkPaymentReference($network_payment_reference) + { + if (is_null($network_payment_reference)) { + throw new \InvalidArgumentException('non-nullable network_payment_reference cannot be null'); + } + $this->container['network_payment_reference'] = $network_payment_reference; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets shopper_notification_reference + * + * @return string|null + */ + public function getShopperNotificationReference() + { + return $this->container['shopper_notification_reference']; + } + + /** + * Sets shopper_notification_reference + * + * @param string|null $shopper_notification_reference The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. + * + * @return self + */ + public function setShopperNotificationReference($shopper_notification_reference) + { + if (is_null($shopper_notification_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_notification_reference cannot be null'); + } + $this->container['shopper_notification_reference'] = $shopper_notification_reference; + + return $this; + } + + /** + * Gets three_ds2_sdk_version + * + * @return string|null + */ + public function getThreeDs2SdkVersion() + { + return $this->container['three_ds2_sdk_version']; + } + + /** + * Sets three_ds2_sdk_version + * + * @param string|null $three_ds2_sdk_version Version of the 3D Secure 2 mobile SDK. + * + * @return self + */ + public function setThreeDs2SdkVersion($three_ds2_sdk_version) + { + if (is_null($three_ds2_sdk_version)) { + throw new \InvalidArgumentException('non-nullable three_ds2_sdk_version cannot be null'); + } + $this->container['three_ds2_sdk_version'] = $three_ds2_sdk_version; + + return $this; + } + + /** + * Gets first_name + * + * @return string + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string $first_name The shopper's first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string $last_name The shopper's last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string $shopper_email + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string $telephone_number + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets google_pay_token + * + * @return string + */ + public function getGooglePayToken() + { + return $this->container['google_pay_token']; + } + + /** + * Sets google_pay_token + * + * @param string $google_pay_token The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + * + * @return self + */ + public function setGooglePayToken($google_pay_token) + { + if (is_null($google_pay_token)) { + throw new \InvalidArgumentException('non-nullable google_pay_token cannot be null'); + } + $this->container['google_pay_token'] = $google_pay_token; + + return $this; + } + + /** + * Gets masterpass_transaction_id + * + * @return string + */ + public function getMasterpassTransactionId() + { + return $this->container['masterpass_transaction_id']; + } + + /** + * Sets masterpass_transaction_id + * + * @param string $masterpass_transaction_id The Masterpass transaction ID. + * + * @return self + */ + public function setMasterpassTransactionId($masterpass_transaction_id) + { + if (is_null($masterpass_transaction_id)) { + throw new \InvalidArgumentException('non-nullable masterpass_transaction_id cannot be null'); + } + $this->container['masterpass_transaction_id'] = $masterpass_transaction_id; + + return $this; + } + + /** + * Gets order_id + * + * @return string|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string|null $order_id The unique ID associated with the order. + * + * @return self + */ + public function setOrderId($order_id) + { + if (is_null($order_id)) { + throw new \InvalidArgumentException('non-nullable order_id cannot be null'); + } + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets payer_id + * + * @return string|null + */ + public function getPayerId() + { + return $this->container['payer_id']; + } + + /** + * Sets payer_id + * + * @param string|null $payer_id The unique ID associated with the payer. + * + * @return self + */ + public function setPayerId($payer_id) + { + if (is_null($payer_id)) { + throw new \InvalidArgumentException('non-nullable payer_id cannot be null'); + } + $this->container['payer_id'] = $payer_id; + + return $this; + } + + /** + * Gets subtype + * + * @return string|null + */ + public function getSubtype() + { + return $this->container['subtype']; + } + + /** + * Sets subtype + * + * @param string|null $subtype The type of flow to initiate. + * + * @return self + */ + public function setSubtype($subtype) + { + if (is_null($subtype)) { + throw new \InvalidArgumentException('non-nullable subtype cannot be null'); + } + $this->container['subtype'] = $subtype; + + return $this; + } + + /** + * Gets virtual_payment_address + * + * @return string|null + */ + public function getVirtualPaymentAddress() + { + return $this->container['virtual_payment_address']; + } + + /** + * Sets virtual_payment_address + * + * @param string|null $virtual_payment_address The virtual payment address for UPI. + * + * @return self + */ + public function setVirtualPaymentAddress($virtual_payment_address) + { + if (is_null($virtual_payment_address)) { + throw new \InvalidArgumentException('non-nullable virtual_payment_address cannot be null'); + } + $this->container['virtual_payment_address'] = $virtual_payment_address; + + return $this; + } + + /** + * Gets samsung_pay_token + * + * @return string + */ + public function getSamsungPayToken() + { + return $this->container['samsung_pay_token']; + } + + /** + * Sets samsung_pay_token + * + * @param string $samsung_pay_token The payload you received from the Samsung Pay SDK response. + * + * @return self + */ + public function setSamsungPayToken($samsung_pay_token) + { + if (is_null($samsung_pay_token)) { + throw new \InvalidArgumentException('non-nullable samsung_pay_token cannot be null'); + } + $this->container['samsung_pay_token'] = $samsung_pay_token; + + return $this; + } + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The International Bank Account Number (IBAN). + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets billing_sequence_number + * + * @return string + */ + public function getBillingSequenceNumber() + { + return $this->container['billing_sequence_number']; + } + + /** + * Sets billing_sequence_number + * + * @param string $billing_sequence_number The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. + * + * @return self + */ + public function setBillingSequenceNumber($billing_sequence_number) + { + if (is_null($billing_sequence_number)) { + throw new \InvalidArgumentException('non-nullable billing_sequence_number cannot be null'); + } + $this->container['billing_sequence_number'] = $billing_sequence_number; + + return $this; + } + + /** + * Gets visa_checkout_call_id + * + * @return string + */ + public function getVisaCheckoutCallId() + { + return $this->container['visa_checkout_call_id']; + } + + /** + * Sets visa_checkout_call_id + * + * @param string $visa_checkout_call_id The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. + * + * @return self + */ + public function setVisaCheckoutCallId($visa_checkout_call_id) + { + if (is_null($visa_checkout_call_id)) { + throw new \InvalidArgumentException('non-nullable visa_checkout_call_id cannot be null'); + } + $this->container['visa_checkout_call_id'] = $visa_checkout_call_id; + + return $this; + } + + /** + * Gets app_id + * + * @return string|null + */ + public function getAppId() + { + return $this->container['app_id']; + } + + /** + * Sets app_id + * + * @param string|null $app_id app_id + * + * @return self + */ + public function setAppId($app_id) + { + if (is_null($app_id)) { + throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + } + $this->container['app_id'] = $app_id; + + return $this; + } + + /** + * Gets openid + * + * @return string|null + */ + public function getOpenid() + { + return $this->container['openid']; + } + + /** + * Sets openid + * + * @param string|null $openid openid + * + * @return self + */ + public function setOpenid($openid) + { + if (is_null($openid)) { + throw new \InvalidArgumentException('non-nullable openid cannot be null'); + } + $this->container['openid'] = $openid; + + return $this; + } + + /** + * Gets click_and_collect + * + * @return string|null + */ + public function getClickAndCollect() + { + return $this->container['click_and_collect']; + } + + /** + * Sets click_and_collect + * + * @param string|null $click_and_collect Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. + * + * @return self + */ + public function setClickAndCollect($click_and_collect) + { + if (is_null($click_and_collect)) { + throw new \InvalidArgumentException('non-nullable click_and_collect cannot be null'); + } + $this->container['click_and_collect'] = $click_and_collect; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutQrCodeAction.php b/src/Adyen/Model/Checkout/CheckoutQrCodeAction.php new file mode 100644 index 000000000..181e648f5 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutQrCodeAction.php @@ -0,0 +1,591 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutQrCodeAction Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutQrCodeAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutQrCodeAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'expires_at' => 'string', + 'payment_data' => 'string', + 'payment_method_type' => 'string', + 'qr_code_data' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'expires_at' => null, + 'payment_data' => null, + 'payment_method_type' => null, + 'qr_code_data' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'expires_at' => false, + 'payment_data' => false, + 'payment_method_type' => false, + 'qr_code_data' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'expires_at' => 'expiresAt', + 'payment_data' => 'paymentData', + 'payment_method_type' => 'paymentMethodType', + 'qr_code_data' => 'qrCodeData', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'expires_at' => 'setExpiresAt', + 'payment_data' => 'setPaymentData', + 'payment_method_type' => 'setPaymentMethodType', + 'qr_code_data' => 'setQrCodeData', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'expires_at' => 'getExpiresAt', + 'payment_data' => 'getPaymentData', + 'payment_method_type' => 'getPaymentMethodType', + 'qr_code_data' => 'getQrCodeData', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_QR_CODE = 'qrCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_QR_CODE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('payment_data', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('qr_code_data', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets expires_at + * + * @return string|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string|null $expires_at Expiry time of the QR code. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets payment_data + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['payment_data']; + } + + /** + * Sets payment_data + * + * @param string|null $payment_data A value that must be submitted to the `/payments/details` endpoint to verify this payment. + * + * @return self + */ + public function setPaymentData($payment_data) + { + if (is_null($payment_data)) { + throw new \InvalidArgumentException('non-nullable payment_data cannot be null'); + } + $this->container['payment_data'] = $payment_data; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets qr_code_data + * + * @return string|null + */ + public function getQrCodeData() + { + return $this->container['qr_code_data']; + } + + /** + * Sets qr_code_data + * + * @param string|null $qr_code_data The contents of the QR code as a UTF8 string. + * + * @return self + */ + public function setQrCodeData($qr_code_data) + { + if (is_null($qr_code_data)) { + throw new \InvalidArgumentException('non-nullable qr_code_data cannot be null'); + } + $this->container['qr_code_data'] = $qr_code_data; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **qrCode** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutRedirectAction.php b/src/Adyen/Model/Checkout/CheckoutRedirectAction.php new file mode 100644 index 000000000..022ba1c04 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutRedirectAction.php @@ -0,0 +1,557 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutRedirectAction Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutRedirectAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutRedirectAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'array', + 'method' => 'string', + 'payment_method_type' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'method' => null, + 'payment_method_type' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'method' => false, + 'payment_method_type' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'method' => 'method', + 'payment_method_type' => 'paymentMethodType', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'method' => 'setMethod', + 'payment_method_type' => 'setPaymentMethodType', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'method' => 'getMethod', + 'payment_method_type' => 'getPaymentMethodType', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_REDIRECT = 'redirect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_REDIRECT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return array|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param array|null $data When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets method + * + * @return string|null + */ + public function getMethod() + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param string|null $method Specifies the HTTP method, for example GET or POST. + * + * @return self + */ + public function setMethod($method) + { + if (is_null($method)) { + throw new \InvalidArgumentException('non-nullable method cannot be null'); + } + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **redirect** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutSDKAction.php b/src/Adyen/Model/Checkout/CheckoutSDKAction.php new file mode 100644 index 000000000..2d64e9c9e --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutSDKAction.php @@ -0,0 +1,559 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutSDKAction Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutSDKAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutSDKAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_data' => 'string', + 'payment_method_type' => 'string', + 'sdk_data' => 'array', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_data' => null, + 'payment_method_type' => null, + 'sdk_data' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_data' => false, + 'payment_method_type' => false, + 'sdk_data' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_data' => 'paymentData', + 'payment_method_type' => 'paymentMethodType', + 'sdk_data' => 'sdkData', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_data' => 'setPaymentData', + 'payment_method_type' => 'setPaymentMethodType', + 'sdk_data' => 'setSdkData', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_data' => 'getPaymentData', + 'payment_method_type' => 'getPaymentMethodType', + 'sdk_data' => 'getSdkData', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SDK = 'sdk'; + public const TYPE_WECHATPAY_SDK = 'wechatpaySDK'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SDK, + self::TYPE_WECHATPAY_SDK, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_data', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('sdk_data', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_data + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['payment_data']; + } + + /** + * Sets payment_data + * + * @param string|null $payment_data A value that must be submitted to the `/payments/details` endpoint to verify this payment. + * + * @return self + */ + public function setPaymentData($payment_data) + { + if (is_null($payment_data)) { + throw new \InvalidArgumentException('non-nullable payment_data cannot be null'); + } + $this->container['payment_data'] = $payment_data; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets sdk_data + * + * @return array|null + */ + public function getSdkData() + { + return $this->container['sdk_data']; + } + + /** + * Sets sdk_data + * + * @param array|null $sdk_data The data to pass to the SDK. + * + * @return self + */ + public function setSdkData($sdk_data) + { + if (is_null($sdk_data)) { + throw new \InvalidArgumentException('non-nullable sdk_data cannot be null'); + } + $this->container['sdk_data'] = $sdk_data; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of the action. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php b/src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php new file mode 100644 index 000000000..9241ae70f --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.php @@ -0,0 +1,476 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutSessionInstallmentOption Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutSessionInstallmentOption implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutSessionInstallmentOption'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plans' => 'string[]', + 'preselected_value' => 'int', + 'values' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plans' => null, + 'preselected_value' => 'int32', + 'values' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'plans' => false, + 'preselected_value' => true, + 'values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plans' => 'plans', + 'preselected_value' => 'preselectedValue', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plans' => 'setPlans', + 'preselected_value' => 'setPreselectedValue', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plans' => 'getPlans', + 'preselected_value' => 'getPreselectedValue', + 'values' => 'getValues' + ]; + + /** + * 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 PLANS_REGULAR = 'regular'; + public const PLANS_REVOLVING = 'revolving'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPlansAllowableValues() + { + return [ + self::PLANS_REGULAR, + self::PLANS_REVOLVING, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('plans', $data ?? [], null); + $this->setIfExists('preselected_value', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plans + * + * @return string[]|null + */ + public function getPlans() + { + return $this->container['plans']; + } + + /** + * Sets plans + * + * @param string[]|null $plans Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + * + * @return self + */ + public function setPlans($plans) + { + if (is_null($plans)) { + throw new \InvalidArgumentException('non-nullable plans cannot be null'); + } + $allowedValues = $this->getPlansAllowableValues(); + if (array_diff($plans, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'plans', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['plans'] = $plans; + + return $this; + } + + /** + * Gets preselected_value + * + * @return int|null + */ + public function getPreselectedValue() + { + return $this->container['preselected_value']; + } + + /** + * Sets preselected_value + * + * @param int|null $preselected_value Preselected number of installments offered for this payment method. + * + * @return self + */ + public function setPreselectedValue($preselected_value) + { + // Do nothing for nullable integers + $this->container['preselected_value'] = $preselected_value; + + return $this; + } + + /** + * Gets values + * + * @return int[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param int[]|null $values An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php b/src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php new file mode 100644 index 000000000..11dd725d2 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutThreeDS2Action.php @@ -0,0 +1,625 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutThreeDS2Action Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutThreeDS2Action implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutThreeDS2Action'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorisation_token' => 'string', + 'payment_data' => 'string', + 'payment_method_type' => 'string', + 'subtype' => 'string', + 'token' => 'string', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorisation_token' => null, + 'payment_data' => null, + 'payment_method_type' => null, + 'subtype' => null, + 'token' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorisation_token' => false, + 'payment_data' => false, + 'payment_method_type' => false, + 'subtype' => false, + 'token' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authorisation_token' => 'authorisationToken', + 'payment_data' => 'paymentData', + 'payment_method_type' => 'paymentMethodType', + 'subtype' => 'subtype', + 'token' => 'token', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorisation_token' => 'setAuthorisationToken', + 'payment_data' => 'setPaymentData', + 'payment_method_type' => 'setPaymentMethodType', + 'subtype' => 'setSubtype', + 'token' => 'setToken', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorisation_token' => 'getAuthorisationToken', + 'payment_data' => 'getPaymentData', + 'payment_method_type' => 'getPaymentMethodType', + 'subtype' => 'getSubtype', + 'token' => 'getToken', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_THREE_DS2 = 'threeDS2'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_THREE_DS2, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authorisation_token', $data ?? [], null); + $this->setIfExists('payment_data', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authorisation_token + * + * @return string|null + */ + public function getAuthorisationToken() + { + return $this->container['authorisation_token']; + } + + /** + * Sets authorisation_token + * + * @param string|null $authorisation_token A token needed to authorise a payment. + * + * @return self + */ + public function setAuthorisationToken($authorisation_token) + { + if (is_null($authorisation_token)) { + throw new \InvalidArgumentException('non-nullable authorisation_token cannot be null'); + } + $this->container['authorisation_token'] = $authorisation_token; + + return $this; + } + + /** + * Gets payment_data + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['payment_data']; + } + + /** + * Sets payment_data + * + * @param string|null $payment_data A value that must be submitted to the `/payments/details` endpoint to verify this payment. + * + * @return self + */ + public function setPaymentData($payment_data) + { + if (is_null($payment_data)) { + throw new \InvalidArgumentException('non-nullable payment_data cannot be null'); + } + $this->container['payment_data'] = $payment_data; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets subtype + * + * @return string|null + */ + public function getSubtype() + { + return $this->container['subtype']; + } + + /** + * Sets subtype + * + * @param string|null $subtype A subtype of the token. + * + * @return self + */ + public function setSubtype($subtype) + { + if (is_null($subtype)) { + throw new \InvalidArgumentException('non-nullable subtype cannot be null'); + } + $this->container['subtype'] = $subtype; + + return $this; + } + + /** + * Gets token + * + * @return string|null + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string|null $token A token to pass to the 3DS2 Component to get the fingerprint. + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **threeDS2** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutUtilityRequest.php b/src/Adyen/Model/Checkout/CheckoutUtilityRequest.php new file mode 100644 index 000000000..a686cddc6 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutUtilityRequest.php @@ -0,0 +1,390 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutUtilityRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutUtilityRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutUtilityRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'origin_domains' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'origin_domains' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'origin_domains' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'origin_domains' => 'originDomains' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'origin_domains' => 'setOriginDomains' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'origin_domains' => 'getOriginDomains' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('origin_domains', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['origin_domains'] === null) { + $invalidProperties[] = "'origin_domains' 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 origin_domains + * + * @return string[] + */ + public function getOriginDomains() + { + return $this->container['origin_domains']; + } + + /** + * Sets origin_domains + * + * @param string[] $origin_domains The list of origin domains, for which origin keys are requested. + * + * @return self + */ + public function setOriginDomains($origin_domains) + { + if (is_null($origin_domains)) { + throw new \InvalidArgumentException('non-nullable origin_domains cannot be null'); + } + $this->container['origin_domains'] = $origin_domains; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutUtilityResponse.php b/src/Adyen/Model/Checkout/CheckoutUtilityResponse.php new file mode 100644 index 000000000..4f1db8de0 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutUtilityResponse.php @@ -0,0 +1,387 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutUtilityResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutUtilityResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutUtilityResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'origin_keys' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'origin_keys' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'origin_keys' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'origin_keys' => 'originKeys' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'origin_keys' => 'setOriginKeys' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'origin_keys' => 'getOriginKeys' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('origin_keys', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets origin_keys + * + * @return array|null + */ + public function getOriginKeys() + { + return $this->container['origin_keys']; + } + + /** + * Sets origin_keys + * + * @param array|null $origin_keys The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. + * + * @return self + */ + public function setOriginKeys($origin_keys) + { + if (is_null($origin_keys)) { + throw new \InvalidArgumentException('non-nullable origin_keys cannot be null'); + } + $this->container['origin_keys'] = $origin_keys; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CheckoutVoucherAction.php b/src/Adyen/Model/Checkout/CheckoutVoucherAction.php new file mode 100644 index 000000000..e77bf9546 --- /dev/null +++ b/src/Adyen/Model/Checkout/CheckoutVoucherAction.php @@ -0,0 +1,1067 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CheckoutVoucherAction Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CheckoutVoucherAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CheckoutVoucherAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'alternative_reference' => 'string', + 'collection_institution_number' => 'string', + 'download_url' => 'string', + 'entity' => 'string', + 'expires_at' => 'string', + 'initial_amount' => '\Adyen\Model\Checkout\Amount', + 'instructions_url' => 'string', + 'issuer' => 'string', + 'masked_telephone_number' => 'string', + 'merchant_name' => 'string', + 'merchant_reference' => 'string', + 'payment_data' => 'string', + 'payment_method_type' => 'string', + 'reference' => 'string', + 'shopper_email' => 'string', + 'shopper_name' => 'string', + 'surcharge' => '\Adyen\Model\Checkout\Amount', + 'total_amount' => '\Adyen\Model\Checkout\Amount', + 'type' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'alternative_reference' => null, + 'collection_institution_number' => null, + 'download_url' => null, + 'entity' => null, + 'expires_at' => null, + 'initial_amount' => null, + 'instructions_url' => null, + 'issuer' => null, + 'masked_telephone_number' => null, + 'merchant_name' => null, + 'merchant_reference' => null, + 'payment_data' => null, + 'payment_method_type' => null, + 'reference' => null, + 'shopper_email' => null, + 'shopper_name' => null, + 'surcharge' => null, + 'total_amount' => null, + 'type' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'alternative_reference' => false, + 'collection_institution_number' => false, + 'download_url' => false, + 'entity' => false, + 'expires_at' => false, + 'initial_amount' => false, + 'instructions_url' => false, + 'issuer' => false, + 'masked_telephone_number' => false, + 'merchant_name' => false, + 'merchant_reference' => false, + 'payment_data' => false, + 'payment_method_type' => false, + 'reference' => false, + 'shopper_email' => false, + 'shopper_name' => false, + 'surcharge' => false, + 'total_amount' => false, + 'type' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'alternative_reference' => 'alternativeReference', + 'collection_institution_number' => 'collectionInstitutionNumber', + 'download_url' => 'downloadUrl', + 'entity' => 'entity', + 'expires_at' => 'expiresAt', + 'initial_amount' => 'initialAmount', + 'instructions_url' => 'instructionsUrl', + 'issuer' => 'issuer', + 'masked_telephone_number' => 'maskedTelephoneNumber', + 'merchant_name' => 'merchantName', + 'merchant_reference' => 'merchantReference', + 'payment_data' => 'paymentData', + 'payment_method_type' => 'paymentMethodType', + 'reference' => 'reference', + 'shopper_email' => 'shopperEmail', + 'shopper_name' => 'shopperName', + 'surcharge' => 'surcharge', + 'total_amount' => 'totalAmount', + 'type' => 'type', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'alternative_reference' => 'setAlternativeReference', + 'collection_institution_number' => 'setCollectionInstitutionNumber', + 'download_url' => 'setDownloadUrl', + 'entity' => 'setEntity', + 'expires_at' => 'setExpiresAt', + 'initial_amount' => 'setInitialAmount', + 'instructions_url' => 'setInstructionsUrl', + 'issuer' => 'setIssuer', + 'masked_telephone_number' => 'setMaskedTelephoneNumber', + 'merchant_name' => 'setMerchantName', + 'merchant_reference' => 'setMerchantReference', + 'payment_data' => 'setPaymentData', + 'payment_method_type' => 'setPaymentMethodType', + 'reference' => 'setReference', + 'shopper_email' => 'setShopperEmail', + 'shopper_name' => 'setShopperName', + 'surcharge' => 'setSurcharge', + 'total_amount' => 'setTotalAmount', + 'type' => 'setType', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'alternative_reference' => 'getAlternativeReference', + 'collection_institution_number' => 'getCollectionInstitutionNumber', + 'download_url' => 'getDownloadUrl', + 'entity' => 'getEntity', + 'expires_at' => 'getExpiresAt', + 'initial_amount' => 'getInitialAmount', + 'instructions_url' => 'getInstructionsUrl', + 'issuer' => 'getIssuer', + 'masked_telephone_number' => 'getMaskedTelephoneNumber', + 'merchant_name' => 'getMerchantName', + 'merchant_reference' => 'getMerchantReference', + 'payment_data' => 'getPaymentData', + 'payment_method_type' => 'getPaymentMethodType', + 'reference' => 'getReference', + 'shopper_email' => 'getShopperEmail', + 'shopper_name' => 'getShopperName', + 'surcharge' => 'getSurcharge', + 'total_amount' => 'getTotalAmount', + 'type' => 'getType', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_VOUCHER = 'voucher'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_VOUCHER, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('alternative_reference', $data ?? [], null); + $this->setIfExists('collection_institution_number', $data ?? [], null); + $this->setIfExists('download_url', $data ?? [], null); + $this->setIfExists('entity', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('initial_amount', $data ?? [], null); + $this->setIfExists('instructions_url', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('masked_telephone_number', $data ?? [], null); + $this->setIfExists('merchant_name', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('payment_data', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('surcharge', $data ?? [], null); + $this->setIfExists('total_amount', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets alternative_reference + * + * @return string|null + */ + public function getAlternativeReference() + { + return $this->container['alternative_reference']; + } + + /** + * Sets alternative_reference + * + * @param string|null $alternative_reference The voucher alternative reference code. + * + * @return self + */ + public function setAlternativeReference($alternative_reference) + { + if (is_null($alternative_reference)) { + throw new \InvalidArgumentException('non-nullable alternative_reference cannot be null'); + } + $this->container['alternative_reference'] = $alternative_reference; + + return $this; + } + + /** + * Gets collection_institution_number + * + * @return string|null + */ + public function getCollectionInstitutionNumber() + { + return $this->container['collection_institution_number']; + } + + /** + * Sets collection_institution_number + * + * @param string|null $collection_institution_number A collection institution number (store number) for Econtext Pay-Easy ATM. + * + * @return self + */ + public function setCollectionInstitutionNumber($collection_institution_number) + { + if (is_null($collection_institution_number)) { + throw new \InvalidArgumentException('non-nullable collection_institution_number cannot be null'); + } + $this->container['collection_institution_number'] = $collection_institution_number; + + return $this; + } + + /** + * Gets download_url + * + * @return string|null + */ + public function getDownloadUrl() + { + return $this->container['download_url']; + } + + /** + * Sets download_url + * + * @param string|null $download_url The URL to download the voucher. + * + * @return self + */ + public function setDownloadUrl($download_url) + { + if (is_null($download_url)) { + throw new \InvalidArgumentException('non-nullable download_url cannot be null'); + } + $this->container['download_url'] = $download_url; + + return $this; + } + + /** + * Gets entity + * + * @return string|null + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param string|null $entity An entity number of Multibanco. + * + * @return self + */ + public function setEntity($entity) + { + if (is_null($entity)) { + throw new \InvalidArgumentException('non-nullable entity cannot be null'); + } + $this->container['entity'] = $entity; + + return $this; + } + + /** + * Gets expires_at + * + * @return string|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string|null $expires_at The date time of the voucher expiry. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets initial_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getInitialAmount() + { + return $this->container['initial_amount']; + } + + /** + * Sets initial_amount + * + * @param \Adyen\Model\Checkout\Amount|null $initial_amount initial_amount + * + * @return self + */ + public function setInitialAmount($initial_amount) + { + if (is_null($initial_amount)) { + throw new \InvalidArgumentException('non-nullable initial_amount cannot be null'); + } + $this->container['initial_amount'] = $initial_amount; + + return $this; + } + + /** + * Gets instructions_url + * + * @return string|null + */ + public function getInstructionsUrl() + { + return $this->container['instructions_url']; + } + + /** + * Sets instructions_url + * + * @param string|null $instructions_url The URL to the detailed instructions to make payment using the voucher. + * + * @return self + */ + public function setInstructionsUrl($instructions_url) + { + if (is_null($instructions_url)) { + throw new \InvalidArgumentException('non-nullable instructions_url cannot be null'); + } + $this->container['instructions_url'] = $instructions_url; + + return $this; + } + + /** + * Gets issuer + * + * @return string|null + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string|null $issuer The issuer of the voucher. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets masked_telephone_number + * + * @return string|null + */ + public function getMaskedTelephoneNumber() + { + return $this->container['masked_telephone_number']; + } + + /** + * Sets masked_telephone_number + * + * @param string|null $masked_telephone_number The shopper telephone number (partially masked). + * + * @return self + */ + public function setMaskedTelephoneNumber($masked_telephone_number) + { + if (is_null($masked_telephone_number)) { + throw new \InvalidArgumentException('non-nullable masked_telephone_number cannot be null'); + } + $this->container['masked_telephone_number'] = $masked_telephone_number; + + return $this; + } + + /** + * Gets merchant_name + * + * @return string|null + */ + public function getMerchantName() + { + return $this->container['merchant_name']; + } + + /** + * Sets merchant_name + * + * @param string|null $merchant_name The merchant name. + * + * @return self + */ + public function setMerchantName($merchant_name) + { + if (is_null($merchant_name)) { + throw new \InvalidArgumentException('non-nullable merchant_name cannot be null'); + } + $this->container['merchant_name'] = $merchant_name; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string|null + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string|null $merchant_reference The merchant reference. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets payment_data + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['payment_data']; + } + + /** + * Sets payment_data + * + * @param string|null $payment_data A value that must be submitted to the `/payments/details` endpoint to verify this payment. + * + * @return self + */ + public function setPaymentData($payment_data) + { + if (is_null($payment_data)) { + throw new \InvalidArgumentException('non-nullable payment_data cannot be null'); + } + $this->container['payment_data'] = $payment_data; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The voucher reference code. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper email. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_name + * + * @return string|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param string|null $shopper_name The shopper name. + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets surcharge + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getSurcharge() + { + return $this->container['surcharge']; + } + + /** + * Sets surcharge + * + * @param \Adyen\Model\Checkout\Amount|null $surcharge surcharge + * + * @return self + */ + public function setSurcharge($surcharge) + { + if (is_null($surcharge)) { + throw new \InvalidArgumentException('non-nullable surcharge cannot be null'); + } + $this->container['surcharge'] = $surcharge; + + return $this; + } + + /** + * Gets total_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getTotalAmount() + { + return $this->container['total_amount']; + } + + /** + * Sets total_amount + * + * @param \Adyen\Model\Checkout\Amount|null $total_amount total_amount + * + * @return self + */ + public function setTotalAmount($total_amount) + { + if (is_null($total_amount)) { + throw new \InvalidArgumentException('non-nullable total_amount cannot be null'); + } + $this->container['total_amount'] = $total_amount; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **voucher** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CommonField.php b/src/Adyen/Model/Checkout/CommonField.php new file mode 100644 index 000000000..1bad086fb --- /dev/null +++ b/src/Adyen/Model/Checkout/CommonField.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CommonField Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CommonField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CommonField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the field. For example, Name of External Platform. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version Version of the field. For example, Version of External Platform. + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Company.php b/src/Adyen/Model/Checkout/Company.php new file mode 100644 index 000000000..183efeec2 --- /dev/null +++ b/src/Adyen/Model/Checkout/Company.php @@ -0,0 +1,557 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Company Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Company implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Company'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'homepage' => 'string', + 'name' => 'string', + 'registration_number' => 'string', + 'registry_location' => 'string', + 'tax_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'homepage' => null, + 'name' => null, + 'registration_number' => null, + 'registry_location' => null, + 'tax_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'homepage' => false, + 'name' => false, + 'registration_number' => false, + 'registry_location' => false, + 'tax_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'homepage' => 'homepage', + 'name' => 'name', + 'registration_number' => 'registrationNumber', + 'registry_location' => 'registryLocation', + 'tax_id' => 'taxId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'homepage' => 'setHomepage', + 'name' => 'setName', + 'registration_number' => 'setRegistrationNumber', + 'registry_location' => 'setRegistryLocation', + 'tax_id' => 'setTaxId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'homepage' => 'getHomepage', + 'name' => 'getName', + 'registration_number' => 'getRegistrationNumber', + 'registry_location' => 'getRegistryLocation', + 'tax_id' => 'getTaxId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('homepage', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('registration_number', $data ?? [], null); + $this->setIfExists('registry_location', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets homepage + * + * @return string|null + */ + public function getHomepage() + { + return $this->container['homepage']; + } + + /** + * Sets homepage + * + * @param string|null $homepage The company website's home page. + * + * @return self + */ + public function setHomepage($homepage) + { + if (is_null($homepage)) { + throw new \InvalidArgumentException('non-nullable homepage cannot be null'); + } + $this->container['homepage'] = $homepage; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The company name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets registration_number + * + * @return string|null + */ + public function getRegistrationNumber() + { + return $this->container['registration_number']; + } + + /** + * Sets registration_number + * + * @param string|null $registration_number Registration number of the company. + * + * @return self + */ + public function setRegistrationNumber($registration_number) + { + if (is_null($registration_number)) { + throw new \InvalidArgumentException('non-nullable registration_number cannot be null'); + } + $this->container['registration_number'] = $registration_number; + + return $this; + } + + /** + * Gets registry_location + * + * @return string|null + */ + public function getRegistryLocation() + { + return $this->container['registry_location']; + } + + /** + * Sets registry_location + * + * @param string|null $registry_location Registry location of the company. + * + * @return self + */ + public function setRegistryLocation($registry_location) + { + if (is_null($registry_location)) { + throw new \InvalidArgumentException('non-nullable registry_location cannot be null'); + } + $this->container['registry_location'] = $registry_location; + + return $this; + } + + /** + * Gets tax_id + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param string|null $tax_id Tax ID of the company. + * + * @return self + */ + public function setTaxId($tax_id) + { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } + $this->container['tax_id'] = $tax_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The company type. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Configuration.php b/src/Adyen/Model/Checkout/Configuration.php new file mode 100644 index 000000000..c483bd45f --- /dev/null +++ b/src/Adyen/Model/Checkout/Configuration.php @@ -0,0 +1,524 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Configuration Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Configuration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'avs' => '\Adyen\Model\Checkout\Avs', + 'card_holder_name' => 'string', + 'installments' => '\Adyen\Model\Checkout\InstallmentsNumber', + 'shopper_input' => '\Adyen\Model\Checkout\ShopperInput' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'avs' => null, + 'card_holder_name' => null, + 'installments' => null, + 'shopper_input' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'avs' => false, + 'card_holder_name' => false, + 'installments' => false, + 'shopper_input' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'avs' => 'avs', + 'card_holder_name' => 'cardHolderName', + 'installments' => 'installments', + 'shopper_input' => 'shopperInput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'avs' => 'setAvs', + 'card_holder_name' => 'setCardHolderName', + 'installments' => 'setInstallments', + 'shopper_input' => 'setShopperInput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'avs' => 'getAvs', + 'card_holder_name' => 'getCardHolderName', + 'installments' => 'getInstallments', + 'shopper_input' => 'getShopperInput' + ]; + + /** + * 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 CARD_HOLDER_NAME_NONE = 'NONE'; + public const CARD_HOLDER_NAME_OPTIONAL = 'OPTIONAL'; + public const CARD_HOLDER_NAME_REQUIRED = 'REQUIRED'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCardHolderNameAllowableValues() + { + return [ + self::CARD_HOLDER_NAME_NONE, + self::CARD_HOLDER_NAME_OPTIONAL, + self::CARD_HOLDER_NAME_REQUIRED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('avs', $data ?? [], null); + $this->setIfExists('card_holder_name', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('shopper_input', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCardHolderNameAllowableValues(); + if (!is_null($this->container['card_holder_name']) && !in_array($this->container['card_holder_name'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'card_holder_name', must be one of '%s'", + $this->container['card_holder_name'], + 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 avs + * + * @return \Adyen\Model\Checkout\Avs|null + */ + public function getAvs() + { + return $this->container['avs']; + } + + /** + * Sets avs + * + * @param \Adyen\Model\Checkout\Avs|null $avs avs + * + * @return self + */ + public function setAvs($avs) + { + if (is_null($avs)) { + throw new \InvalidArgumentException('non-nullable avs cannot be null'); + } + $this->container['avs'] = $avs; + + return $this; + } + + /** + * Gets card_holder_name + * + * @return string|null + */ + public function getCardHolderName() + { + return $this->container['card_holder_name']; + } + + /** + * Sets card_holder_name + * + * @param string|null $card_holder_name Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED + * + * @return self + */ + public function setCardHolderName($card_holder_name) + { + if (is_null($card_holder_name)) { + throw new \InvalidArgumentException('non-nullable card_holder_name cannot be null'); + } + $allowedValues = $this->getCardHolderNameAllowableValues(); + if (!in_array($card_holder_name, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'card_holder_name', must be one of '%s'", + $card_holder_name, + implode("', '", $allowedValues) + ) + ); + } + $this->container['card_holder_name'] = $card_holder_name; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Checkout\InstallmentsNumber|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Checkout\InstallmentsNumber|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets shopper_input + * + * @return \Adyen\Model\Checkout\ShopperInput|null + */ + public function getShopperInput() + { + return $this->container['shopper_input']; + } + + /** + * Sets shopper_input + * + * @param \Adyen\Model\Checkout\ShopperInput|null $shopper_input shopper_input + * + * @return self + */ + public function setShopperInput($shopper_input) + { + if (is_null($shopper_input)) { + throw new \InvalidArgumentException('non-nullable shopper_input cannot be null'); + } + $this->container['shopper_input'] = $shopper_input; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreateApplePaySessionRequest.php b/src/Adyen/Model/Checkout/CreateApplePaySessionRequest.php new file mode 100644 index 000000000..88f66a412 --- /dev/null +++ b/src/Adyen/Model/Checkout/CreateApplePaySessionRequest.php @@ -0,0 +1,464 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreateApplePaySessionRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreateApplePaySessionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateApplePaySessionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'display_name' => 'string', + 'domain_name' => 'string', + 'merchant_identifier' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'display_name' => null, + 'domain_name' => null, + 'merchant_identifier' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'display_name' => false, + 'domain_name' => false, + 'merchant_identifier' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'display_name' => 'displayName', + 'domain_name' => 'domainName', + 'merchant_identifier' => 'merchantIdentifier' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'display_name' => 'setDisplayName', + 'domain_name' => 'setDomainName', + 'merchant_identifier' => 'setMerchantIdentifier' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'display_name' => 'getDisplayName', + 'domain_name' => 'getDomainName', + 'merchant_identifier' => 'getMerchantIdentifier' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('domain_name', $data ?? [], null); + $this->setIfExists('merchant_identifier', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['display_name'] === null) { + $invalidProperties[] = "'display_name' can't be null"; + } + if ($this->container['domain_name'] === null) { + $invalidProperties[] = "'domain_name' can't be null"; + } + if ($this->container['merchant_identifier'] === null) { + $invalidProperties[] = "'merchant_identifier' 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 display_name + * + * @return string + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string $display_name This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. + * + * @return self + */ + public function setDisplayName($display_name) + { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } + $this->container['display_name'] = $display_name; + + return $this; + } + + /** + * Gets domain_name + * + * @return string + */ + public function getDomainName() + { + return $this->container['domain_name']; + } + + /** + * Sets domain_name + * + * @param string $domain_name The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. + * + * @return self + */ + public function setDomainName($domain_name) + { + if (is_null($domain_name)) { + throw new \InvalidArgumentException('non-nullable domain_name cannot be null'); + } + $this->container['domain_name'] = $domain_name; + + return $this; + } + + /** + * Gets merchant_identifier + * + * @return string + */ + public function getMerchantIdentifier() + { + return $this->container['merchant_identifier']; + } + + /** + * Sets merchant_identifier + * + * @param string $merchant_identifier Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. + * + * @return self + */ + public function setMerchantIdentifier($merchant_identifier) + { + if (is_null($merchant_identifier)) { + throw new \InvalidArgumentException('non-nullable merchant_identifier cannot be null'); + } + $this->container['merchant_identifier'] = $merchant_identifier; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php new file mode 100644 index 000000000..33276b68b --- /dev/null +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionRequest.php @@ -0,0 +1,2341 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreateCheckoutSessionRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreateCheckoutSessionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateCheckoutSessionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Checkout\AccountInfo', + 'additional_amount' => '\Adyen\Model\Checkout\Amount', + 'additional_data' => 'array', + 'allowed_payment_methods' => 'string[]', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'application_info' => '\Adyen\Model\Checkout\ApplicationInfo', + 'authentication_data' => '\Adyen\Model\Checkout\AuthenticationData', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'blocked_payment_methods' => 'string[]', + 'capture_delay_hours' => 'int', + 'channel' => 'string', + 'company' => '\Adyen\Model\Checkout\Company', + 'country_code' => 'string', + 'date_of_birth' => '\DateTime', + 'deliver_at' => '\DateTime', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'enable_one_click' => 'bool', + 'enable_pay_out' => 'bool', + 'enable_recurring' => 'bool', + 'expires_at' => '\DateTime', + 'fund_origin' => '\Adyen\Model\Checkout\FundOrigin', + 'fund_recipient' => '\Adyen\Model\Checkout\FundRecipient', + 'installment_options' => 'array', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'mandate' => '\Adyen\Model\Checkout\Mandate', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'metadata' => 'array', + 'mpi_data' => '\Adyen\Model\Checkout\ThreeDSecureData', + 'recurring_expiry' => 'string', + 'recurring_frequency' => 'string', + 'recurring_processing_model' => 'string', + 'redirect_from_issuer_method' => 'string', + 'redirect_to_issuer_method' => 'string', + 'reference' => 'string', + 'return_url' => 'string', + 'risk_data' => '\Adyen\Model\Checkout\RiskData', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'split_card_funding_sources' => 'bool', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'store' => 'string', + 'store_payment_method' => 'bool', + 'store_payment_method_mode' => 'string', + 'telephone_number' => 'string', + 'three_ds_authentication_only' => 'bool', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_amount' => null, + 'additional_data' => null, + 'allowed_payment_methods' => null, + 'amount' => null, + 'application_info' => null, + 'authentication_data' => null, + 'billing_address' => null, + 'blocked_payment_methods' => null, + 'capture_delay_hours' => 'int32', + 'channel' => null, + 'company' => null, + 'country_code' => null, + 'date_of_birth' => 'date', + 'deliver_at' => 'date-time', + 'delivery_address' => null, + 'enable_one_click' => null, + 'enable_pay_out' => null, + 'enable_recurring' => null, + 'expires_at' => 'date-time', + 'fund_origin' => null, + 'fund_recipient' => null, + 'installment_options' => null, + 'line_items' => null, + 'mandate' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'metadata' => null, + 'mpi_data' => null, + 'recurring_expiry' => null, + 'recurring_frequency' => null, + 'recurring_processing_model' => null, + 'redirect_from_issuer_method' => null, + 'redirect_to_issuer_method' => null, + 'reference' => null, + 'return_url' => null, + 'risk_data' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'split_card_funding_sources' => null, + 'splits' => null, + 'store' => null, + 'store_payment_method' => null, + 'store_payment_method_mode' => null, + 'telephone_number' => null, + 'three_ds_authentication_only' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_amount' => false, + 'additional_data' => false, + 'allowed_payment_methods' => false, + 'amount' => false, + 'application_info' => false, + 'authentication_data' => false, + 'billing_address' => false, + 'blocked_payment_methods' => false, + 'capture_delay_hours' => true, + 'channel' => false, + 'company' => false, + 'country_code' => false, + 'date_of_birth' => false, + 'deliver_at' => false, + 'delivery_address' => false, + 'enable_one_click' => false, + 'enable_pay_out' => false, + 'enable_recurring' => false, + 'expires_at' => false, + 'fund_origin' => false, + 'fund_recipient' => false, + 'installment_options' => false, + 'line_items' => false, + 'mandate' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'metadata' => false, + 'mpi_data' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'recurring_processing_model' => false, + 'redirect_from_issuer_method' => false, + 'redirect_to_issuer_method' => false, + 'reference' => false, + 'return_url' => false, + 'risk_data' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'split_card_funding_sources' => false, + 'splits' => false, + 'store' => false, + 'store_payment_method' => false, + 'store_payment_method_mode' => false, + 'telephone_number' => false, + 'three_ds_authentication_only' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_amount' => 'additionalAmount', + 'additional_data' => 'additionalData', + 'allowed_payment_methods' => 'allowedPaymentMethods', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'authentication_data' => 'authenticationData', + 'billing_address' => 'billingAddress', + 'blocked_payment_methods' => 'blockedPaymentMethods', + 'capture_delay_hours' => 'captureDelayHours', + 'channel' => 'channel', + 'company' => 'company', + 'country_code' => 'countryCode', + 'date_of_birth' => 'dateOfBirth', + 'deliver_at' => 'deliverAt', + 'delivery_address' => 'deliveryAddress', + 'enable_one_click' => 'enableOneClick', + 'enable_pay_out' => 'enablePayOut', + 'enable_recurring' => 'enableRecurring', + 'expires_at' => 'expiresAt', + 'fund_origin' => 'fundOrigin', + 'fund_recipient' => 'fundRecipient', + 'installment_options' => 'installmentOptions', + 'line_items' => 'lineItems', + 'mandate' => 'mandate', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'metadata' => 'metadata', + 'mpi_data' => 'mpiData', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'recurring_processing_model' => 'recurringProcessingModel', + 'redirect_from_issuer_method' => 'redirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'redirectToIssuerMethod', + 'reference' => 'reference', + 'return_url' => 'returnUrl', + 'risk_data' => 'riskData', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'split_card_funding_sources' => 'splitCardFundingSources', + 'splits' => 'splits', + 'store' => 'store', + 'store_payment_method' => 'storePaymentMethod', + 'store_payment_method_mode' => 'storePaymentMethodMode', + 'telephone_number' => 'telephoneNumber', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_amount' => 'setAdditionalAmount', + 'additional_data' => 'setAdditionalData', + 'allowed_payment_methods' => 'setAllowedPaymentMethods', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'authentication_data' => 'setAuthenticationData', + 'billing_address' => 'setBillingAddress', + 'blocked_payment_methods' => 'setBlockedPaymentMethods', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'channel' => 'setChannel', + 'company' => 'setCompany', + 'country_code' => 'setCountryCode', + 'date_of_birth' => 'setDateOfBirth', + 'deliver_at' => 'setDeliverAt', + 'delivery_address' => 'setDeliveryAddress', + 'enable_one_click' => 'setEnableOneClick', + 'enable_pay_out' => 'setEnablePayOut', + 'enable_recurring' => 'setEnableRecurring', + 'expires_at' => 'setExpiresAt', + 'fund_origin' => 'setFundOrigin', + 'fund_recipient' => 'setFundRecipient', + 'installment_options' => 'setInstallmentOptions', + 'line_items' => 'setLineItems', + 'mandate' => 'setMandate', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'metadata' => 'setMetadata', + 'mpi_data' => 'setMpiData', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'redirect_from_issuer_method' => 'setRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'setRedirectToIssuerMethod', + 'reference' => 'setReference', + 'return_url' => 'setReturnUrl', + 'risk_data' => 'setRiskData', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'split_card_funding_sources' => 'setSplitCardFundingSources', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'store_payment_method' => 'setStorePaymentMethod', + 'store_payment_method_mode' => 'setStorePaymentMethodMode', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_amount' => 'getAdditionalAmount', + 'additional_data' => 'getAdditionalData', + 'allowed_payment_methods' => 'getAllowedPaymentMethods', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'authentication_data' => 'getAuthenticationData', + 'billing_address' => 'getBillingAddress', + 'blocked_payment_methods' => 'getBlockedPaymentMethods', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'channel' => 'getChannel', + 'company' => 'getCompany', + 'country_code' => 'getCountryCode', + 'date_of_birth' => 'getDateOfBirth', + 'deliver_at' => 'getDeliverAt', + 'delivery_address' => 'getDeliveryAddress', + 'enable_one_click' => 'getEnableOneClick', + 'enable_pay_out' => 'getEnablePayOut', + 'enable_recurring' => 'getEnableRecurring', + 'expires_at' => 'getExpiresAt', + 'fund_origin' => 'getFundOrigin', + 'fund_recipient' => 'getFundRecipient', + 'installment_options' => 'getInstallmentOptions', + 'line_items' => 'getLineItems', + 'mandate' => 'getMandate', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'metadata' => 'getMetadata', + 'mpi_data' => 'getMpiData', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'redirect_from_issuer_method' => 'getRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'getRedirectToIssuerMethod', + 'reference' => 'getReference', + 'return_url' => 'getReturnUrl', + 'risk_data' => 'getRiskData', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'split_card_funding_sources' => 'getSplitCardFundingSources', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'store_payment_method' => 'getStorePaymentMethod', + 'store_payment_method_mode' => 'getStorePaymentMethodMode', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHANNEL_I_OS = 'iOS'; + public const CHANNEL_ANDROID = 'Android'; + public const CHANNEL_WEB = 'Web'; + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + public const STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT = 'askForConsent'; + public const STORE_PAYMENT_METHOD_MODE_DISABLED = 'disabled'; + public const STORE_PAYMENT_METHOD_MODE_ENABLED = 'enabled'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChannelAllowableValues() + { + return [ + self::CHANNEL_I_OS, + self::CHANNEL_ANDROID, + self::CHANNEL_WEB, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStorePaymentMethodModeAllowableValues() + { + return [ + self::STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT, + self::STORE_PAYMENT_METHOD_MODE_DISABLED, + self::STORE_PAYMENT_METHOD_MODE_ENABLED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_amount', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('allowed_payment_methods', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('authentication_data', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('blocked_payment_methods', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('deliver_at', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('enable_one_click', $data ?? [], null); + $this->setIfExists('enable_pay_out', $data ?? [], null); + $this->setIfExists('enable_recurring', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('fund_origin', $data ?? [], null); + $this->setIfExists('fund_recipient', $data ?? [], null); + $this->setIfExists('installment_options', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('mandate', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('redirect_from_issuer_method', $data ?? [], null); + $this->setIfExists('redirect_to_issuer_method', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('risk_data', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('split_card_funding_sources', $data ?? [], false); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_payment_method', $data ?? [], null); + $this->setIfExists('store_payment_method_mode', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getChannelAllowableValues(); + if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['return_url'] === null) { + $invalidProperties[] = "'return_url' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!is_null($this->container['store_payment_method_mode']) && !in_array($this->container['store_payment_method_mode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $this->container['store_payment_method_mode'], + 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 account_info + * + * @return \Adyen\Model\Checkout\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Checkout\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additional_amount']; + } + + /** + * Sets additional_amount + * + * @param \Adyen\Model\Checkout\Amount|null $additional_amount additional_amount + * + * @return self + */ + public function setAdditionalAmount($additional_amount) + { + if (is_null($additional_amount)) { + throw new \InvalidArgumentException('non-nullable additional_amount cannot be null'); + } + $this->container['additional_amount'] = $additional_amount; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets allowed_payment_methods + * + * @return string[]|null + */ + public function getAllowedPaymentMethods() + { + return $this->container['allowed_payment_methods']; + } + + /** + * Sets allowed_payment_methods + * + * @param string[]|null $allowed_payment_methods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setAllowedPaymentMethods($allowed_payment_methods) + { + if (is_null($allowed_payment_methods)) { + throw new \InvalidArgumentException('non-nullable allowed_payment_methods cannot be null'); + } + $this->container['allowed_payment_methods'] = $allowed_payment_methods; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets authentication_data + * + * @return \Adyen\Model\Checkout\AuthenticationData|null + */ + public function getAuthenticationData() + { + return $this->container['authentication_data']; + } + + /** + * Sets authentication_data + * + * @param \Adyen\Model\Checkout\AuthenticationData|null $authentication_data authentication_data + * + * @return self + */ + public function setAuthenticationData($authentication_data) + { + if (is_null($authentication_data)) { + throw new \InvalidArgumentException('non-nullable authentication_data cannot be null'); + } + $this->container['authentication_data'] = $authentication_data; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets blocked_payment_methods + * + * @return string[]|null + */ + public function getBlockedPaymentMethods() + { + return $this->container['blocked_payment_methods']; + } + + /** + * Sets blocked_payment_methods + * + * @param string[]|null $blocked_payment_methods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setBlockedPaymentMethods($blocked_payment_methods) + { + if (is_null($blocked_payment_methods)) { + throw new \InvalidArgumentException('non-nullable blocked_payment_methods cannot be null'); + } + $this->container['blocked_payment_methods'] = $blocked_payment_methods; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets channel + * + * @return string|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string|null $channel The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $allowedValues = $this->getChannelAllowableValues(); + if (!in_array($channel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets company + * + * @return \Adyen\Model\Checkout\Company|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param \Adyen\Model\Checkout\Company|null $company company + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper's two-letter country code. + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets deliver_at + * + * @return \DateTime|null + */ + public function getDeliverAt() + { + return $this->container['deliver_at']; + } + + /** + * Sets deliver_at + * + * @param \DateTime|null $deliver_at The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setDeliverAt($deliver_at) + { + if (is_null($deliver_at)) { + throw new \InvalidArgumentException('non-nullable deliver_at cannot be null'); + } + $this->container['deliver_at'] = $deliver_at; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets enable_one_click + * + * @return bool|null + */ + public function getEnableOneClick() + { + return $this->container['enable_one_click']; + } + + /** + * Sets enable_one_click + * + * @param bool|null $enable_one_click When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * + * @return self + */ + public function setEnableOneClick($enable_one_click) + { + if (is_null($enable_one_click)) { + throw new \InvalidArgumentException('non-nullable enable_one_click cannot be null'); + } + $this->container['enable_one_click'] = $enable_one_click; + + return $this; + } + + /** + * Gets enable_pay_out + * + * @return bool|null + */ + public function getEnablePayOut() + { + return $this->container['enable_pay_out']; + } + + /** + * Sets enable_pay_out + * + * @param bool|null $enable_pay_out When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + * + * @return self + */ + public function setEnablePayOut($enable_pay_out) + { + if (is_null($enable_pay_out)) { + throw new \InvalidArgumentException('non-nullable enable_pay_out cannot be null'); + } + $this->container['enable_pay_out'] = $enable_pay_out; + + return $this; + } + + /** + * Gets enable_recurring + * + * @return bool|null + */ + public function getEnableRecurring() + { + return $this->container['enable_recurring']; + } + + /** + * Sets enable_recurring + * + * @param bool|null $enable_recurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * + * @return self + */ + public function setEnableRecurring($enable_recurring) + { + if (is_null($enable_recurring)) { + throw new \InvalidArgumentException('non-nullable enable_recurring cannot be null'); + } + $this->container['enable_recurring'] = $enable_recurring; + + return $this; + } + + /** + * Gets expires_at + * + * @return \DateTime|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param \DateTime|null $expires_at The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets fund_origin + * + * @return \Adyen\Model\Checkout\FundOrigin|null + */ + public function getFundOrigin() + { + return $this->container['fund_origin']; + } + + /** + * Sets fund_origin + * + * @param \Adyen\Model\Checkout\FundOrigin|null $fund_origin fund_origin + * + * @return self + */ + public function setFundOrigin($fund_origin) + { + if (is_null($fund_origin)) { + throw new \InvalidArgumentException('non-nullable fund_origin cannot be null'); + } + $this->container['fund_origin'] = $fund_origin; + + return $this; + } + + /** + * Gets fund_recipient + * + * @return \Adyen\Model\Checkout\FundRecipient|null + */ + public function getFundRecipient() + { + return $this->container['fund_recipient']; + } + + /** + * Sets fund_recipient + * + * @param \Adyen\Model\Checkout\FundRecipient|null $fund_recipient fund_recipient + * + * @return self + */ + public function setFundRecipient($fund_recipient) + { + if (is_null($fund_recipient)) { + throw new \InvalidArgumentException('non-nullable fund_recipient cannot be null'); + } + $this->container['fund_recipient'] = $fund_recipient; + + return $this; + } + + /** + * Gets installment_options + * + * @return array|null + */ + public function getInstallmentOptions() + { + return $this->container['installment_options']; + } + + /** + * Sets installment_options + * + * @param array|null $installment_options A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + * + * @return self + */ + public function setInstallmentOptions($installment_options) + { + if (is_null($installment_options)) { + throw new \InvalidArgumentException('non-nullable installment_options cannot be null'); + } + $this->container['installment_options'] = $installment_options; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets mandate + * + * @return \Adyen\Model\Checkout\Mandate|null + */ + public function getMandate() + { + return $this->container['mandate']; + } + + /** + * Sets mandate + * + * @param \Adyen\Model\Checkout\Mandate|null $mandate mandate + * + * @return self + */ + public function setMandate($mandate) + { + if (is_null($mandate)) { + throw new \InvalidArgumentException('non-nullable mandate cannot be null'); + } + $this->container['mandate'] = $mandate; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Checkout\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Checkout\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param string|null $recurring_expiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Minimum number of days between authorisations. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets redirect_from_issuer_method + * + * @return string|null + */ + public function getRedirectFromIssuerMethod() + { + return $this->container['redirect_from_issuer_method']; + } + + /** + * Sets redirect_from_issuer_method + * + * @param string|null $redirect_from_issuer_method Specifies the redirect method (GET or POST) when redirecting back from the issuer. + * + * @return self + */ + public function setRedirectFromIssuerMethod($redirect_from_issuer_method) + { + if (is_null($redirect_from_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_from_issuer_method cannot be null'); + } + $this->container['redirect_from_issuer_method'] = $redirect_from_issuer_method; + + return $this; + } + + /** + * Gets redirect_to_issuer_method + * + * @return string|null + */ + public function getRedirectToIssuerMethod() + { + return $this->container['redirect_to_issuer_method']; + } + + /** + * Sets redirect_to_issuer_method + * + * @param string|null $redirect_to_issuer_method Specifies the redirect method (GET or POST) when redirecting to the issuer. + * + * @return self + */ + public function setRedirectToIssuerMethod($redirect_to_issuer_method) + { + if (is_null($redirect_to_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_to_issuer_method cannot be null'); + } + $this->container['redirect_to_issuer_method'] = $redirect_to_issuer_method; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The reference to uniquely identify a payment. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets return_url + * + * @return string + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string $return_url The URL to return to when a redirect payment is completed. + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets risk_data + * + * @return \Adyen\Model\Checkout\RiskData|null + */ + public function getRiskData() + { + return $this->container['risk_data']; + } + + /** + * Sets risk_data + * + * @param \Adyen\Model\Checkout\RiskData|null $risk_data risk_data + * + * @return self + */ + public function setRiskData($risk_data) + { + if (is_null($risk_data)) { + throw new \InvalidArgumentException('non-nullable risk_data cannot be null'); + } + $this->container['risk_data'] = $risk_data; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets split_card_funding_sources + * + * @return bool|null + */ + public function getSplitCardFundingSources() + { + return $this->container['split_card_funding_sources']; + } + + /** + * Sets split_card_funding_sources + * + * @param bool|null $split_card_funding_sources Boolean value indicating whether the card payment method should be split into separate debit and credit options. + * + * @return self + */ + public function setSplitCardFundingSources($split_card_funding_sources) + { + if (is_null($split_card_funding_sources)) { + throw new \InvalidArgumentException('non-nullable split_card_funding_sources cannot be null'); + } + $this->container['split_card_funding_sources'] = $split_card_funding_sources; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_payment_method + * + * @return bool|null + */ + public function getStorePaymentMethod() + { + return $this->container['store_payment_method']; + } + + /** + * Sets store_payment_method + * + * @param bool|null $store_payment_method When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + * + * @return self + */ + public function setStorePaymentMethod($store_payment_method) + { + if (is_null($store_payment_method)) { + throw new \InvalidArgumentException('non-nullable store_payment_method cannot be null'); + } + $this->container['store_payment_method'] = $store_payment_method; + + return $this; + } + + /** + * Gets store_payment_method_mode + * + * @return string|null + */ + public function getStorePaymentMethodMode() + { + return $this->container['store_payment_method_mode']; + } + + /** + * Sets store_payment_method_mode + * + * @param string|null $store_payment_method_mode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + * + * @return self + */ + public function setStorePaymentMethodMode($store_payment_method_mode) + { + if (is_null($store_payment_method_mode)) { + throw new \InvalidArgumentException('non-nullable store_payment_method_mode cannot be null'); + } + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!in_array($store_payment_method_mode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $store_payment_method_mode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['store_payment_method_mode'] = $store_payment_method_mode; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php new file mode 100644 index 000000000..624a5eefd --- /dev/null +++ b/src/Adyen/Model/Checkout/CreateCheckoutSessionResponse.php @@ -0,0 +1,2482 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreateCheckoutSessionResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreateCheckoutSessionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateCheckoutSessionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Checkout\AccountInfo', + 'additional_amount' => '\Adyen\Model\Checkout\Amount', + 'additional_data' => 'array', + 'allowed_payment_methods' => 'string[]', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'application_info' => '\Adyen\Model\Checkout\ApplicationInfo', + 'authentication_data' => '\Adyen\Model\Checkout\AuthenticationData', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'blocked_payment_methods' => 'string[]', + 'capture_delay_hours' => 'int', + 'channel' => 'string', + 'company' => '\Adyen\Model\Checkout\Company', + 'country_code' => 'string', + 'date_of_birth' => '\DateTime', + 'deliver_at' => '\DateTime', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'enable_one_click' => 'bool', + 'enable_pay_out' => 'bool', + 'enable_recurring' => 'bool', + 'expires_at' => '\DateTime', + 'fund_origin' => '\Adyen\Model\Checkout\FundOrigin', + 'fund_recipient' => '\Adyen\Model\Checkout\FundRecipient', + 'id' => 'string', + 'installment_options' => 'array', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'mandate' => '\Adyen\Model\Checkout\Mandate', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'metadata' => 'array', + 'mode' => 'string', + 'mpi_data' => '\Adyen\Model\Checkout\ThreeDSecureData', + 'recurring_expiry' => 'string', + 'recurring_frequency' => 'string', + 'recurring_processing_model' => 'string', + 'redirect_from_issuer_method' => 'string', + 'redirect_to_issuer_method' => 'string', + 'reference' => 'string', + 'return_url' => 'string', + 'risk_data' => '\Adyen\Model\Checkout\RiskData', + 'session_data' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'split_card_funding_sources' => 'bool', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'store' => 'string', + 'store_payment_method' => 'bool', + 'store_payment_method_mode' => 'string', + 'telephone_number' => 'string', + 'three_ds_authentication_only' => 'bool', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_amount' => null, + 'additional_data' => null, + 'allowed_payment_methods' => null, + 'amount' => null, + 'application_info' => null, + 'authentication_data' => null, + 'billing_address' => null, + 'blocked_payment_methods' => null, + 'capture_delay_hours' => 'int32', + 'channel' => null, + 'company' => null, + 'country_code' => null, + 'date_of_birth' => 'date', + 'deliver_at' => 'date-time', + 'delivery_address' => null, + 'enable_one_click' => null, + 'enable_pay_out' => null, + 'enable_recurring' => null, + 'expires_at' => 'date-time', + 'fund_origin' => null, + 'fund_recipient' => null, + 'id' => null, + 'installment_options' => null, + 'line_items' => null, + 'mandate' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'metadata' => null, + 'mode' => null, + 'mpi_data' => null, + 'recurring_expiry' => null, + 'recurring_frequency' => null, + 'recurring_processing_model' => null, + 'redirect_from_issuer_method' => null, + 'redirect_to_issuer_method' => null, + 'reference' => null, + 'return_url' => null, + 'risk_data' => null, + 'session_data' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'split_card_funding_sources' => null, + 'splits' => null, + 'store' => null, + 'store_payment_method' => null, + 'store_payment_method_mode' => null, + 'telephone_number' => null, + 'three_ds_authentication_only' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_amount' => false, + 'additional_data' => false, + 'allowed_payment_methods' => false, + 'amount' => false, + 'application_info' => false, + 'authentication_data' => false, + 'billing_address' => false, + 'blocked_payment_methods' => false, + 'capture_delay_hours' => true, + 'channel' => false, + 'company' => false, + 'country_code' => false, + 'date_of_birth' => false, + 'deliver_at' => false, + 'delivery_address' => false, + 'enable_one_click' => false, + 'enable_pay_out' => false, + 'enable_recurring' => false, + 'expires_at' => false, + 'fund_origin' => false, + 'fund_recipient' => false, + 'id' => false, + 'installment_options' => false, + 'line_items' => false, + 'mandate' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'metadata' => false, + 'mode' => false, + 'mpi_data' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'recurring_processing_model' => false, + 'redirect_from_issuer_method' => false, + 'redirect_to_issuer_method' => false, + 'reference' => false, + 'return_url' => false, + 'risk_data' => false, + 'session_data' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'split_card_funding_sources' => false, + 'splits' => false, + 'store' => false, + 'store_payment_method' => false, + 'store_payment_method_mode' => false, + 'telephone_number' => false, + 'three_ds_authentication_only' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_amount' => 'additionalAmount', + 'additional_data' => 'additionalData', + 'allowed_payment_methods' => 'allowedPaymentMethods', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'authentication_data' => 'authenticationData', + 'billing_address' => 'billingAddress', + 'blocked_payment_methods' => 'blockedPaymentMethods', + 'capture_delay_hours' => 'captureDelayHours', + 'channel' => 'channel', + 'company' => 'company', + 'country_code' => 'countryCode', + 'date_of_birth' => 'dateOfBirth', + 'deliver_at' => 'deliverAt', + 'delivery_address' => 'deliveryAddress', + 'enable_one_click' => 'enableOneClick', + 'enable_pay_out' => 'enablePayOut', + 'enable_recurring' => 'enableRecurring', + 'expires_at' => 'expiresAt', + 'fund_origin' => 'fundOrigin', + 'fund_recipient' => 'fundRecipient', + 'id' => 'id', + 'installment_options' => 'installmentOptions', + 'line_items' => 'lineItems', + 'mandate' => 'mandate', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'metadata' => 'metadata', + 'mode' => 'mode', + 'mpi_data' => 'mpiData', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'recurring_processing_model' => 'recurringProcessingModel', + 'redirect_from_issuer_method' => 'redirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'redirectToIssuerMethod', + 'reference' => 'reference', + 'return_url' => 'returnUrl', + 'risk_data' => 'riskData', + 'session_data' => 'sessionData', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'split_card_funding_sources' => 'splitCardFundingSources', + 'splits' => 'splits', + 'store' => 'store', + 'store_payment_method' => 'storePaymentMethod', + 'store_payment_method_mode' => 'storePaymentMethodMode', + 'telephone_number' => 'telephoneNumber', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_amount' => 'setAdditionalAmount', + 'additional_data' => 'setAdditionalData', + 'allowed_payment_methods' => 'setAllowedPaymentMethods', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'authentication_data' => 'setAuthenticationData', + 'billing_address' => 'setBillingAddress', + 'blocked_payment_methods' => 'setBlockedPaymentMethods', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'channel' => 'setChannel', + 'company' => 'setCompany', + 'country_code' => 'setCountryCode', + 'date_of_birth' => 'setDateOfBirth', + 'deliver_at' => 'setDeliverAt', + 'delivery_address' => 'setDeliveryAddress', + 'enable_one_click' => 'setEnableOneClick', + 'enable_pay_out' => 'setEnablePayOut', + 'enable_recurring' => 'setEnableRecurring', + 'expires_at' => 'setExpiresAt', + 'fund_origin' => 'setFundOrigin', + 'fund_recipient' => 'setFundRecipient', + 'id' => 'setId', + 'installment_options' => 'setInstallmentOptions', + 'line_items' => 'setLineItems', + 'mandate' => 'setMandate', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'metadata' => 'setMetadata', + 'mode' => 'setMode', + 'mpi_data' => 'setMpiData', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'redirect_from_issuer_method' => 'setRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'setRedirectToIssuerMethod', + 'reference' => 'setReference', + 'return_url' => 'setReturnUrl', + 'risk_data' => 'setRiskData', + 'session_data' => 'setSessionData', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'split_card_funding_sources' => 'setSplitCardFundingSources', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'store_payment_method' => 'setStorePaymentMethod', + 'store_payment_method_mode' => 'setStorePaymentMethodMode', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_amount' => 'getAdditionalAmount', + 'additional_data' => 'getAdditionalData', + 'allowed_payment_methods' => 'getAllowedPaymentMethods', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'authentication_data' => 'getAuthenticationData', + 'billing_address' => 'getBillingAddress', + 'blocked_payment_methods' => 'getBlockedPaymentMethods', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'channel' => 'getChannel', + 'company' => 'getCompany', + 'country_code' => 'getCountryCode', + 'date_of_birth' => 'getDateOfBirth', + 'deliver_at' => 'getDeliverAt', + 'delivery_address' => 'getDeliveryAddress', + 'enable_one_click' => 'getEnableOneClick', + 'enable_pay_out' => 'getEnablePayOut', + 'enable_recurring' => 'getEnableRecurring', + 'expires_at' => 'getExpiresAt', + 'fund_origin' => 'getFundOrigin', + 'fund_recipient' => 'getFundRecipient', + 'id' => 'getId', + 'installment_options' => 'getInstallmentOptions', + 'line_items' => 'getLineItems', + 'mandate' => 'getMandate', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'metadata' => 'getMetadata', + 'mode' => 'getMode', + 'mpi_data' => 'getMpiData', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'redirect_from_issuer_method' => 'getRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'getRedirectToIssuerMethod', + 'reference' => 'getReference', + 'return_url' => 'getReturnUrl', + 'risk_data' => 'getRiskData', + 'session_data' => 'getSessionData', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'split_card_funding_sources' => 'getSplitCardFundingSources', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'store_payment_method' => 'getStorePaymentMethod', + 'store_payment_method_mode' => 'getStorePaymentMethodMode', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHANNEL_I_OS = 'iOS'; + public const CHANNEL_ANDROID = 'Android'; + public const CHANNEL_WEB = 'Web'; + public const MODE_EMBEDDED = 'embedded'; + public const MODE_HOSTED = 'hosted'; + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + public const STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT = 'askForConsent'; + public const STORE_PAYMENT_METHOD_MODE_DISABLED = 'disabled'; + public const STORE_PAYMENT_METHOD_MODE_ENABLED = 'enabled'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChannelAllowableValues() + { + return [ + self::CHANNEL_I_OS, + self::CHANNEL_ANDROID, + self::CHANNEL_WEB, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getModeAllowableValues() + { + return [ + self::MODE_EMBEDDED, + self::MODE_HOSTED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStorePaymentMethodModeAllowableValues() + { + return [ + self::STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT, + self::STORE_PAYMENT_METHOD_MODE_DISABLED, + self::STORE_PAYMENT_METHOD_MODE_ENABLED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_amount', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('allowed_payment_methods', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('authentication_data', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('blocked_payment_methods', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('deliver_at', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('enable_one_click', $data ?? [], null); + $this->setIfExists('enable_pay_out', $data ?? [], null); + $this->setIfExists('enable_recurring', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('fund_origin', $data ?? [], null); + $this->setIfExists('fund_recipient', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('installment_options', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('mandate', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('mode', $data ?? [], 'embedded'); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('redirect_from_issuer_method', $data ?? [], null); + $this->setIfExists('redirect_to_issuer_method', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('risk_data', $data ?? [], null); + $this->setIfExists('session_data', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('split_card_funding_sources', $data ?? [], false); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_payment_method', $data ?? [], null); + $this->setIfExists('store_payment_method_mode', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getChannelAllowableValues(); + if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['expires_at'] === null) { + $invalidProperties[] = "'expires_at' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getModeAllowableValues(); + if (!is_null($this->container['mode']) && !in_array($this->container['mode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'mode', must be one of '%s'", + $this->container['mode'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['return_url'] === null) { + $invalidProperties[] = "'return_url' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!is_null($this->container['store_payment_method_mode']) && !in_array($this->container['store_payment_method_mode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $this->container['store_payment_method_mode'], + 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 account_info + * + * @return \Adyen\Model\Checkout\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Checkout\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additional_amount']; + } + + /** + * Sets additional_amount + * + * @param \Adyen\Model\Checkout\Amount|null $additional_amount additional_amount + * + * @return self + */ + public function setAdditionalAmount($additional_amount) + { + if (is_null($additional_amount)) { + throw new \InvalidArgumentException('non-nullable additional_amount cannot be null'); + } + $this->container['additional_amount'] = $additional_amount; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets allowed_payment_methods + * + * @return string[]|null + */ + public function getAllowedPaymentMethods() + { + return $this->container['allowed_payment_methods']; + } + + /** + * Sets allowed_payment_methods + * + * @param string[]|null $allowed_payment_methods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setAllowedPaymentMethods($allowed_payment_methods) + { + if (is_null($allowed_payment_methods)) { + throw new \InvalidArgumentException('non-nullable allowed_payment_methods cannot be null'); + } + $this->container['allowed_payment_methods'] = $allowed_payment_methods; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets authentication_data + * + * @return \Adyen\Model\Checkout\AuthenticationData|null + */ + public function getAuthenticationData() + { + return $this->container['authentication_data']; + } + + /** + * Sets authentication_data + * + * @param \Adyen\Model\Checkout\AuthenticationData|null $authentication_data authentication_data + * + * @return self + */ + public function setAuthenticationData($authentication_data) + { + if (is_null($authentication_data)) { + throw new \InvalidArgumentException('non-nullable authentication_data cannot be null'); + } + $this->container['authentication_data'] = $authentication_data; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets blocked_payment_methods + * + * @return string[]|null + */ + public function getBlockedPaymentMethods() + { + return $this->container['blocked_payment_methods']; + } + + /** + * Sets blocked_payment_methods + * + * @param string[]|null $blocked_payment_methods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setBlockedPaymentMethods($blocked_payment_methods) + { + if (is_null($blocked_payment_methods)) { + throw new \InvalidArgumentException('non-nullable blocked_payment_methods cannot be null'); + } + $this->container['blocked_payment_methods'] = $blocked_payment_methods; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets channel + * + * @return string|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string|null $channel The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $allowedValues = $this->getChannelAllowableValues(); + if (!in_array($channel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets company + * + * @return \Adyen\Model\Checkout\Company|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param \Adyen\Model\Checkout\Company|null $company company + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper's two-letter country code. + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets deliver_at + * + * @return \DateTime|null + */ + public function getDeliverAt() + { + return $this->container['deliver_at']; + } + + /** + * Sets deliver_at + * + * @param \DateTime|null $deliver_at The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setDeliverAt($deliver_at) + { + if (is_null($deliver_at)) { + throw new \InvalidArgumentException('non-nullable deliver_at cannot be null'); + } + $this->container['deliver_at'] = $deliver_at; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets enable_one_click + * + * @return bool|null + */ + public function getEnableOneClick() + { + return $this->container['enable_one_click']; + } + + /** + * Sets enable_one_click + * + * @param bool|null $enable_one_click When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * + * @return self + */ + public function setEnableOneClick($enable_one_click) + { + if (is_null($enable_one_click)) { + throw new \InvalidArgumentException('non-nullable enable_one_click cannot be null'); + } + $this->container['enable_one_click'] = $enable_one_click; + + return $this; + } + + /** + * Gets enable_pay_out + * + * @return bool|null + */ + public function getEnablePayOut() + { + return $this->container['enable_pay_out']; + } + + /** + * Sets enable_pay_out + * + * @param bool|null $enable_pay_out When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + * + * @return self + */ + public function setEnablePayOut($enable_pay_out) + { + if (is_null($enable_pay_out)) { + throw new \InvalidArgumentException('non-nullable enable_pay_out cannot be null'); + } + $this->container['enable_pay_out'] = $enable_pay_out; + + return $this; + } + + /** + * Gets enable_recurring + * + * @return bool|null + */ + public function getEnableRecurring() + { + return $this->container['enable_recurring']; + } + + /** + * Sets enable_recurring + * + * @param bool|null $enable_recurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * + * @return self + */ + public function setEnableRecurring($enable_recurring) + { + if (is_null($enable_recurring)) { + throw new \InvalidArgumentException('non-nullable enable_recurring cannot be null'); + } + $this->container['enable_recurring'] = $enable_recurring; + + return $this; + } + + /** + * Gets expires_at + * + * @return \DateTime + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param \DateTime $expires_at The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets fund_origin + * + * @return \Adyen\Model\Checkout\FundOrigin|null + */ + public function getFundOrigin() + { + return $this->container['fund_origin']; + } + + /** + * Sets fund_origin + * + * @param \Adyen\Model\Checkout\FundOrigin|null $fund_origin fund_origin + * + * @return self + */ + public function setFundOrigin($fund_origin) + { + if (is_null($fund_origin)) { + throw new \InvalidArgumentException('non-nullable fund_origin cannot be null'); + } + $this->container['fund_origin'] = $fund_origin; + + return $this; + } + + /** + * Gets fund_recipient + * + * @return \Adyen\Model\Checkout\FundRecipient|null + */ + public function getFundRecipient() + { + return $this->container['fund_recipient']; + } + + /** + * Sets fund_recipient + * + * @param \Adyen\Model\Checkout\FundRecipient|null $fund_recipient fund_recipient + * + * @return self + */ + public function setFundRecipient($fund_recipient) + { + if (is_null($fund_recipient)) { + throw new \InvalidArgumentException('non-nullable fund_recipient cannot be null'); + } + $this->container['fund_recipient'] = $fund_recipient; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id A unique identifier of the session. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets installment_options + * + * @return array|null + */ + public function getInstallmentOptions() + { + return $this->container['installment_options']; + } + + /** + * Sets installment_options + * + * @param array|null $installment_options A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + * + * @return self + */ + public function setInstallmentOptions($installment_options) + { + if (is_null($installment_options)) { + throw new \InvalidArgumentException('non-nullable installment_options cannot be null'); + } + $this->container['installment_options'] = $installment_options; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets mandate + * + * @return \Adyen\Model\Checkout\Mandate|null + */ + public function getMandate() + { + return $this->container['mandate']; + } + + /** + * Sets mandate + * + * @param \Adyen\Model\Checkout\Mandate|null $mandate mandate + * + * @return self + */ + public function setMandate($mandate) + { + if (is_null($mandate)) { + throw new \InvalidArgumentException('non-nullable mandate cannot be null'); + } + $this->container['mandate'] = $mandate; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets mode + * + * @return string|null + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param string|null $mode Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration + * + * @return self + */ + public function setMode($mode) + { + if (is_null($mode)) { + throw new \InvalidArgumentException('non-nullable mode cannot be null'); + } + $allowedValues = $this->getModeAllowableValues(); + if (!in_array($mode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mode', must be one of '%s'", + $mode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mode'] = $mode; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Checkout\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Checkout\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param string|null $recurring_expiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Minimum number of days between authorisations. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets redirect_from_issuer_method + * + * @return string|null + */ + public function getRedirectFromIssuerMethod() + { + return $this->container['redirect_from_issuer_method']; + } + + /** + * Sets redirect_from_issuer_method + * + * @param string|null $redirect_from_issuer_method Specifies the redirect method (GET or POST) when redirecting back from the issuer. + * + * @return self + */ + public function setRedirectFromIssuerMethod($redirect_from_issuer_method) + { + if (is_null($redirect_from_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_from_issuer_method cannot be null'); + } + $this->container['redirect_from_issuer_method'] = $redirect_from_issuer_method; + + return $this; + } + + /** + * Gets redirect_to_issuer_method + * + * @return string|null + */ + public function getRedirectToIssuerMethod() + { + return $this->container['redirect_to_issuer_method']; + } + + /** + * Sets redirect_to_issuer_method + * + * @param string|null $redirect_to_issuer_method Specifies the redirect method (GET or POST) when redirecting to the issuer. + * + * @return self + */ + public function setRedirectToIssuerMethod($redirect_to_issuer_method) + { + if (is_null($redirect_to_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_to_issuer_method cannot be null'); + } + $this->container['redirect_to_issuer_method'] = $redirect_to_issuer_method; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The reference to uniquely identify a payment. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets return_url + * + * @return string + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string $return_url The URL to return to when a redirect payment is completed. + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets risk_data + * + * @return \Adyen\Model\Checkout\RiskData|null + */ + public function getRiskData() + { + return $this->container['risk_data']; + } + + /** + * Sets risk_data + * + * @param \Adyen\Model\Checkout\RiskData|null $risk_data risk_data + * + * @return self + */ + public function setRiskData($risk_data) + { + if (is_null($risk_data)) { + throw new \InvalidArgumentException('non-nullable risk_data cannot be null'); + } + $this->container['risk_data'] = $risk_data; + + return $this; + } + + /** + * Gets session_data + * + * @return string|null + */ + public function getSessionData() + { + return $this->container['session_data']; + } + + /** + * Sets session_data + * + * @param string|null $session_data The payment session data you need to pass to your front end. + * + * @return self + */ + public function setSessionData($session_data) + { + if (is_null($session_data)) { + throw new \InvalidArgumentException('non-nullable session_data cannot be null'); + } + $this->container['session_data'] = $session_data; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets split_card_funding_sources + * + * @return bool|null + */ + public function getSplitCardFundingSources() + { + return $this->container['split_card_funding_sources']; + } + + /** + * Sets split_card_funding_sources + * + * @param bool|null $split_card_funding_sources Boolean value indicating whether the card payment method should be split into separate debit and credit options. + * + * @return self + */ + public function setSplitCardFundingSources($split_card_funding_sources) + { + if (is_null($split_card_funding_sources)) { + throw new \InvalidArgumentException('non-nullable split_card_funding_sources cannot be null'); + } + $this->container['split_card_funding_sources'] = $split_card_funding_sources; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_payment_method + * + * @return bool|null + */ + public function getStorePaymentMethod() + { + return $this->container['store_payment_method']; + } + + /** + * Sets store_payment_method + * + * @param bool|null $store_payment_method When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + * + * @return self + */ + public function setStorePaymentMethod($store_payment_method) + { + if (is_null($store_payment_method)) { + throw new \InvalidArgumentException('non-nullable store_payment_method cannot be null'); + } + $this->container['store_payment_method'] = $store_payment_method; + + return $this; + } + + /** + * Gets store_payment_method_mode + * + * @return string|null + */ + public function getStorePaymentMethodMode() + { + return $this->container['store_payment_method_mode']; + } + + /** + * Sets store_payment_method_mode + * + * @param string|null $store_payment_method_mode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + * + * @return self + */ + public function setStorePaymentMethodMode($store_payment_method_mode) + { + if (is_null($store_payment_method_mode)) { + throw new \InvalidArgumentException('non-nullable store_payment_method_mode cannot be null'); + } + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!in_array($store_payment_method_mode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $store_payment_method_mode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['store_payment_method_mode'] = $store_payment_method_mode; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreatePaymentAmountUpdateRequest.php b/src/Adyen/Model/Checkout/CreatePaymentAmountUpdateRequest.php new file mode 100644 index 000000000..9ce19c400 --- /dev/null +++ b/src/Adyen/Model/Checkout/CreatePaymentAmountUpdateRequest.php @@ -0,0 +1,564 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreatePaymentAmountUpdateRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreatePaymentAmountUpdateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatePaymentAmountUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'industry_usage' => 'string', + 'merchant_account' => 'string', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'industry_usage' => null, + 'merchant_account' => null, + 'reference' => null, + 'splits' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'industry_usage' => false, + 'merchant_account' => false, + 'reference' => false, + 'splits' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'industry_usage' => 'industryUsage', + 'merchant_account' => 'merchantAccount', + 'reference' => 'reference', + 'splits' => 'splits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'industry_usage' => 'setIndustryUsage', + 'merchant_account' => 'setMerchantAccount', + 'reference' => 'setReference', + 'splits' => 'setSplits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'industry_usage' => 'getIndustryUsage', + 'merchant_account' => 'getMerchantAccount', + 'reference' => 'getReference', + 'splits' => 'getSplits' + ]; + + /** + * 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 INDUSTRY_USAGE_DELAYED_CHARGE = 'delayedCharge'; + public const INDUSTRY_USAGE_INSTALLMENT = 'installment'; + public const INDUSTRY_USAGE_NO_SHOW = 'noShow'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIndustryUsageAllowableValues() + { + return [ + self::INDUSTRY_USAGE_DELAYED_CHARGE, + self::INDUSTRY_USAGE_INSTALLMENT, + self::INDUSTRY_USAGE_NO_SHOW, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('industry_usage', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!is_null($this->container['industry_usage']) && !in_array($this->container['industry_usage'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'industry_usage', must be one of '%s'", + $this->container['industry_usage'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets industry_usage + * + * @return string|null + */ + public function getIndustryUsage() + { + return $this->container['industry_usage']; + } + + /** + * Sets industry_usage + * + * @param string|null $industry_usage The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + * + * @return self + */ + public function setIndustryUsage($industry_usage) + { + if (is_null($industry_usage)) { + throw new \InvalidArgumentException('non-nullable industry_usage cannot be null'); + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!in_array($industry_usage, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'industry_usage', must be one of '%s'", + $industry_usage, + implode("', '", $allowedValues) + ) + ); + } + $this->container['industry_usage'] = $industry_usage; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the amount update request. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreatePaymentCancelRequest.php b/src/Adyen/Model/Checkout/CreatePaymentCancelRequest.php new file mode 100644 index 000000000..4641b9c94 --- /dev/null +++ b/src/Adyen/Model/Checkout/CreatePaymentCancelRequest.php @@ -0,0 +1,424 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreatePaymentCancelRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreatePaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatePaymentCancelRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' 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 merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the cancel request. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreatePaymentCaptureRequest.php b/src/Adyen/Model/Checkout/CreatePaymentCaptureRequest.php new file mode 100644 index 000000000..2c100ebb2 --- /dev/null +++ b/src/Adyen/Model/Checkout/CreatePaymentCaptureRequest.php @@ -0,0 +1,529 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreatePaymentCaptureRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreatePaymentCaptureRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatePaymentCaptureRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'merchant_account' => 'string', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'line_items' => null, + 'merchant_account' => null, + 'reference' => null, + 'splits' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'line_items' => false, + 'merchant_account' => false, + 'reference' => false, + 'splits' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'line_items' => 'lineItems', + 'merchant_account' => 'merchantAccount', + 'reference' => 'reference', + 'splits' => 'splits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'line_items' => 'setLineItems', + 'merchant_account' => 'setMerchantAccount', + 'reference' => 'setReference', + 'splits' => 'setSplits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'line_items' => 'getLineItems', + 'merchant_account' => 'getMerchantAccount', + 'reference' => 'getReference', + 'splits' => 'getSplits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the capture request. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreatePaymentLinkRequest.php b/src/Adyen/Model/Checkout/CreatePaymentLinkRequest.php new file mode 100644 index 000000000..89e23ca0b --- /dev/null +++ b/src/Adyen/Model/Checkout/CreatePaymentLinkRequest.php @@ -0,0 +1,1717 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreatePaymentLinkRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreatePaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatePaymentLinkRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed_payment_methods' => 'string[]', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'blocked_payment_methods' => 'string[]', + 'capture_delay_hours' => 'int', + 'country_code' => 'string', + 'date_of_birth' => '\DateTime', + 'deliver_at' => '\DateTime', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'description' => 'string', + 'expires_at' => 'string', + 'installment_options' => 'array', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'manual_capture' => 'bool', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'metadata' => 'array', + 'recurring_processing_model' => 'string', + 'reference' => 'string', + 'required_shopper_fields' => 'string[]', + 'return_url' => 'string', + 'reusable' => 'bool', + 'risk_data' => '\Adyen\Model\Checkout\RiskData', + 'shopper_email' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'show_remove_payment_method_button' => 'bool', + 'social_security_number' => 'string', + 'split_card_funding_sources' => 'bool', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'store' => 'string', + 'store_payment_method_mode' => 'string', + 'telephone_number' => 'string', + 'theme_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed_payment_methods' => null, + 'amount' => null, + 'billing_address' => null, + 'blocked_payment_methods' => null, + 'capture_delay_hours' => 'int32', + 'country_code' => null, + 'date_of_birth' => 'date', + 'deliver_at' => 'date-time', + 'delivery_address' => null, + 'description' => null, + 'expires_at' => null, + 'installment_options' => null, + 'line_items' => null, + 'manual_capture' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'metadata' => null, + 'recurring_processing_model' => null, + 'reference' => null, + 'required_shopper_fields' => null, + 'return_url' => null, + 'reusable' => null, + 'risk_data' => null, + 'shopper_email' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'show_remove_payment_method_button' => null, + 'social_security_number' => null, + 'split_card_funding_sources' => null, + 'splits' => null, + 'store' => null, + 'store_payment_method_mode' => null, + 'telephone_number' => null, + 'theme_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed_payment_methods' => false, + 'amount' => false, + 'billing_address' => false, + 'blocked_payment_methods' => false, + 'capture_delay_hours' => true, + 'country_code' => false, + 'date_of_birth' => false, + 'deliver_at' => false, + 'delivery_address' => false, + 'description' => false, + 'expires_at' => false, + 'installment_options' => false, + 'line_items' => false, + 'manual_capture' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'metadata' => false, + 'recurring_processing_model' => false, + 'reference' => false, + 'required_shopper_fields' => false, + 'return_url' => false, + 'reusable' => false, + 'risk_data' => false, + 'shopper_email' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'show_remove_payment_method_button' => false, + 'social_security_number' => false, + 'split_card_funding_sources' => false, + 'splits' => false, + 'store' => false, + 'store_payment_method_mode' => false, + 'telephone_number' => false, + 'theme_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_payment_methods' => 'allowedPaymentMethods', + 'amount' => 'amount', + 'billing_address' => 'billingAddress', + 'blocked_payment_methods' => 'blockedPaymentMethods', + 'capture_delay_hours' => 'captureDelayHours', + 'country_code' => 'countryCode', + 'date_of_birth' => 'dateOfBirth', + 'deliver_at' => 'deliverAt', + 'delivery_address' => 'deliveryAddress', + 'description' => 'description', + 'expires_at' => 'expiresAt', + 'installment_options' => 'installmentOptions', + 'line_items' => 'lineItems', + 'manual_capture' => 'manualCapture', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'metadata' => 'metadata', + 'recurring_processing_model' => 'recurringProcessingModel', + 'reference' => 'reference', + 'required_shopper_fields' => 'requiredShopperFields', + 'return_url' => 'returnUrl', + 'reusable' => 'reusable', + 'risk_data' => 'riskData', + 'shopper_email' => 'shopperEmail', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'show_remove_payment_method_button' => 'showRemovePaymentMethodButton', + 'social_security_number' => 'socialSecurityNumber', + 'split_card_funding_sources' => 'splitCardFundingSources', + 'splits' => 'splits', + 'store' => 'store', + 'store_payment_method_mode' => 'storePaymentMethodMode', + 'telephone_number' => 'telephoneNumber', + 'theme_id' => 'themeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_payment_methods' => 'setAllowedPaymentMethods', + 'amount' => 'setAmount', + 'billing_address' => 'setBillingAddress', + 'blocked_payment_methods' => 'setBlockedPaymentMethods', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'country_code' => 'setCountryCode', + 'date_of_birth' => 'setDateOfBirth', + 'deliver_at' => 'setDeliverAt', + 'delivery_address' => 'setDeliveryAddress', + 'description' => 'setDescription', + 'expires_at' => 'setExpiresAt', + 'installment_options' => 'setInstallmentOptions', + 'line_items' => 'setLineItems', + 'manual_capture' => 'setManualCapture', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'metadata' => 'setMetadata', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'reference' => 'setReference', + 'required_shopper_fields' => 'setRequiredShopperFields', + 'return_url' => 'setReturnUrl', + 'reusable' => 'setReusable', + 'risk_data' => 'setRiskData', + 'shopper_email' => 'setShopperEmail', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'show_remove_payment_method_button' => 'setShowRemovePaymentMethodButton', + 'social_security_number' => 'setSocialSecurityNumber', + 'split_card_funding_sources' => 'setSplitCardFundingSources', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'store_payment_method_mode' => 'setStorePaymentMethodMode', + 'telephone_number' => 'setTelephoneNumber', + 'theme_id' => 'setThemeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_payment_methods' => 'getAllowedPaymentMethods', + 'amount' => 'getAmount', + 'billing_address' => 'getBillingAddress', + 'blocked_payment_methods' => 'getBlockedPaymentMethods', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'country_code' => 'getCountryCode', + 'date_of_birth' => 'getDateOfBirth', + 'deliver_at' => 'getDeliverAt', + 'delivery_address' => 'getDeliveryAddress', + 'description' => 'getDescription', + 'expires_at' => 'getExpiresAt', + 'installment_options' => 'getInstallmentOptions', + 'line_items' => 'getLineItems', + 'manual_capture' => 'getManualCapture', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'metadata' => 'getMetadata', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'reference' => 'getReference', + 'required_shopper_fields' => 'getRequiredShopperFields', + 'return_url' => 'getReturnUrl', + 'reusable' => 'getReusable', + 'risk_data' => 'getRiskData', + 'shopper_email' => 'getShopperEmail', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'show_remove_payment_method_button' => 'getShowRemovePaymentMethodButton', + 'social_security_number' => 'getSocialSecurityNumber', + 'split_card_funding_sources' => 'getSplitCardFundingSources', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'store_payment_method_mode' => 'getStorePaymentMethodMode', + 'telephone_number' => 'getTelephoneNumber', + 'theme_id' => 'getThemeId' + ]; + + /** + * 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 RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const REQUIRED_SHOPPER_FIELDS_BILLING_ADDRESS = 'billingAddress'; + public const REQUIRED_SHOPPER_FIELDS_DELIVERY_ADDRESS = 'deliveryAddress'; + public const REQUIRED_SHOPPER_FIELDS_SHOPPER_EMAIL = 'shopperEmail'; + public const REQUIRED_SHOPPER_FIELDS_SHOPPER_NAME = 'shopperName'; + public const REQUIRED_SHOPPER_FIELDS_TELEPHONE_NUMBER = 'telephoneNumber'; + public const STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT = 'askForConsent'; + public const STORE_PAYMENT_METHOD_MODE_DISABLED = 'disabled'; + public const STORE_PAYMENT_METHOD_MODE_ENABLED = 'enabled'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequiredShopperFieldsAllowableValues() + { + return [ + self::REQUIRED_SHOPPER_FIELDS_BILLING_ADDRESS, + self::REQUIRED_SHOPPER_FIELDS_DELIVERY_ADDRESS, + self::REQUIRED_SHOPPER_FIELDS_SHOPPER_EMAIL, + self::REQUIRED_SHOPPER_FIELDS_SHOPPER_NAME, + self::REQUIRED_SHOPPER_FIELDS_TELEPHONE_NUMBER, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStorePaymentMethodModeAllowableValues() + { + return [ + self::STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT, + self::STORE_PAYMENT_METHOD_MODE_DISABLED, + self::STORE_PAYMENT_METHOD_MODE_ENABLED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed_payment_methods', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('blocked_payment_methods', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('deliver_at', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('installment_options', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('manual_capture', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('required_shopper_fields', $data ?? [], null); + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('reusable', $data ?? [], null); + $this->setIfExists('risk_data', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('show_remove_payment_method_button', $data ?? [], true); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('split_card_funding_sources', $data ?? [], false); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_payment_method_mode', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('theme_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!is_null($this->container['store_payment_method_mode']) && !in_array($this->container['store_payment_method_mode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $this->container['store_payment_method_mode'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed_payment_methods + * + * @return string[]|null + */ + public function getAllowedPaymentMethods() + { + return $this->container['allowed_payment_methods']; + } + + /** + * Sets allowed_payment_methods + * + * @param string[]|null $allowed_payment_methods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setAllowedPaymentMethods($allowed_payment_methods) + { + if (is_null($allowed_payment_methods)) { + throw new \InvalidArgumentException('non-nullable allowed_payment_methods cannot be null'); + } + $this->container['allowed_payment_methods'] = $allowed_payment_methods; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets blocked_payment_methods + * + * @return string[]|null + */ + public function getBlockedPaymentMethods() + { + return $this->container['blocked_payment_methods']; + } + + /** + * Sets blocked_payment_methods + * + * @param string[]|null $blocked_payment_methods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setBlockedPaymentMethods($blocked_payment_methods) + { + if (is_null($blocked_payment_methods)) { + throw new \InvalidArgumentException('non-nullable blocked_payment_methods cannot be null'); + } + $this->container['blocked_payment_methods'] = $blocked_payment_methods; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper's two-letter country code. + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets deliver_at + * + * @return \DateTime|null + */ + public function getDeliverAt() + { + return $this->container['deliver_at']; + } + + /** + * Sets deliver_at + * + * @param \DateTime|null $deliver_at The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setDeliverAt($deliver_at) + { + if (is_null($deliver_at)) { + throw new \InvalidArgumentException('non-nullable deliver_at cannot be null'); + } + $this->container['deliver_at'] = $deliver_at; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description visible on the payment page. Maximum length: 280 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets expires_at + * + * @return string|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string|null $expires_at The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets installment_options + * + * @return array|null + */ + public function getInstallmentOptions() + { + return $this->container['installment_options']; + } + + /** + * Sets installment_options + * + * @param array|null $installment_options A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + * + * @return self + */ + public function setInstallmentOptions($installment_options) + { + if (is_null($installment_options)) { + throw new \InvalidArgumentException('non-nullable installment_options cannot be null'); + } + $this->container['installment_options'] = $installment_options; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, and Zip. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets manual_capture + * + * @return bool|null + */ + public function getManualCapture() + { + return $this->container['manual_capture']; + } + + /** + * Sets manual_capture + * + * @param bool|null $manual_capture Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). + * + * @return self + */ + public function setManualCapture($manual_capture) + { + if (is_null($manual_capture)) { + throw new \InvalidArgumentException('non-nullable manual_capture cannot be null'); + } + $this->container['manual_capture'] = $manual_capture; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier for which the payment link is created. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference A reference that is used to uniquely identify the payment in future communications about the payment status. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets required_shopper_fields + * + * @return string[]|null + */ + public function getRequiredShopperFields() + { + return $this->container['required_shopper_fields']; + } + + /** + * Sets required_shopper_fields + * + * @param string[]|null $required_shopper_fields List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + * + * @return self + */ + public function setRequiredShopperFields($required_shopper_fields) + { + if (is_null($required_shopper_fields)) { + throw new \InvalidArgumentException('non-nullable required_shopper_fields cannot be null'); + } + $allowedValues = $this->getRequiredShopperFieldsAllowableValues(); + if (array_diff($required_shopper_fields, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'required_shopper_fields', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['required_shopper_fields'] = $required_shopper_fields; + + return $this; + } + + /** + * Gets return_url + * + * @return string|null + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string|null $return_url Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets reusable + * + * @return bool|null + */ + public function getReusable() + { + return $this->container['reusable']; + } + + /** + * Sets reusable + * + * @param bool|null $reusable Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. + * + * @return self + */ + public function setReusable($reusable) + { + if (is_null($reusable)) { + throw new \InvalidArgumentException('non-nullable reusable cannot be null'); + } + $this->container['reusable'] = $reusable; + + return $this; + } + + /** + * Gets risk_data + * + * @return \Adyen\Model\Checkout\RiskData|null + */ + public function getRiskData() + { + return $this->container['risk_data']; + } + + /** + * Sets risk_data + * + * @param \Adyen\Model\Checkout\RiskData|null $risk_data risk_data + * + * @return self + */ + public function setRiskData($risk_data) + { + if (is_null($risk_data)) { + throw new \InvalidArgumentException('non-nullable risk_data cannot be null'); + } + $this->container['risk_data'] = $risk_data; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets show_remove_payment_method_button + * + * @return bool|null + */ + public function getShowRemovePaymentMethodButton() + { + return $this->container['show_remove_payment_method_button']; + } + + /** + * Sets show_remove_payment_method_button + * + * @param bool|null $show_remove_payment_method_button Set to **false** to hide the button that lets the shopper remove a stored payment method. + * + * @return self + */ + public function setShowRemovePaymentMethodButton($show_remove_payment_method_button) + { + if (is_null($show_remove_payment_method_button)) { + throw new \InvalidArgumentException('non-nullable show_remove_payment_method_button cannot be null'); + } + $this->container['show_remove_payment_method_button'] = $show_remove_payment_method_button; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets split_card_funding_sources + * + * @return bool|null + */ + public function getSplitCardFundingSources() + { + return $this->container['split_card_funding_sources']; + } + + /** + * Sets split_card_funding_sources + * + * @param bool|null $split_card_funding_sources Boolean value indicating whether the card payment method should be split into separate debit and credit options. + * + * @return self + */ + public function setSplitCardFundingSources($split_card_funding_sources) + { + if (is_null($split_card_funding_sources)) { + throw new \InvalidArgumentException('non-nullable split_card_funding_sources cannot be null'); + } + $this->container['split_card_funding_sources'] = $split_card_funding_sources; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The physical store, for which this payment is processed. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_payment_method_mode + * + * @return string|null + */ + public function getStorePaymentMethodMode() + { + return $this->container['store_payment_method_mode']; + } + + /** + * Sets store_payment_method_mode + * + * @param string|null $store_payment_method_mode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + * + * @return self + */ + public function setStorePaymentMethodMode($store_payment_method_mode) + { + if (is_null($store_payment_method_mode)) { + throw new \InvalidArgumentException('non-nullable store_payment_method_mode cannot be null'); + } + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!in_array($store_payment_method_mode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $store_payment_method_mode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['store_payment_method_mode'] = $store_payment_method_mode; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets theme_id + * + * @return string|null + */ + public function getThemeId() + { + return $this->container['theme_id']; + } + + /** + * Sets theme_id + * + * @param string|null $theme_id A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. + * + * @return self + */ + public function setThemeId($theme_id) + { + if (is_null($theme_id)) { + throw new \InvalidArgumentException('non-nullable theme_id cannot be null'); + } + $this->container['theme_id'] = $theme_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreatePaymentRefundRequest.php b/src/Adyen/Model/Checkout/CreatePaymentRefundRequest.php new file mode 100644 index 000000000..859b916b4 --- /dev/null +++ b/src/Adyen/Model/Checkout/CreatePaymentRefundRequest.php @@ -0,0 +1,602 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreatePaymentRefundRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreatePaymentRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatePaymentRefundRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'merchant_account' => 'string', + 'merchant_refund_reason' => 'string', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'line_items' => null, + 'merchant_account' => null, + 'merchant_refund_reason' => null, + 'reference' => null, + 'splits' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'line_items' => false, + 'merchant_account' => false, + 'merchant_refund_reason' => false, + 'reference' => false, + 'splits' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'line_items' => 'lineItems', + 'merchant_account' => 'merchantAccount', + 'merchant_refund_reason' => 'merchantRefundReason', + 'reference' => 'reference', + 'splits' => 'splits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'line_items' => 'setLineItems', + 'merchant_account' => 'setMerchantAccount', + 'merchant_refund_reason' => 'setMerchantRefundReason', + 'reference' => 'setReference', + 'splits' => 'setSplits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'line_items' => 'getLineItems', + 'merchant_account' => 'getMerchantAccount', + 'merchant_refund_reason' => 'getMerchantRefundReason', + 'reference' => 'getReference', + 'splits' => 'getSplits' + ]; + + /** + * 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 MERCHANT_REFUND_REASON_FRAUD = 'FRAUD'; + public const MERCHANT_REFUND_REASON_CUSTOMER_REQUEST = 'CUSTOMER REQUEST'; + public const MERCHANT_REFUND_REASON__RETURN = 'RETURN'; + public const MERCHANT_REFUND_REASON_DUPLICATE = 'DUPLICATE'; + public const MERCHANT_REFUND_REASON_OTHER = 'OTHER'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMerchantRefundReasonAllowableValues() + { + return [ + self::MERCHANT_REFUND_REASON_FRAUD, + self::MERCHANT_REFUND_REASON_CUSTOMER_REQUEST, + self::MERCHANT_REFUND_REASON__RETURN, + self::MERCHANT_REFUND_REASON_DUPLICATE, + self::MERCHANT_REFUND_REASON_OTHER, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_refund_reason', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getMerchantRefundReasonAllowableValues(); + if (!is_null($this->container['merchant_refund_reason']) && !in_array($this->container['merchant_refund_reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'merchant_refund_reason', must be one of '%s'", + $this->container['merchant_refund_reason'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_refund_reason + * + * @return string|null + */ + public function getMerchantRefundReason() + { + return $this->container['merchant_refund_reason']; + } + + /** + * Sets merchant_refund_reason + * + * @param string|null $merchant_refund_reason Your reason for the refund request + * + * @return self + */ + public function setMerchantRefundReason($merchant_refund_reason) + { + if (is_null($merchant_refund_reason)) { + throw new \InvalidArgumentException('non-nullable merchant_refund_reason cannot be null'); + } + $allowedValues = $this->getMerchantRefundReasonAllowableValues(); + if (!in_array($merchant_refund_reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'merchant_refund_reason', must be one of '%s'", + $merchant_refund_reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['merchant_refund_reason'] = $merchant_refund_reason; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the refund request. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreatePaymentReversalRequest.php b/src/Adyen/Model/Checkout/CreatePaymentReversalRequest.php new file mode 100644 index 000000000..eb73b9f6a --- /dev/null +++ b/src/Adyen/Model/Checkout/CreatePaymentReversalRequest.php @@ -0,0 +1,424 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreatePaymentReversalRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreatePaymentReversalRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatePaymentReversalRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' 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 merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the reversal request. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/CreateStandalonePaymentCancelRequest.php b/src/Adyen/Model/Checkout/CreateStandalonePaymentCancelRequest.php new file mode 100644 index 000000000..3e693997a --- /dev/null +++ b/src/Adyen/Model/Checkout/CreateStandalonePaymentCancelRequest.php @@ -0,0 +1,461 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * CreateStandalonePaymentCancelRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class CreateStandalonePaymentCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateStandalonePaymentCancelRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'payment_reference' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'payment_reference' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'payment_reference' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'payment_reference' => 'paymentReference', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'payment_reference' => 'setPaymentReference', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'payment_reference' => 'getPaymentReference', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('payment_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_reference'] === null) { + $invalidProperties[] = "'payment_reference' 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 merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets payment_reference + * + * @return string + */ + public function getPaymentReference() + { + return $this->container['payment_reference']; + } + + /** + * Sets payment_reference + * + * @param string $payment_reference The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. + * + * @return self + */ + public function setPaymentReference($payment_reference) + { + if (is_null($payment_reference)) { + throw new \InvalidArgumentException('non-nullable payment_reference cannot be null'); + } + $this->container['payment_reference'] = $payment_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the cancel request. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DetailsRequest.php b/src/Adyen/Model/Checkout/DetailsRequest.php new file mode 100644 index 000000000..90321085b --- /dev/null +++ b/src/Adyen/Model/Checkout/DetailsRequest.php @@ -0,0 +1,494 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * DetailsRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class DetailsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DetailsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication_data' => '\Adyen\Model\Checkout\DetailsRequestAuthenticationData', + 'details' => '\Adyen\Model\Checkout\PaymentCompletionDetails', + 'payment_data' => 'string', + 'three_ds_authentication_only' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication_data' => null, + 'details' => null, + 'payment_data' => null, + 'three_ds_authentication_only' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication_data' => false, + 'details' => false, + 'payment_data' => false, + 'three_ds_authentication_only' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication_data' => 'authenticationData', + 'details' => 'details', + 'payment_data' => 'paymentData', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication_data' => 'setAuthenticationData', + 'details' => 'setDetails', + 'payment_data' => 'setPaymentData', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication_data' => 'getAuthenticationData', + 'details' => 'getDetails', + 'payment_data' => 'getPaymentData', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication_data', $data ?? [], null); + $this->setIfExists('details', $data ?? [], null); + $this->setIfExists('payment_data', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['details'] === null) { + $invalidProperties[] = "'details' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication_data + * + * @return \Adyen\Model\Checkout\DetailsRequestAuthenticationData|null + */ + public function getAuthenticationData() + { + return $this->container['authentication_data']; + } + + /** + * Sets authentication_data + * + * @param \Adyen\Model\Checkout\DetailsRequestAuthenticationData|null $authentication_data authentication_data + * + * @return self + */ + public function setAuthenticationData($authentication_data) + { + if (is_null($authentication_data)) { + throw new \InvalidArgumentException('non-nullable authentication_data cannot be null'); + } + $this->container['authentication_data'] = $authentication_data; + + return $this; + } + + /** + * Gets details + * + * @return \Adyen\Model\Checkout\PaymentCompletionDetails + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \Adyen\Model\Checkout\PaymentCompletionDetails $details details + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; + + return $this; + } + + /** + * Gets payment_data + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['payment_data']; + } + + /** + * Sets payment_data + * + * @param string|null $payment_data The `paymentData` value from the `/payments` response. Required if the `/payments` response returns this value. + * + * @return self + */ + public function setPaymentData($payment_data) + { + if (is_null($payment_data)) { + throw new \InvalidArgumentException('non-nullable payment_data cannot be null'); + } + $this->container['payment_data'] = $payment_data; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + * @deprecated + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. + * + * @return self + * @deprecated + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php b/src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php new file mode 100644 index 000000000..9cb1c4bb7 --- /dev/null +++ b/src/Adyen/Model/Checkout/DetailsRequestAuthenticationData.php @@ -0,0 +1,387 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * DetailsRequestAuthenticationData Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class DetailsRequestAuthenticationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DetailsRequestAuthenticationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication_only' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication_only' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication_only' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication_only' => 'authenticationOnly' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication_only' => 'setAuthenticationOnly' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication_only' => 'getAuthenticationOnly' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication_only', $data ?? [], false); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication_only + * + * @return bool|null + */ + public function getAuthenticationOnly() + { + return $this->container['authentication_only']; + } + + /** + * Sets authentication_only + * + * @param bool|null $authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. + * + * @return self + */ + public function setAuthenticationOnly($authentication_only) + { + if (is_null($authentication_only)) { + throw new \InvalidArgumentException('non-nullable authentication_only cannot be null'); + } + $this->container['authentication_only'] = $authentication_only; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DeviceRenderOptions.php b/src/Adyen/Model/Checkout/DeviceRenderOptions.php new file mode 100644 index 000000000..c48cfba55 --- /dev/null +++ b/src/Adyen/Model/Checkout/DeviceRenderOptions.php @@ -0,0 +1,485 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * DeviceRenderOptions Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class DeviceRenderOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeviceRenderOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sdk_interface' => 'string', + 'sdk_ui_type' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sdk_interface' => null, + 'sdk_ui_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sdk_interface' => false, + 'sdk_ui_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sdk_interface' => 'sdkInterface', + 'sdk_ui_type' => 'sdkUiType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sdk_interface' => 'setSdkInterface', + 'sdk_ui_type' => 'setSdkUiType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sdk_interface' => 'getSdkInterface', + 'sdk_ui_type' => 'getSdkUiType' + ]; + + /** + * 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 SDK_INTERFACE_NATIVE = 'native'; + public const SDK_INTERFACE_HTML = 'html'; + public const SDK_INTERFACE_BOTH = 'both'; + public const SDK_UI_TYPE_MULTI_SELECT = 'multiSelect'; + public const SDK_UI_TYPE_OTHER_HTML = 'otherHtml'; + public const SDK_UI_TYPE_OUT_OF_BAND = 'outOfBand'; + public const SDK_UI_TYPE_SINGLE_SELECT = 'singleSelect'; + public const SDK_UI_TYPE_TEXT = 'text'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSdkInterfaceAllowableValues() + { + return [ + self::SDK_INTERFACE_NATIVE, + self::SDK_INTERFACE_HTML, + self::SDK_INTERFACE_BOTH, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSdkUiTypeAllowableValues() + { + return [ + self::SDK_UI_TYPE_MULTI_SELECT, + self::SDK_UI_TYPE_OTHER_HTML, + self::SDK_UI_TYPE_OUT_OF_BAND, + self::SDK_UI_TYPE_SINGLE_SELECT, + self::SDK_UI_TYPE_TEXT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('sdk_interface', $data ?? [], 'both'); + $this->setIfExists('sdk_ui_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSdkInterfaceAllowableValues(); + if (!is_null($this->container['sdk_interface']) && !in_array($this->container['sdk_interface'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'sdk_interface', must be one of '%s'", + $this->container['sdk_interface'], + 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 sdk_interface + * + * @return string|null + */ + public function getSdkInterface() + { + return $this->container['sdk_interface']; + } + + /** + * Sets sdk_interface + * + * @param string|null $sdk_interface Supported SDK interface types. Allowed values: * native * html * both + * + * @return self + */ + public function setSdkInterface($sdk_interface) + { + if (is_null($sdk_interface)) { + throw new \InvalidArgumentException('non-nullable sdk_interface cannot be null'); + } + $allowedValues = $this->getSdkInterfaceAllowableValues(); + if (!in_array($sdk_interface, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'sdk_interface', must be one of '%s'", + $sdk_interface, + implode("', '", $allowedValues) + ) + ); + } + $this->container['sdk_interface'] = $sdk_interface; + + return $this; + } + + /** + * Gets sdk_ui_type + * + * @return string[]|null + */ + public function getSdkUiType() + { + return $this->container['sdk_ui_type']; + } + + /** + * Sets sdk_ui_type + * + * @param string[]|null $sdk_ui_type UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + * + * @return self + */ + public function setSdkUiType($sdk_ui_type) + { + if (is_null($sdk_ui_type)) { + throw new \InvalidArgumentException('non-nullable sdk_ui_type cannot be null'); + } + $allowedValues = $this->getSdkUiTypeAllowableValues(); + if (array_diff($sdk_ui_type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'sdk_ui_type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['sdk_ui_type'] = $sdk_ui_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DokuDetails.php b/src/Adyen/Model/Checkout/DokuDetails.php new file mode 100644 index 000000000..d38aae86e --- /dev/null +++ b/src/Adyen/Model/Checkout/DokuDetails.php @@ -0,0 +1,582 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * DokuDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class DokuDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DokuDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'shopper_email' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'first_name' => null, + 'last_name' => null, + 'shopper_email' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'first_name' => false, + 'last_name' => false, + 'shopper_email' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'shopper_email' => 'shopperEmail', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'shopper_email' => 'setShopperEmail', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'shopper_email' => 'getShopperEmail', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_MANDIRI_VA = 'doku_mandiri_va'; + public const TYPE_CIMB_VA = 'doku_cimb_va'; + public const TYPE_DANAMON_VA = 'doku_danamon_va'; + public const TYPE_BNI_VA = 'doku_bni_va'; + public const TYPE_PERMATA_LITE_ATM = 'doku_permata_lite_atm'; + public const TYPE_BRI_VA = 'doku_bri_va'; + public const TYPE_BCA_VA = 'doku_bca_va'; + public const TYPE_ALFAMART = 'doku_alfamart'; + public const TYPE_INDOMARET = 'doku_indomaret'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MANDIRI_VA, + self::TYPE_CIMB_VA, + self::TYPE_DANAMON_VA, + self::TYPE_BNI_VA, + self::TYPE_PERMATA_LITE_ATM, + self::TYPE_BRI_VA, + self::TYPE_BCA_VA, + self::TYPE_ALFAMART, + self::TYPE_INDOMARET, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['first_name'] === null) { + $invalidProperties[] = "'first_name' can't be null"; + } + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' can't be null"; + } + if ($this->container['shopper_email'] === null) { + $invalidProperties[] = "'shopper_email' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets first_name + * + * @return string + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string $first_name The shopper's first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string $last_name The shopper's last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string $shopper_email The shopper's email. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **doku** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DonationResponse.php b/src/Adyen/Model/Checkout/DonationResponse.php new file mode 100644 index 000000000..aee6e2433 --- /dev/null +++ b/src/Adyen/Model/Checkout/DonationResponse.php @@ -0,0 +1,626 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * DonationResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class DonationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DonationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'donation_account' => 'string', + 'id' => 'string', + 'merchant_account' => 'string', + 'payment' => '\Adyen\Model\Checkout\PaymentResponse', + 'reference' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'donation_account' => null, + 'id' => null, + 'merchant_account' => null, + 'payment' => null, + 'reference' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'donation_account' => false, + 'id' => false, + 'merchant_account' => false, + 'payment' => false, + 'reference' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'donation_account' => 'donationAccount', + 'id' => 'id', + 'merchant_account' => 'merchantAccount', + 'payment' => 'payment', + 'reference' => 'reference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'donation_account' => 'setDonationAccount', + 'id' => 'setId', + 'merchant_account' => 'setMerchantAccount', + 'payment' => 'setPayment', + 'reference' => 'setReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'donation_account' => 'getDonationAccount', + 'id' => 'getId', + 'merchant_account' => 'getMerchantAccount', + 'payment' => 'getPayment', + 'reference' => 'getReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_COMPLETED = 'completed'; + public const STATUS_PENDING = 'pending'; + public const STATUS_REFUSED = 'refused'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_COMPLETED, + self::STATUS_PENDING, + self::STATUS_REFUSED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('donation_account', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets donation_account + * + * @return string|null + */ + public function getDonationAccount() + { + return $this->container['donation_account']; + } + + /** + * Sets donation_account + * + * @param string|null $donation_account The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). + * + * @return self + */ + public function setDonationAccount($donation_account) + { + if (is_null($donation_account)) { + throw new \InvalidArgumentException('non-nullable donation_account cannot be null'); + } + $this->container['donation_account'] = $donation_account; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Your unique resource identifier. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets payment + * + * @return \Adyen\Model\Checkout\PaymentResponse|null + */ + public function getPayment() + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \Adyen\Model\Checkout\PaymentResponse|null $payment payment + * + * @return self + */ + public function setPayment($payment) + { + if (is_null($payment)) { + throw new \InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DotpayDetails.php b/src/Adyen/Model/Checkout/DotpayDetails.php new file mode 100644 index 000000000..176ae24fb --- /dev/null +++ b/src/Adyen/Model/Checkout/DotpayDetails.php @@ -0,0 +1,489 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * DotpayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class DotpayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DotpayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'issuer' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'issuer' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'issuer' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DOTPAY = 'dotpay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DOTPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'dotpay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The Dotpay issuer value of the shopper's selected bank. Set this to an **id** of a Dotpay issuer to preselect it. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **dotpay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/DragonpayDetails.php b/src/Adyen/Model/Checkout/DragonpayDetails.php new file mode 100644 index 000000000..4f1255b24 --- /dev/null +++ b/src/Adyen/Model/Checkout/DragonpayDetails.php @@ -0,0 +1,532 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * DragonpayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class DragonpayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DragonpayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'issuer' => 'string', + 'shopper_email' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'issuer' => null, + 'shopper_email' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'issuer' => false, + 'shopper_email' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'shopper_email' => 'shopperEmail', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'shopper_email' => 'setShopperEmail', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'shopper_email' => 'getShopperEmail', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_EBANKING = 'dragonpay_ebanking'; + public const TYPE_OTC_BANKING = 'dragonpay_otc_banking'; + public const TYPE_OTC_NON_BANKING = 'dragonpay_otc_non_banking'; + public const TYPE_OTC_PHILIPPINES = 'dragonpay_otc_philippines'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_EBANKING, + self::TYPE_OTC_BANKING, + self::TYPE_OTC_NON_BANKING, + self::TYPE_OTC_PHILIPPINES, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper’s email address. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **dragonpay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/EcontextVoucherDetails.php b/src/Adyen/Model/Checkout/EcontextVoucherDetails.php new file mode 100644 index 000000000..7868d0b6c --- /dev/null +++ b/src/Adyen/Model/Checkout/EcontextVoucherDetails.php @@ -0,0 +1,605 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * EcontextVoucherDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class EcontextVoucherDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EcontextVoucherDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'shopper_email' => 'string', + 'telephone_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'first_name' => null, + 'last_name' => null, + 'shopper_email' => null, + 'telephone_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'first_name' => false, + 'last_name' => false, + 'shopper_email' => false, + 'telephone_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'shopper_email' => 'shopperEmail', + 'telephone_number' => 'telephoneNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'shopper_email' => 'setShopperEmail', + 'telephone_number' => 'setTelephoneNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'shopper_email' => 'getShopperEmail', + 'telephone_number' => 'getTelephoneNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SEVENELEVEN = 'econtext_seveneleven'; + public const TYPE_STORES = 'econtext_stores'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SEVENELEVEN, + self::TYPE_STORES, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['first_name'] === null) { + $invalidProperties[] = "'first_name' can't be null"; + } + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' can't be null"; + } + if ($this->container['shopper_email'] === null) { + $invalidProperties[] = "'shopper_email' can't be null"; + } + if ($this->container['telephone_number'] === null) { + $invalidProperties[] = "'telephone_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets first_name + * + * @return string + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string $first_name The shopper's first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string $last_name The shopper's last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string $shopper_email The shopper's email. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string $telephone_number The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **econtextvoucher** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ExternalPlatform.php b/src/Adyen/Model/Checkout/ExternalPlatform.php new file mode 100644 index 000000000..3a5610fa3 --- /dev/null +++ b/src/Adyen/Model/Checkout/ExternalPlatform.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ExternalPlatform Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ExternalPlatform implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExternalPlatform'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'integrator' => 'string', + 'name' => 'string', + 'version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'integrator' => null, + 'name' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'integrator' => false, + 'name' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'integrator' => 'integrator', + 'name' => 'name', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'integrator' => 'setIntegrator', + 'name' => 'setName', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'integrator' => 'getIntegrator', + 'name' => 'getName', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('integrator', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets integrator + * + * @return string|null + */ + public function getIntegrator() + { + return $this->container['integrator']; + } + + /** + * Sets integrator + * + * @param string|null $integrator External platform integrator. + * + * @return self + */ + public function setIntegrator($integrator) + { + if (is_null($integrator)) { + throw new \InvalidArgumentException('non-nullable integrator cannot be null'); + } + $this->container['integrator'] = $integrator; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the field. For example, Name of External Platform. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version Version of the field. For example, Version of External Platform. + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ForexQuote.php b/src/Adyen/Model/Checkout/ForexQuote.php new file mode 100644 index 000000000..fdcbd687f --- /dev/null +++ b/src/Adyen/Model/Checkout/ForexQuote.php @@ -0,0 +1,765 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ForexQuote Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ForexQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexQuote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account' => 'string', + 'account_type' => 'string', + 'base_amount' => '\Adyen\Model\Checkout\Amount', + 'base_points' => 'int', + 'buy' => '\Adyen\Model\Checkout\Amount', + 'interbank' => '\Adyen\Model\Checkout\Amount', + 'reference' => 'string', + 'sell' => '\Adyen\Model\Checkout\Amount', + 'signature' => 'string', + 'source' => 'string', + 'type' => 'string', + 'valid_till' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account' => null, + 'account_type' => null, + 'base_amount' => null, + 'base_points' => 'int32', + 'buy' => null, + 'interbank' => null, + 'reference' => null, + 'sell' => null, + 'signature' => null, + 'source' => null, + 'type' => null, + 'valid_till' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account' => false, + 'account_type' => false, + 'base_amount' => false, + 'base_points' => true, + 'buy' => false, + 'interbank' => false, + 'reference' => false, + 'sell' => false, + 'signature' => false, + 'source' => false, + 'type' => false, + 'valid_till' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'account_type' => 'accountType', + 'base_amount' => 'baseAmount', + 'base_points' => 'basePoints', + 'buy' => 'buy', + 'interbank' => 'interbank', + 'reference' => 'reference', + 'sell' => 'sell', + 'signature' => 'signature', + 'source' => 'source', + 'type' => 'type', + 'valid_till' => 'validTill' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'account_type' => 'setAccountType', + 'base_amount' => 'setBaseAmount', + 'base_points' => 'setBasePoints', + 'buy' => 'setBuy', + 'interbank' => 'setInterbank', + 'reference' => 'setReference', + 'sell' => 'setSell', + 'signature' => 'setSignature', + 'source' => 'setSource', + 'type' => 'setType', + 'valid_till' => 'setValidTill' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'account_type' => 'getAccountType', + 'base_amount' => 'getBaseAmount', + 'base_points' => 'getBasePoints', + 'buy' => 'getBuy', + 'interbank' => 'getInterbank', + 'reference' => 'getReference', + 'sell' => 'getSell', + 'signature' => 'getSignature', + 'source' => 'getSource', + 'type' => 'getType', + 'valid_till' => 'getValidTill' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('account_type', $data ?? [], null); + $this->setIfExists('base_amount', $data ?? [], null); + $this->setIfExists('base_points', $data ?? [], null); + $this->setIfExists('buy', $data ?? [], null); + $this->setIfExists('interbank', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('sell', $data ?? [], null); + $this->setIfExists('signature', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('valid_till', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['base_points'] === null) { + $invalidProperties[] = "'base_points' can't be null"; + } + if ($this->container['valid_till'] === null) { + $invalidProperties[] = "'valid_till' 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 account + * + * @return string|null + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param string|null $account The account name. + * + * @return self + */ + public function setAccount($account) + { + if (is_null($account)) { + throw new \InvalidArgumentException('non-nullable account cannot be null'); + } + $this->container['account'] = $account; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type The account type. + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets base_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getBaseAmount() + { + return $this->container['base_amount']; + } + + /** + * Sets base_amount + * + * @param \Adyen\Model\Checkout\Amount|null $base_amount base_amount + * + * @return self + */ + public function setBaseAmount($base_amount) + { + if (is_null($base_amount)) { + throw new \InvalidArgumentException('non-nullable base_amount cannot be null'); + } + $this->container['base_amount'] = $base_amount; + + return $this; + } + + /** + * Gets base_points + * + * @return int + */ + public function getBasePoints() + { + return $this->container['base_points']; + } + + /** + * Sets base_points + * + * @param int $base_points The base points. + * + * @return self + */ + public function setBasePoints($base_points) + { + // Do nothing for nullable integers + $this->container['base_points'] = $base_points; + + return $this; + } + + /** + * Gets buy + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getBuy() + { + return $this->container['buy']; + } + + /** + * Sets buy + * + * @param \Adyen\Model\Checkout\Amount|null $buy buy + * + * @return self + */ + public function setBuy($buy) + { + if (is_null($buy)) { + throw new \InvalidArgumentException('non-nullable buy cannot be null'); + } + $this->container['buy'] = $buy; + + return $this; + } + + /** + * Gets interbank + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getInterbank() + { + return $this->container['interbank']; + } + + /** + * Sets interbank + * + * @param \Adyen\Model\Checkout\Amount|null $interbank interbank + * + * @return self + */ + public function setInterbank($interbank) + { + if (is_null($interbank)) { + throw new \InvalidArgumentException('non-nullable interbank cannot be null'); + } + $this->container['interbank'] = $interbank; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference assigned to the forex quote request. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets sell + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getSell() + { + return $this->container['sell']; + } + + /** + * Sets sell + * + * @param \Adyen\Model\Checkout\Amount|null $sell sell + * + * @return self + */ + public function setSell($sell) + { + if (is_null($sell)) { + throw new \InvalidArgumentException('non-nullable sell cannot be null'); + } + $this->container['sell'] = $sell; + + return $this; + } + + /** + * Gets signature + * + * @return string|null + */ + public function getSignature() + { + return $this->container['signature']; + } + + /** + * Sets signature + * + * @param string|null $signature The signature to validate the integrity. + * + * @return self + */ + public function setSignature($signature) + { + if (is_null($signature)) { + throw new \InvalidArgumentException('non-nullable signature cannot be null'); + } + $this->container['signature'] = $signature; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source The source of the forex quote. + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of forex. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets valid_till + * + * @return \DateTime + */ + public function getValidTill() + { + return $this->container['valid_till']; + } + + /** + * Sets valid_till + * + * @param \DateTime $valid_till The date until which the forex quote is valid. + * + * @return self + */ + public function setValidTill($valid_till) + { + if (is_null($valid_till)) { + throw new \InvalidArgumentException('non-nullable valid_till cannot be null'); + } + $this->container['valid_till'] = $valid_till; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/FraudCheckResult.php b/src/Adyen/Model/Checkout/FraudCheckResult.php new file mode 100644 index 000000000..40ad9aba6 --- /dev/null +++ b/src/Adyen/Model/Checkout/FraudCheckResult.php @@ -0,0 +1,460 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * FraudCheckResult Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class FraudCheckResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FraudCheckResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_score' => 'int', + 'check_id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_score' => 'int32', + 'check_id' => 'int32', + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_score' => true, + 'check_id' => true, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_score' => 'accountScore', + 'check_id' => 'checkId', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_score' => 'setAccountScore', + 'check_id' => 'setCheckId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_score' => 'getAccountScore', + 'check_id' => 'getCheckId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_score', $data ?? [], null); + $this->setIfExists('check_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_score'] === null) { + $invalidProperties[] = "'account_score' can't be null"; + } + if ($this->container['check_id'] === null) { + $invalidProperties[] = "'check_id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 account_score + * + * @return int + */ + public function getAccountScore() + { + return $this->container['account_score']; + } + + /** + * Sets account_score + * + * @param int $account_score The fraud score generated by the risk check. + * + * @return self + */ + public function setAccountScore($account_score) + { + // Do nothing for nullable integers + $this->container['account_score'] = $account_score; + + return $this; + } + + /** + * Gets check_id + * + * @return int + */ + public function getCheckId() + { + return $this->container['check_id']; + } + + /** + * Sets check_id + * + * @param int $check_id The ID of the risk check. + * + * @return self + */ + public function setCheckId($check_id) + { + // Do nothing for nullable integers + $this->container['check_id'] = $check_id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the risk check. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/FraudResult.php b/src/Adyen/Model/Checkout/FraudResult.php new file mode 100644 index 000000000..4c6d8f449 --- /dev/null +++ b/src/Adyen/Model/Checkout/FraudResult.php @@ -0,0 +1,422 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * FraudResult Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class FraudResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FraudResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_score' => 'int', + 'results' => '\Adyen\Model\Checkout\FraudCheckResult[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_score' => 'int32', + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_score' => true, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_score' => 'accountScore', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_score' => 'setAccountScore', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_score' => 'getAccountScore', + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_score', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_score'] === null) { + $invalidProperties[] = "'account_score' 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 account_score + * + * @return int + */ + public function getAccountScore() + { + return $this->container['account_score']; + } + + /** + * Sets account_score + * + * @param int $account_score The total fraud score generated by the risk checks. + * + * @return self + */ + public function setAccountScore($account_score) + { + // Do nothing for nullable integers + $this->container['account_score'] = $account_score; + + return $this; + } + + /** + * Gets results + * + * @return \Adyen\Model\Checkout\FraudCheckResult[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \Adyen\Model\Checkout\FraudCheckResult[]|null $results The result of the individual risk checks. + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/FundOrigin.php b/src/Adyen/Model/Checkout/FundOrigin.php new file mode 100644 index 000000000..b01feebfe --- /dev/null +++ b/src/Adyen/Model/Checkout/FundOrigin.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * FundOrigin Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class FundOrigin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FundOrigin'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'shopper_name' => '\Adyen\Model\Checkout\Name' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address' => null, + 'shopper_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address' => false, + 'shopper_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'shopper_name' => 'shopperName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'shopper_name' => 'setShopperName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'shopper_name' => 'getShopperName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/FundRecipient.php b/src/Adyen/Model/Checkout/FundRecipient.php new file mode 100644 index 000000000..c12fd3054 --- /dev/null +++ b/src/Adyen/Model/Checkout/FundRecipient.php @@ -0,0 +1,693 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * FundRecipient Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class FundRecipient implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FundRecipient'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'payment_method' => '\Adyen\Model\Checkout\CardDetails', + 'shopper_email' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'sub_merchant' => '\Adyen\Model\Checkout\SubMerchant', + 'telephone_number' => 'string', + 'wallet_identifier' => 'string', + 'wallet_owner_tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address' => null, + 'payment_method' => null, + 'shopper_email' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'stored_payment_method_id' => null, + 'sub_merchant' => null, + 'telephone_number' => null, + 'wallet_identifier' => null, + 'wallet_owner_tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address' => false, + 'payment_method' => false, + 'shopper_email' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'stored_payment_method_id' => false, + 'sub_merchant' => false, + 'telephone_number' => false, + 'wallet_identifier' => false, + 'wallet_owner_tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'payment_method' => 'paymentMethod', + 'shopper_email' => 'shopperEmail', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'sub_merchant' => 'subMerchant', + 'telephone_number' => 'telephoneNumber', + 'wallet_identifier' => 'walletIdentifier', + 'wallet_owner_tax_id' => 'walletOwnerTaxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'payment_method' => 'setPaymentMethod', + 'shopper_email' => 'setShopperEmail', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'sub_merchant' => 'setSubMerchant', + 'telephone_number' => 'setTelephoneNumber', + 'wallet_identifier' => 'setWalletIdentifier', + 'wallet_owner_tax_id' => 'setWalletOwnerTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'payment_method' => 'getPaymentMethod', + 'shopper_email' => 'getShopperEmail', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'sub_merchant' => 'getSubMerchant', + 'telephone_number' => 'getTelephoneNumber', + 'wallet_identifier' => 'getWalletIdentifier', + 'wallet_owner_tax_id' => 'getWalletOwnerTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('sub_merchant', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('wallet_identifier', $data ?? [], null); + $this->setIfExists('wallet_owner_tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Adyen\Model\Checkout\CardDetails|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Adyen\Model\Checkout\CardDetails|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email the email address of the person + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets sub_merchant + * + * @return \Adyen\Model\Checkout\SubMerchant|null + */ + public function getSubMerchant() + { + return $this->container['sub_merchant']; + } + + /** + * Sets sub_merchant + * + * @param \Adyen\Model\Checkout\SubMerchant|null $sub_merchant sub_merchant + * + * @return self + */ + public function setSubMerchant($sub_merchant) + { + if (is_null($sub_merchant)) { + throw new \InvalidArgumentException('non-nullable sub_merchant cannot be null'); + } + $this->container['sub_merchant'] = $sub_merchant; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number the telephone number of the person + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets wallet_identifier + * + * @return string|null + */ + public function getWalletIdentifier() + { + return $this->container['wallet_identifier']; + } + + /** + * Sets wallet_identifier + * + * @param string|null $wallet_identifier indicates where the money is going + * + * @return self + */ + public function setWalletIdentifier($wallet_identifier) + { + if (is_null($wallet_identifier)) { + throw new \InvalidArgumentException('non-nullable wallet_identifier cannot be null'); + } + $this->container['wallet_identifier'] = $wallet_identifier; + + return $this; + } + + /** + * Gets wallet_owner_tax_id + * + * @return string|null + */ + public function getWalletOwnerTaxId() + { + return $this->container['wallet_owner_tax_id']; + } + + /** + * Sets wallet_owner_tax_id + * + * @param string|null $wallet_owner_tax_id indicates the tax identifier of the fund recepient + * + * @return self + */ + public function setWalletOwnerTaxId($wallet_owner_tax_id) + { + if (is_null($wallet_owner_tax_id)) { + throw new \InvalidArgumentException('non-nullable wallet_owner_tax_id cannot be null'); + } + $this->container['wallet_owner_tax_id'] = $wallet_owner_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php b/src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php new file mode 100644 index 000000000..bee2c30aa --- /dev/null +++ b/src/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.php @@ -0,0 +1,568 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * GenericIssuerPaymentMethodDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class GenericIssuerPaymentMethodDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericIssuerPaymentMethodDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'issuer' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'issuer' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'issuer' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_ONLINE_BANKING_PL = 'onlineBanking_PL'; + public const TYPE_EPS = 'eps'; + public const TYPE_ONLINE_BANKING_SK = 'onlineBanking_SK'; + public const TYPE_ONLINE_BANKING_CZ = 'onlineBanking_CZ'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ONLINE_BANKING_PL, + self::TYPE_EPS, + self::TYPE_ONLINE_BANKING_SK, + self::TYPE_ONLINE_BANKING_CZ, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The issuer id of the shopper's selected bank. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **genericissuer** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/GiropayDetails.php b/src/Adyen/Model/Checkout/GiropayDetails.php new file mode 100644 index 000000000..a21d8e75f --- /dev/null +++ b/src/Adyen/Model/Checkout/GiropayDetails.php @@ -0,0 +1,522 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * GiropayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class GiropayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GiropayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GIROPAY = 'giropay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GIROPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'giropay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **giropay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/GooglePayDetails.php b/src/Adyen/Model/Checkout/GooglePayDetails.php new file mode 100644 index 000000000..625edaf29 --- /dev/null +++ b/src/Adyen/Model/Checkout/GooglePayDetails.php @@ -0,0 +1,624 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * GooglePayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class GooglePayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GooglePayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'funding_source' => 'string', + 'google_pay_token' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'funding_source' => null, + 'google_pay_token' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'funding_source' => false, + 'google_pay_token' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'funding_source' => 'fundingSource', + 'google_pay_token' => 'googlePayToken', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'funding_source' => 'setFundingSource', + 'google_pay_token' => 'setGooglePayToken', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'funding_source' => 'getFundingSource', + 'google_pay_token' => 'getGooglePayToken', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_GOOGLEPAY = 'googlepay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GOOGLEPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('google_pay_token', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'googlepay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['google_pay_token'] === null) { + $invalidProperties[] = "'google_pay_token' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets google_pay_token + * + * @return string + */ + public function getGooglePayToken() + { + return $this->container['google_pay_token']; + } + + /** + * Sets google_pay_token + * + * @param string $google_pay_token The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + * + * @return self + */ + public function setGooglePayToken($google_pay_token) + { + if (is_null($google_pay_token)) { + throw new \InvalidArgumentException('non-nullable google_pay_token cannot be null'); + } + $this->container['google_pay_token'] = $google_pay_token; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **googlepay**, **paywithgoogle** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/IdealDetails.php b/src/Adyen/Model/Checkout/IdealDetails.php new file mode 100644 index 000000000..6b68d65cd --- /dev/null +++ b/src/Adyen/Model/Checkout/IdealDetails.php @@ -0,0 +1,559 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * IdealDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class IdealDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IdealDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'issuer' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'issuer' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'issuer' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_IDEAL = 'ideal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IDEAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'ideal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **ideal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/InputDetail.php b/src/Adyen/Model/Checkout/InputDetail.php new file mode 100644 index 000000000..140afcdd7 --- /dev/null +++ b/src/Adyen/Model/Checkout/InputDetail.php @@ -0,0 +1,661 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * InputDetail Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class InputDetail implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InputDetail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'configuration' => 'array', + 'details' => '\Adyen\Model\Checkout\SubInputDetail[]', + 'input_details' => '\Adyen\Model\Checkout\SubInputDetail[]', + 'item_search_url' => 'string', + 'items' => '\Adyen\Model\Checkout\Item[]', + 'key' => 'string', + 'optional' => 'bool', + 'type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'configuration' => null, + 'details' => null, + 'input_details' => null, + 'item_search_url' => null, + 'items' => null, + 'key' => null, + 'optional' => null, + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'configuration' => false, + 'details' => false, + 'input_details' => false, + 'item_search_url' => false, + 'items' => false, + 'key' => false, + 'optional' => false, + 'type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'configuration' => 'configuration', + 'details' => 'details', + 'input_details' => 'inputDetails', + 'item_search_url' => 'itemSearchUrl', + 'items' => 'items', + 'key' => 'key', + 'optional' => 'optional', + 'type' => 'type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'configuration' => 'setConfiguration', + 'details' => 'setDetails', + 'input_details' => 'setInputDetails', + 'item_search_url' => 'setItemSearchUrl', + 'items' => 'setItems', + 'key' => 'setKey', + 'optional' => 'setOptional', + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'configuration' => 'getConfiguration', + 'details' => 'getDetails', + 'input_details' => 'getInputDetails', + 'item_search_url' => 'getItemSearchUrl', + 'items' => 'getItems', + 'key' => 'getKey', + 'optional' => 'getOptional', + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('details', $data ?? [], null); + $this->setIfExists('input_details', $data ?? [], null); + $this->setIfExists('item_search_url', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('optional', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 configuration + * + * @return array|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param array|null $configuration Configuration parameters for the required input. + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets details + * + * @return \Adyen\Model\Checkout\SubInputDetail[]|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \Adyen\Model\Checkout\SubInputDetail[]|null $details Input details can also be provided recursively. + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; + + return $this; + } + + /** + * Gets input_details + * + * @return \Adyen\Model\Checkout\SubInputDetail[]|null + * @deprecated + */ + public function getInputDetails() + { + return $this->container['input_details']; + } + + /** + * Sets input_details + * + * @param \Adyen\Model\Checkout\SubInputDetail[]|null $input_details Input details can also be provided recursively (deprecated). + * + * @return self + * @deprecated + */ + public function setInputDetails($input_details) + { + if (is_null($input_details)) { + throw new \InvalidArgumentException('non-nullable input_details cannot be null'); + } + $this->container['input_details'] = $input_details; + + return $this; + } + + /** + * Gets item_search_url + * + * @return string|null + */ + public function getItemSearchUrl() + { + return $this->container['item_search_url']; + } + + /** + * Sets item_search_url + * + * @param string|null $item_search_url In case of a select, the URL from which to query the items. + * + * @return self + */ + public function setItemSearchUrl($item_search_url) + { + if (is_null($item_search_url)) { + throw new \InvalidArgumentException('non-nullable item_search_url cannot be null'); + } + $this->container['item_search_url'] = $item_search_url; + + return $this; + } + + /** + * Gets items + * + * @return \Adyen\Model\Checkout\Item[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Adyen\Model\Checkout\Item[]|null $items In case of a select, the items to choose from. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The value to provide in the result. + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets optional + * + * @return bool|null + */ + public function getOptional() + { + return $this->container['optional']; + } + + /** + * Sets optional + * + * @param bool|null $optional True if this input value is optional. + * + * @return self + */ + public function setOptional($optional) + { + if (is_null($optional)) { + throw new \InvalidArgumentException('non-nullable optional cannot be null'); + } + $this->container['optional'] = $optional; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the required input. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value can be pre-filled, if available. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/InstallmentOption.php b/src/Adyen/Model/Checkout/InstallmentOption.php new file mode 100644 index 000000000..4c9813879 --- /dev/null +++ b/src/Adyen/Model/Checkout/InstallmentOption.php @@ -0,0 +1,508 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * InstallmentOption Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class InstallmentOption implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InstallmentOption'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_value' => 'int', + 'plans' => 'string[]', + 'preselected_value' => 'int', + 'values' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_value' => 'int32', + 'plans' => null, + 'preselected_value' => 'int32', + 'values' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'max_value' => true, + 'plans' => false, + 'preselected_value' => true, + 'values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'max_value' => 'maxValue', + 'plans' => 'plans', + 'preselected_value' => 'preselectedValue', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_value' => 'setMaxValue', + 'plans' => 'setPlans', + 'preselected_value' => 'setPreselectedValue', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_value' => 'getMaxValue', + 'plans' => 'getPlans', + 'preselected_value' => 'getPreselectedValue', + 'values' => 'getValues' + ]; + + /** + * 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 PLANS_REGULAR = 'regular'; + public const PLANS_REVOLVING = 'revolving'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPlansAllowableValues() + { + return [ + self::PLANS_REGULAR, + self::PLANS_REVOLVING, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('max_value', $data ?? [], null); + $this->setIfExists('plans', $data ?? [], null); + $this->setIfExists('preselected_value', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets max_value + * + * @return int|null + */ + public function getMaxValue() + { + return $this->container['max_value']; + } + + /** + * Sets max_value + * + * @param int|null $max_value The maximum number of installments offered for this payment method. + * + * @return self + */ + public function setMaxValue($max_value) + { + // Do nothing for nullable integers + $this->container['max_value'] = $max_value; + + return $this; + } + + /** + * Gets plans + * + * @return string[]|null + */ + public function getPlans() + { + return $this->container['plans']; + } + + /** + * Sets plans + * + * @param string[]|null $plans Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + * + * @return self + */ + public function setPlans($plans) + { + if (is_null($plans)) { + throw new \InvalidArgumentException('non-nullable plans cannot be null'); + } + $allowedValues = $this->getPlansAllowableValues(); + if (array_diff($plans, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'plans', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['plans'] = $plans; + + return $this; + } + + /** + * Gets preselected_value + * + * @return int|null + */ + public function getPreselectedValue() + { + return $this->container['preselected_value']; + } + + /** + * Sets preselected_value + * + * @param int|null $preselected_value Preselected number of installments offered for this payment method. + * + * @return self + */ + public function setPreselectedValue($preselected_value) + { + // Do nothing for nullable integers + $this->container['preselected_value'] = $preselected_value; + + return $this; + } + + /** + * Gets values + * + * @return int[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param int[]|null $values An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Installments.php b/src/Adyen/Model/Checkout/Installments.php new file mode 100644 index 000000000..f04fd5c86 --- /dev/null +++ b/src/Adyen/Model/Checkout/Installments.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Installments Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Installments implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Installments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plan' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plan' => null, + 'value' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'plan' => false, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plan' => 'plan', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plan' => 'setPlan', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plan' => 'getPlan', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const PLAN_REGULAR = 'regular'; + public const PLAN_REVOLVING = 'revolving'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPlanAllowableValues() + { + return [ + self::PLAN_REGULAR, + self::PLAN_REVOLVING, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('plan', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getPlanAllowableValues(); + if (!is_null($this->container['plan']) && !in_array($this->container['plan'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'plan', must be one of '%s'", + $this->container['plan'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plan + * + * @return string|null + */ + public function getPlan() + { + return $this->container['plan']; + } + + /** + * Sets plan + * + * @param string|null $plan The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + * + * @return self + */ + public function setPlan($plan) + { + if (is_null($plan)) { + throw new \InvalidArgumentException('non-nullable plan cannot be null'); + } + $allowedValues = $this->getPlanAllowableValues(); + if (!in_array($plan, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'plan', must be one of '%s'", + $plan, + implode("', '", $allowedValues) + ) + ); + } + $this->container['plan'] = $plan; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. + * + * @return self + */ + public function setValue($value) + { + // Do nothing for nullable integers + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/InstallmentsNumber.php b/src/Adyen/Model/Checkout/InstallmentsNumber.php new file mode 100644 index 000000000..a4bc74d57 --- /dev/null +++ b/src/Adyen/Model/Checkout/InstallmentsNumber.php @@ -0,0 +1,388 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * InstallmentsNumber Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class InstallmentsNumber implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InstallmentsNumber'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_number_of_installments' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_number_of_installments' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'max_number_of_installments' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'max_number_of_installments' => 'maxNumberOfInstallments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_number_of_installments' => 'setMaxNumberOfInstallments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_number_of_installments' => 'getMaxNumberOfInstallments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('max_number_of_installments', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['max_number_of_installments'] === null) { + $invalidProperties[] = "'max_number_of_installments' 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 max_number_of_installments + * + * @return int + */ + public function getMaxNumberOfInstallments() + { + return $this->container['max_number_of_installments']; + } + + /** + * Sets max_number_of_installments + * + * @param int $max_number_of_installments Maximum number of installments + * + * @return self + */ + public function setMaxNumberOfInstallments($max_number_of_installments) + { + // Do nothing for nullable integers + $this->container['max_number_of_installments'] = $max_number_of_installments; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Item.php b/src/Adyen/Model/Checkout/Item.php new file mode 100644 index 000000000..229db94e9 --- /dev/null +++ b/src/Adyen/Model/Checkout/Item.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Item Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Item implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + '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, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The value to provide in the result. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The display name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/KlarnaDetails.php b/src/Adyen/Model/Checkout/KlarnaDetails.php new file mode 100644 index 000000000..b12a2950c --- /dev/null +++ b/src/Adyen/Model/Checkout/KlarnaDetails.php @@ -0,0 +1,639 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * KlarnaDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class KlarnaDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'KlarnaDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address' => 'string', + 'checkout_attempt_id' => 'string', + 'delivery_address' => 'string', + 'personal_details' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address' => null, + 'checkout_attempt_id' => null, + 'delivery_address' => null, + 'personal_details' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address' => false, + 'checkout_attempt_id' => false, + 'delivery_address' => false, + 'personal_details' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'delivery_address' => 'deliveryAddress', + 'personal_details' => 'personalDetails', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'delivery_address' => 'setDeliveryAddress', + 'personal_details' => 'setPersonalDetails', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'delivery_address' => 'getDeliveryAddress', + 'personal_details' => 'getPersonalDetails', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_KLARNA = 'klarna'; + public const TYPE_KLARNAPAYMENTS = 'klarnapayments'; + public const TYPE_KLARNAPAYMENTS_ACCOUNT = 'klarnapayments_account'; + public const TYPE_KLARNAPAYMENTS_B2B = 'klarnapayments_b2b'; + public const TYPE_KLARNA_PAYNOW = 'klarna_paynow'; + public const TYPE_KLARNA_ACCOUNT = 'klarna_account'; + public const TYPE_KLARNA_B2B = 'klarna_b2b'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_KLARNA, + self::TYPE_KLARNAPAYMENTS, + self::TYPE_KLARNAPAYMENTS_ACCOUNT, + self::TYPE_KLARNAPAYMENTS_B2B, + self::TYPE_KLARNA_PAYNOW, + self::TYPE_KLARNA_ACCOUNT, + self::TYPE_KLARNA_B2B, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('personal_details', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'klarna'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_address + * + * @return string|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param string|null $billing_address The address where to send the invoice. + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets delivery_address + * + * @return string|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param string|null $delivery_address The address where the goods should be delivered. + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets personal_details + * + * @return string|null + */ + public function getPersonalDetails() + { + return $this->container['personal_details']; + } + + /** + * Sets personal_details + * + * @param string|null $personal_details Shopper name, date of birth, phone number, and email address. + * + * @return self + */ + public function setPersonalDetails($personal_details) + { + if (is_null($personal_details)) { + throw new \InvalidArgumentException('non-nullable personal_details cannot be null'); + } + $this->container['personal_details'] = $personal_details; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **klarna** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/LineItem.php b/src/Adyen/Model/Checkout/LineItem.php new file mode 100644 index 000000000..7752d045b --- /dev/null +++ b/src/Adyen/Model/Checkout/LineItem.php @@ -0,0 +1,931 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * LineItem Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class LineItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LineItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount_excluding_tax' => 'int', + 'amount_including_tax' => 'int', + 'brand' => 'string', + 'color' => 'string', + 'description' => 'string', + 'id' => 'string', + 'image_url' => 'string', + 'item_category' => 'string', + 'manufacturer' => 'string', + 'product_url' => 'string', + 'quantity' => 'int', + 'receiver_email' => 'string', + 'size' => 'string', + 'sku' => 'string', + 'tax_amount' => 'int', + 'tax_percentage' => 'int', + 'upc' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount_excluding_tax' => 'int64', + 'amount_including_tax' => 'int64', + 'brand' => null, + 'color' => null, + 'description' => null, + 'id' => null, + 'image_url' => null, + 'item_category' => null, + 'manufacturer' => null, + 'product_url' => null, + 'quantity' => 'int64', + 'receiver_email' => null, + 'size' => null, + 'sku' => null, + 'tax_amount' => 'int64', + 'tax_percentage' => 'int64', + 'upc' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount_excluding_tax' => false, + 'amount_including_tax' => false, + 'brand' => false, + 'color' => false, + 'description' => false, + 'id' => false, + 'image_url' => false, + 'item_category' => false, + 'manufacturer' => false, + 'product_url' => false, + 'quantity' => false, + 'receiver_email' => false, + 'size' => false, + 'sku' => false, + 'tax_amount' => false, + 'tax_percentage' => false, + 'upc' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount_excluding_tax' => 'amountExcludingTax', + 'amount_including_tax' => 'amountIncludingTax', + 'brand' => 'brand', + 'color' => 'color', + 'description' => 'description', + 'id' => 'id', + 'image_url' => 'imageUrl', + 'item_category' => 'itemCategory', + 'manufacturer' => 'manufacturer', + 'product_url' => 'productUrl', + 'quantity' => 'quantity', + 'receiver_email' => 'receiverEmail', + 'size' => 'size', + 'sku' => 'sku', + 'tax_amount' => 'taxAmount', + 'tax_percentage' => 'taxPercentage', + 'upc' => 'upc' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount_excluding_tax' => 'setAmountExcludingTax', + 'amount_including_tax' => 'setAmountIncludingTax', + 'brand' => 'setBrand', + 'color' => 'setColor', + 'description' => 'setDescription', + 'id' => 'setId', + 'image_url' => 'setImageUrl', + 'item_category' => 'setItemCategory', + 'manufacturer' => 'setManufacturer', + 'product_url' => 'setProductUrl', + 'quantity' => 'setQuantity', + 'receiver_email' => 'setReceiverEmail', + 'size' => 'setSize', + 'sku' => 'setSku', + 'tax_amount' => 'setTaxAmount', + 'tax_percentage' => 'setTaxPercentage', + 'upc' => 'setUpc' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount_excluding_tax' => 'getAmountExcludingTax', + 'amount_including_tax' => 'getAmountIncludingTax', + 'brand' => 'getBrand', + 'color' => 'getColor', + 'description' => 'getDescription', + 'id' => 'getId', + 'image_url' => 'getImageUrl', + 'item_category' => 'getItemCategory', + 'manufacturer' => 'getManufacturer', + 'product_url' => 'getProductUrl', + 'quantity' => 'getQuantity', + 'receiver_email' => 'getReceiverEmail', + 'size' => 'getSize', + 'sku' => 'getSku', + 'tax_amount' => 'getTaxAmount', + 'tax_percentage' => 'getTaxPercentage', + 'upc' => 'getUpc' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount_excluding_tax', $data ?? [], null); + $this->setIfExists('amount_including_tax', $data ?? [], null); + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('image_url', $data ?? [], null); + $this->setIfExists('item_category', $data ?? [], null); + $this->setIfExists('manufacturer', $data ?? [], null); + $this->setIfExists('product_url', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('receiver_email', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('sku', $data ?? [], null); + $this->setIfExists('tax_amount', $data ?? [], null); + $this->setIfExists('tax_percentage', $data ?? [], null); + $this->setIfExists('upc', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount_excluding_tax + * + * @return int|null + */ + public function getAmountExcludingTax() + { + return $this->container['amount_excluding_tax']; + } + + /** + * Sets amount_excluding_tax + * + * @param int|null $amount_excluding_tax Item amount excluding the tax, in minor units. + * + * @return self + */ + public function setAmountExcludingTax($amount_excluding_tax) + { + if (is_null($amount_excluding_tax)) { + throw new \InvalidArgumentException('non-nullable amount_excluding_tax cannot be null'); + } + $this->container['amount_excluding_tax'] = $amount_excluding_tax; + + return $this; + } + + /** + * Gets amount_including_tax + * + * @return int|null + */ + public function getAmountIncludingTax() + { + return $this->container['amount_including_tax']; + } + + /** + * Sets amount_including_tax + * + * @param int|null $amount_including_tax Item amount including the tax, in minor units. + * + * @return self + */ + public function setAmountIncludingTax($amount_including_tax) + { + if (is_null($amount_including_tax)) { + throw new \InvalidArgumentException('non-nullable amount_including_tax cannot be null'); + } + $this->container['amount_including_tax'] = $amount_including_tax; + + return $this; + } + + /** + * Gets brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand Brand of the item. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color Color of the item. + * + * @return self + */ + public function setColor($color) + { + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); + } + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the line item. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id ID of the line item. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets image_url + * + * @return string|null + */ + public function getImageUrl() + { + return $this->container['image_url']; + } + + /** + * Sets image_url + * + * @param string|null $image_url Link to the picture of the purchased item. + * + * @return self + */ + public function setImageUrl($image_url) + { + if (is_null($image_url)) { + throw new \InvalidArgumentException('non-nullable image_url cannot be null'); + } + $this->container['image_url'] = $image_url; + + return $this; + } + + /** + * Gets item_category + * + * @return string|null + */ + public function getItemCategory() + { + return $this->container['item_category']; + } + + /** + * Sets item_category + * + * @param string|null $item_category Item category, used by the RatePay payment method. + * + * @return self + */ + public function setItemCategory($item_category) + { + if (is_null($item_category)) { + throw new \InvalidArgumentException('non-nullable item_category cannot be null'); + } + $this->container['item_category'] = $item_category; + + return $this; + } + + /** + * Gets manufacturer + * + * @return string|null + */ + public function getManufacturer() + { + return $this->container['manufacturer']; + } + + /** + * Sets manufacturer + * + * @param string|null $manufacturer Manufacturer of the item. + * + * @return self + */ + public function setManufacturer($manufacturer) + { + if (is_null($manufacturer)) { + throw new \InvalidArgumentException('non-nullable manufacturer cannot be null'); + } + $this->container['manufacturer'] = $manufacturer; + + return $this; + } + + /** + * Gets product_url + * + * @return string|null + */ + public function getProductUrl() + { + return $this->container['product_url']; + } + + /** + * Sets product_url + * + * @param string|null $product_url Link to the purchased item. + * + * @return self + */ + public function setProductUrl($product_url) + { + if (is_null($product_url)) { + throw new \InvalidArgumentException('non-nullable product_url cannot be null'); + } + $this->container['product_url'] = $product_url; + + return $this; + } + + /** + * Gets quantity + * + * @return int|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int|null $quantity Number of items. + * + * @return self + */ + public function setQuantity($quantity) + { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets receiver_email + * + * @return string|null + */ + public function getReceiverEmail() + { + return $this->container['receiver_email']; + } + + /** + * Sets receiver_email + * + * @param string|null $receiver_email Email associated with the given product in the basket (usually in electronic gift cards). + * + * @return self + */ + public function setReceiverEmail($receiver_email) + { + if (is_null($receiver_email)) { + throw new \InvalidArgumentException('non-nullable receiver_email cannot be null'); + } + $this->container['receiver_email'] = $receiver_email; + + return $this; + } + + /** + * Gets size + * + * @return string|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param string|null $size Size of the item. + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets sku + * + * @return string|null + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param string|null $sku Stock keeping unit. + * + * @return self + */ + public function setSku($sku) + { + if (is_null($sku)) { + throw new \InvalidArgumentException('non-nullable sku cannot be null'); + } + $this->container['sku'] = $sku; + + return $this; + } + + /** + * Gets tax_amount + * + * @return int|null + */ + public function getTaxAmount() + { + return $this->container['tax_amount']; + } + + /** + * Sets tax_amount + * + * @param int|null $tax_amount Tax amount, in minor units. + * + * @return self + */ + public function setTaxAmount($tax_amount) + { + if (is_null($tax_amount)) { + throw new \InvalidArgumentException('non-nullable tax_amount cannot be null'); + } + $this->container['tax_amount'] = $tax_amount; + + return $this; + } + + /** + * Gets tax_percentage + * + * @return int|null + */ + public function getTaxPercentage() + { + return $this->container['tax_percentage']; + } + + /** + * Sets tax_percentage + * + * @param int|null $tax_percentage Tax percentage, in minor units. + * + * @return self + */ + public function setTaxPercentage($tax_percentage) + { + if (is_null($tax_percentage)) { + throw new \InvalidArgumentException('non-nullable tax_percentage cannot be null'); + } + $this->container['tax_percentage'] = $tax_percentage; + + return $this; + } + + /** + * Gets upc + * + * @return string|null + */ + public function getUpc() + { + return $this->container['upc']; + } + + /** + * Sets upc + * + * @param string|null $upc Universal Product Code. + * + * @return self + */ + public function setUpc($upc) + { + if (is_null($upc)) { + throw new \InvalidArgumentException('non-nullable upc cannot be null'); + } + $this->container['upc'] = $upc; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php b/src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php new file mode 100644 index 000000000..29b6629b8 --- /dev/null +++ b/src/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ListStoredPaymentMethodsResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ListStoredPaymentMethodsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListStoredPaymentMethodsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'shopper_reference' => 'string', + 'stored_payment_methods' => '\Adyen\Model\Checkout\StoredPaymentMethodResource[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'shopper_reference' => null, + 'stored_payment_methods' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'shopper_reference' => false, + 'stored_payment_methods' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'shopper_reference' => 'shopperReference', + 'stored_payment_methods' => 'storedPaymentMethods' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'shopper_reference' => 'setShopperReference', + 'stored_payment_methods' => 'setStoredPaymentMethods' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'shopper_reference' => 'getShopperReference', + 'stored_payment_methods' => 'getStoredPaymentMethods' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('stored_payment_methods', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account Your merchant account. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets stored_payment_methods + * + * @return \Adyen\Model\Checkout\StoredPaymentMethodResource[]|null + */ + public function getStoredPaymentMethods() + { + return $this->container['stored_payment_methods']; + } + + /** + * Sets stored_payment_methods + * + * @param \Adyen\Model\Checkout\StoredPaymentMethodResource[]|null $stored_payment_methods List of all stored payment methods. + * + * @return self + */ + public function setStoredPaymentMethods($stored_payment_methods) + { + if (is_null($stored_payment_methods)) { + throw new \InvalidArgumentException('non-nullable stored_payment_methods cannot be null'); + } + $this->container['stored_payment_methods'] = $stored_payment_methods; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Mandate.php b/src/Adyen/Model/Checkout/Mandate.php new file mode 100644 index 000000000..ac13b906b --- /dev/null +++ b/src/Adyen/Model/Checkout/Mandate.php @@ -0,0 +1,747 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Mandate Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Mandate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Mandate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => 'string', + 'amount_rule' => 'string', + 'billing_attempts_rule' => 'string', + 'billing_day' => 'string', + 'ends_at' => 'string', + 'frequency' => 'string', + 'remarks' => 'string', + 'starts_at' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'amount_rule' => null, + 'billing_attempts_rule' => null, + 'billing_day' => null, + 'ends_at' => null, + 'frequency' => null, + 'remarks' => null, + 'starts_at' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'amount_rule' => false, + 'billing_attempts_rule' => false, + 'billing_day' => false, + 'ends_at' => false, + 'frequency' => false, + 'remarks' => false, + 'starts_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'amount_rule' => 'amountRule', + 'billing_attempts_rule' => 'billingAttemptsRule', + 'billing_day' => 'billingDay', + 'ends_at' => 'endsAt', + 'frequency' => 'frequency', + 'remarks' => 'remarks', + 'starts_at' => 'startsAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'amount_rule' => 'setAmountRule', + 'billing_attempts_rule' => 'setBillingAttemptsRule', + 'billing_day' => 'setBillingDay', + 'ends_at' => 'setEndsAt', + 'frequency' => 'setFrequency', + 'remarks' => 'setRemarks', + 'starts_at' => 'setStartsAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'amount_rule' => 'getAmountRule', + 'billing_attempts_rule' => 'getBillingAttemptsRule', + 'billing_day' => 'getBillingDay', + 'ends_at' => 'getEndsAt', + 'frequency' => 'getFrequency', + 'remarks' => 'getRemarks', + 'starts_at' => 'getStartsAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const AMOUNT_RULE_MAX = 'max'; + public const AMOUNT_RULE_EXACT = 'exact'; + public const BILLING_ATTEMPTS_RULE_ON = 'on'; + public const BILLING_ATTEMPTS_RULE_BEFORE = 'before'; + public const BILLING_ATTEMPTS_RULE_AFTER = 'after'; + public const FREQUENCY_ADHOC = 'adhoc'; + public const FREQUENCY_DAILY = 'daily'; + public const FREQUENCY_WEEKLY = 'weekly'; + public const FREQUENCY_BI_WEEKLY = 'biWeekly'; + public const FREQUENCY_MONTHLY = 'monthly'; + public const FREQUENCY_QUARTERLY = 'quarterly'; + public const FREQUENCY_HALF_YEARLY = 'halfYearly'; + public const FREQUENCY_YEARLY = 'yearly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAmountRuleAllowableValues() + { + return [ + self::AMOUNT_RULE_MAX, + self::AMOUNT_RULE_EXACT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBillingAttemptsRuleAllowableValues() + { + return [ + self::BILLING_ATTEMPTS_RULE_ON, + self::BILLING_ATTEMPTS_RULE_BEFORE, + self::BILLING_ATTEMPTS_RULE_AFTER, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFrequencyAllowableValues() + { + return [ + self::FREQUENCY_ADHOC, + self::FREQUENCY_DAILY, + self::FREQUENCY_WEEKLY, + self::FREQUENCY_BI_WEEKLY, + self::FREQUENCY_MONTHLY, + self::FREQUENCY_QUARTERLY, + self::FREQUENCY_HALF_YEARLY, + self::FREQUENCY_YEARLY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('amount_rule', $data ?? [], null); + $this->setIfExists('billing_attempts_rule', $data ?? [], null); + $this->setIfExists('billing_day', $data ?? [], null); + $this->setIfExists('ends_at', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('remarks', $data ?? [], null); + $this->setIfExists('starts_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getAmountRuleAllowableValues(); + if (!is_null($this->container['amount_rule']) && !in_array($this->container['amount_rule'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'amount_rule', must be one of '%s'", + $this->container['amount_rule'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getBillingAttemptsRuleAllowableValues(); + if (!is_null($this->container['billing_attempts_rule']) && !in_array($this->container['billing_attempts_rule'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'billing_attempts_rule', must be one of '%s'", + $this->container['billing_attempts_rule'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['ends_at'] === null) { + $invalidProperties[] = "'ends_at' can't be null"; + } + if ($this->container['frequency'] === null) { + $invalidProperties[] = "'frequency' can't be null"; + } + $allowedValues = $this->getFrequencyAllowableValues(); + if (!is_null($this->container['frequency']) && !in_array($this->container['frequency'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'frequency', must be one of '%s'", + $this->container['frequency'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return string + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string $amount The billing amount (in minor units) of the recurring transactions. + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets amount_rule + * + * @return string|null + */ + public function getAmountRule() + { + return $this->container['amount_rule']; + } + + /** + * Sets amount_rule + * + * @param string|null $amount_rule The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + * + * @return self + */ + public function setAmountRule($amount_rule) + { + if (is_null($amount_rule)) { + throw new \InvalidArgumentException('non-nullable amount_rule cannot be null'); + } + $allowedValues = $this->getAmountRuleAllowableValues(); + if (!in_array($amount_rule, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'amount_rule', must be one of '%s'", + $amount_rule, + implode("', '", $allowedValues) + ) + ); + } + $this->container['amount_rule'] = $amount_rule; + + return $this; + } + + /** + * Gets billing_attempts_rule + * + * @return string|null + */ + public function getBillingAttemptsRule() + { + return $this->container['billing_attempts_rule']; + } + + /** + * Sets billing_attempts_rule + * + * @param string|null $billing_attempts_rule The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + * + * @return self + */ + public function setBillingAttemptsRule($billing_attempts_rule) + { + if (is_null($billing_attempts_rule)) { + throw new \InvalidArgumentException('non-nullable billing_attempts_rule cannot be null'); + } + $allowedValues = $this->getBillingAttemptsRuleAllowableValues(); + if (!in_array($billing_attempts_rule, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'billing_attempts_rule', must be one of '%s'", + $billing_attempts_rule, + implode("', '", $allowedValues) + ) + ); + } + $this->container['billing_attempts_rule'] = $billing_attempts_rule; + + return $this; + } + + /** + * Gets billing_day + * + * @return string|null + */ + public function getBillingDay() + { + return $this->container['billing_day']; + } + + /** + * Sets billing_day + * + * @param string|null $billing_day The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. + * + * @return self + */ + public function setBillingDay($billing_day) + { + if (is_null($billing_day)) { + throw new \InvalidArgumentException('non-nullable billing_day cannot be null'); + } + $this->container['billing_day'] = $billing_day; + + return $this; + } + + /** + * Gets ends_at + * + * @return string + */ + public function getEndsAt() + { + return $this->container['ends_at']; + } + + /** + * Sets ends_at + * + * @param string $ends_at End date of the billing plan, in YYYY-MM-DD format. + * + * @return self + */ + public function setEndsAt($ends_at) + { + if (is_null($ends_at)) { + throw new \InvalidArgumentException('non-nullable ends_at cannot be null'); + } + $this->container['ends_at'] = $ends_at; + + return $this; + } + + /** + * Gets frequency + * + * @return string + */ + public function getFrequency() + { + return $this->container['frequency']; + } + + /** + * Sets frequency + * + * @param string $frequency The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. + * + * @return self + */ + public function setFrequency($frequency) + { + if (is_null($frequency)) { + throw new \InvalidArgumentException('non-nullable frequency cannot be null'); + } + $allowedValues = $this->getFrequencyAllowableValues(); + if (!in_array($frequency, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'frequency', must be one of '%s'", + $frequency, + implode("', '", $allowedValues) + ) + ); + } + $this->container['frequency'] = $frequency; + + return $this; + } + + /** + * Gets remarks + * + * @return string|null + */ + public function getRemarks() + { + return $this->container['remarks']; + } + + /** + * Sets remarks + * + * @param string|null $remarks The message shown by UPI to the shopper on the approval screen. + * + * @return self + */ + public function setRemarks($remarks) + { + if (is_null($remarks)) { + throw new \InvalidArgumentException('non-nullable remarks cannot be null'); + } + $this->container['remarks'] = $remarks; + + return $this; + } + + /** + * Gets starts_at + * + * @return string|null + */ + public function getStartsAt() + { + return $this->container['starts_at']; + } + + /** + * Sets starts_at + * + * @param string|null $starts_at Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. + * + * @return self + */ + public function setStartsAt($starts_at) + { + if (is_null($starts_at)) { + throw new \InvalidArgumentException('non-nullable starts_at cannot be null'); + } + $this->container['starts_at'] = $starts_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/MasterpassDetails.php b/src/Adyen/Model/Checkout/MasterpassDetails.php new file mode 100644 index 000000000..a6b4681ed --- /dev/null +++ b/src/Adyen/Model/Checkout/MasterpassDetails.php @@ -0,0 +1,554 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * MasterpassDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MasterpassDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MasterpassDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'funding_source' => 'string', + 'masterpass_transaction_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'funding_source' => null, + 'masterpass_transaction_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'funding_source' => false, + 'masterpass_transaction_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'funding_source' => 'fundingSource', + 'masterpass_transaction_id' => 'masterpassTransactionId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'funding_source' => 'setFundingSource', + 'masterpass_transaction_id' => 'setMasterpassTransactionId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'funding_source' => 'getFundingSource', + 'masterpass_transaction_id' => 'getMasterpassTransactionId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_MASTERPASS = 'masterpass'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MASTERPASS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('masterpass_transaction_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'masterpass'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['masterpass_transaction_id'] === null) { + $invalidProperties[] = "'masterpass_transaction_id' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets masterpass_transaction_id + * + * @return string + */ + public function getMasterpassTransactionId() + { + return $this->container['masterpass_transaction_id']; + } + + /** + * Sets masterpass_transaction_id + * + * @param string $masterpass_transaction_id The Masterpass transaction ID. + * + * @return self + */ + public function setMasterpassTransactionId($masterpass_transaction_id) + { + if (is_null($masterpass_transaction_id)) { + throw new \InvalidArgumentException('non-nullable masterpass_transaction_id cannot be null'); + } + $this->container['masterpass_transaction_id'] = $masterpass_transaction_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **masterpass** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/MbwayDetails.php b/src/Adyen/Model/Checkout/MbwayDetails.php new file mode 100644 index 000000000..d2c46a408 --- /dev/null +++ b/src/Adyen/Model/Checkout/MbwayDetails.php @@ -0,0 +1,526 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * MbwayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MbwayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MbwayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'shopper_email' => 'string', + 'telephone_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'shopper_email' => null, + 'telephone_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'shopper_email' => false, + 'telephone_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'shopper_email' => 'shopperEmail', + 'telephone_number' => 'telephoneNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'shopper_email' => 'setShopperEmail', + 'telephone_number' => 'setTelephoneNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'shopper_email' => 'getShopperEmail', + 'telephone_number' => 'getTelephoneNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_MBWAY = 'mbway'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MBWAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'mbway'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['shopper_email'] === null) { + $invalidProperties[] = "'shopper_email' can't be null"; + } + if ($this->container['telephone_number'] === null) { + $invalidProperties[] = "'telephone_number' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string $shopper_email + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string $telephone_number + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **mbway** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/MerchantDevice.php b/src/Adyen/Model/Checkout/MerchantDevice.php new file mode 100644 index 000000000..81adce706 --- /dev/null +++ b/src/Adyen/Model/Checkout/MerchantDevice.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * MerchantDevice Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MerchantDevice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantDevice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'os' => 'string', + 'os_version' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'os' => null, + 'os_version' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'os' => false, + 'os_version' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'os' => 'os', + 'os_version' => 'osVersion', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'os' => 'setOs', + 'os_version' => 'setOsVersion', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'os' => 'getOs', + 'os_version' => 'getOsVersion', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('os', $data ?? [], null); + $this->setIfExists('os_version', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets os + * + * @return string|null + */ + public function getOs() + { + return $this->container['os']; + } + + /** + * Sets os + * + * @param string|null $os Operating system running on the merchant device. + * + * @return self + */ + public function setOs($os) + { + if (is_null($os)) { + throw new \InvalidArgumentException('non-nullable os cannot be null'); + } + $this->container['os'] = $os; + + return $this; + } + + /** + * Gets os_version + * + * @return string|null + */ + public function getOsVersion() + { + return $this->container['os_version']; + } + + /** + * Sets os_version + * + * @param string|null $os_version Version of the operating system on the merchant device. + * + * @return self + */ + public function setOsVersion($os_version) + { + if (is_null($os_version)) { + throw new \InvalidArgumentException('non-nullable os_version cannot be null'); + } + $this->container['os_version'] = $os_version; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Merchant device reference. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/MerchantRiskIndicator.php b/src/Adyen/Model/Checkout/MerchantRiskIndicator.php new file mode 100644 index 000000000..714f3d7d8 --- /dev/null +++ b/src/Adyen/Model/Checkout/MerchantRiskIndicator.php @@ -0,0 +1,909 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * MerchantRiskIndicator Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MerchantRiskIndicator implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantRiskIndicator'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address_match' => 'bool', + 'delivery_address_indicator' => 'string', + 'delivery_email' => 'string', + 'delivery_email_address' => 'string', + 'delivery_timeframe' => 'string', + 'gift_card_amount' => '\Adyen\Model\Checkout\Amount', + 'gift_card_count' => 'int', + 'gift_card_curr' => 'string', + 'pre_order_date' => '\DateTime', + 'pre_order_purchase' => 'bool', + 'pre_order_purchase_ind' => 'string', + 'reorder_items' => 'bool', + 'reorder_items_ind' => 'string', + 'ship_indicator' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address_match' => null, + 'delivery_address_indicator' => null, + 'delivery_email' => null, + 'delivery_email_address' => null, + 'delivery_timeframe' => null, + 'gift_card_amount' => null, + 'gift_card_count' => 'int32', + 'gift_card_curr' => null, + 'pre_order_date' => 'date-time', + 'pre_order_purchase' => null, + 'pre_order_purchase_ind' => null, + 'reorder_items' => null, + 'reorder_items_ind' => null, + 'ship_indicator' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address_match' => false, + 'delivery_address_indicator' => false, + 'delivery_email' => false, + 'delivery_email_address' => false, + 'delivery_timeframe' => false, + 'gift_card_amount' => false, + 'gift_card_count' => true, + 'gift_card_curr' => false, + 'pre_order_date' => false, + 'pre_order_purchase' => false, + 'pre_order_purchase_ind' => false, + 'reorder_items' => false, + 'reorder_items_ind' => false, + 'ship_indicator' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address_match' => 'addressMatch', + 'delivery_address_indicator' => 'deliveryAddressIndicator', + 'delivery_email' => 'deliveryEmail', + 'delivery_email_address' => 'deliveryEmailAddress', + 'delivery_timeframe' => 'deliveryTimeframe', + 'gift_card_amount' => 'giftCardAmount', + 'gift_card_count' => 'giftCardCount', + 'gift_card_curr' => 'giftCardCurr', + 'pre_order_date' => 'preOrderDate', + 'pre_order_purchase' => 'preOrderPurchase', + 'pre_order_purchase_ind' => 'preOrderPurchaseInd', + 'reorder_items' => 'reorderItems', + 'reorder_items_ind' => 'reorderItemsInd', + 'ship_indicator' => 'shipIndicator' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address_match' => 'setAddressMatch', + 'delivery_address_indicator' => 'setDeliveryAddressIndicator', + 'delivery_email' => 'setDeliveryEmail', + 'delivery_email_address' => 'setDeliveryEmailAddress', + 'delivery_timeframe' => 'setDeliveryTimeframe', + 'gift_card_amount' => 'setGiftCardAmount', + 'gift_card_count' => 'setGiftCardCount', + 'gift_card_curr' => 'setGiftCardCurr', + 'pre_order_date' => 'setPreOrderDate', + 'pre_order_purchase' => 'setPreOrderPurchase', + 'pre_order_purchase_ind' => 'setPreOrderPurchaseInd', + 'reorder_items' => 'setReorderItems', + 'reorder_items_ind' => 'setReorderItemsInd', + 'ship_indicator' => 'setShipIndicator' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address_match' => 'getAddressMatch', + 'delivery_address_indicator' => 'getDeliveryAddressIndicator', + 'delivery_email' => 'getDeliveryEmail', + 'delivery_email_address' => 'getDeliveryEmailAddress', + 'delivery_timeframe' => 'getDeliveryTimeframe', + 'gift_card_amount' => 'getGiftCardAmount', + 'gift_card_count' => 'getGiftCardCount', + 'gift_card_curr' => 'getGiftCardCurr', + 'pre_order_date' => 'getPreOrderDate', + 'pre_order_purchase' => 'getPreOrderPurchase', + 'pre_order_purchase_ind' => 'getPreOrderPurchaseInd', + 'reorder_items' => 'getReorderItems', + 'reorder_items_ind' => 'getReorderItemsInd', + 'ship_indicator' => 'getShipIndicator' + ]; + + /** + * 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 DELIVERY_ADDRESS_INDICATOR_SHIP_TO_BILLING_ADDRESS = 'shipToBillingAddress'; + public const DELIVERY_ADDRESS_INDICATOR_SHIP_TO_VERIFIED_ADDRESS = 'shipToVerifiedAddress'; + public const DELIVERY_ADDRESS_INDICATOR_SHIP_TO_NEW_ADDRESS = 'shipToNewAddress'; + public const DELIVERY_ADDRESS_INDICATOR_SHIP_TO_STORE = 'shipToStore'; + public const DELIVERY_ADDRESS_INDICATOR_DIGITAL_GOODS = 'digitalGoods'; + public const DELIVERY_ADDRESS_INDICATOR_GOODS_NOT_SHIPPED = 'goodsNotShipped'; + public const DELIVERY_ADDRESS_INDICATOR_OTHER = 'other'; + public const DELIVERY_TIMEFRAME_ELECTRONIC_DELIVERY = 'electronicDelivery'; + public const DELIVERY_TIMEFRAME_SAME_DAY_SHIPPING = 'sameDayShipping'; + public const DELIVERY_TIMEFRAME_OVERNIGHT_SHIPPING = 'overnightShipping'; + public const DELIVERY_TIMEFRAME_TWO_OR_MORE_DAYS_SHIPPING = 'twoOrMoreDaysShipping'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeliveryAddressIndicatorAllowableValues() + { + return [ + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_BILLING_ADDRESS, + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_VERIFIED_ADDRESS, + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_NEW_ADDRESS, + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_STORE, + self::DELIVERY_ADDRESS_INDICATOR_DIGITAL_GOODS, + self::DELIVERY_ADDRESS_INDICATOR_GOODS_NOT_SHIPPED, + self::DELIVERY_ADDRESS_INDICATOR_OTHER, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeliveryTimeframeAllowableValues() + { + return [ + self::DELIVERY_TIMEFRAME_ELECTRONIC_DELIVERY, + self::DELIVERY_TIMEFRAME_SAME_DAY_SHIPPING, + self::DELIVERY_TIMEFRAME_OVERNIGHT_SHIPPING, + self::DELIVERY_TIMEFRAME_TWO_OR_MORE_DAYS_SHIPPING, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address_match', $data ?? [], null); + $this->setIfExists('delivery_address_indicator', $data ?? [], null); + $this->setIfExists('delivery_email', $data ?? [], null); + $this->setIfExists('delivery_email_address', $data ?? [], null); + $this->setIfExists('delivery_timeframe', $data ?? [], null); + $this->setIfExists('gift_card_amount', $data ?? [], null); + $this->setIfExists('gift_card_count', $data ?? [], null); + $this->setIfExists('gift_card_curr', $data ?? [], null); + $this->setIfExists('pre_order_date', $data ?? [], null); + $this->setIfExists('pre_order_purchase', $data ?? [], null); + $this->setIfExists('pre_order_purchase_ind', $data ?? [], null); + $this->setIfExists('reorder_items', $data ?? [], null); + $this->setIfExists('reorder_items_ind', $data ?? [], null); + $this->setIfExists('ship_indicator', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getDeliveryAddressIndicatorAllowableValues(); + if (!is_null($this->container['delivery_address_indicator']) && !in_array($this->container['delivery_address_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'delivery_address_indicator', must be one of '%s'", + $this->container['delivery_address_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDeliveryTimeframeAllowableValues(); + if (!is_null($this->container['delivery_timeframe']) && !in_array($this->container['delivery_timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'delivery_timeframe', must be one of '%s'", + $this->container['delivery_timeframe'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address_match + * + * @return bool|null + */ + public function getAddressMatch() + { + return $this->container['address_match']; + } + + /** + * Sets address_match + * + * @param bool|null $address_match Whether the chosen delivery address is identical to the billing address. + * + * @return self + */ + public function setAddressMatch($address_match) + { + if (is_null($address_match)) { + throw new \InvalidArgumentException('non-nullable address_match cannot be null'); + } + $this->container['address_match'] = $address_match; + + return $this; + } + + /** + * Gets delivery_address_indicator + * + * @return string|null + */ + public function getDeliveryAddressIndicator() + { + return $this->container['delivery_address_indicator']; + } + + /** + * Sets delivery_address_indicator + * + * @param string|null $delivery_address_indicator Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` + * + * @return self + */ + public function setDeliveryAddressIndicator($delivery_address_indicator) + { + if (is_null($delivery_address_indicator)) { + throw new \InvalidArgumentException('non-nullable delivery_address_indicator cannot be null'); + } + $allowedValues = $this->getDeliveryAddressIndicatorAllowableValues(); + if (!in_array($delivery_address_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'delivery_address_indicator', must be one of '%s'", + $delivery_address_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['delivery_address_indicator'] = $delivery_address_indicator; + + return $this; + } + + /** + * Gets delivery_email + * + * @return string|null + * @deprecated + */ + public function getDeliveryEmail() + { + return $this->container['delivery_email']; + } + + /** + * Sets delivery_email + * + * @param string|null $delivery_email The delivery email address (for digital goods). + * + * @return self + * @deprecated + */ + public function setDeliveryEmail($delivery_email) + { + if (is_null($delivery_email)) { + throw new \InvalidArgumentException('non-nullable delivery_email cannot be null'); + } + $this->container['delivery_email'] = $delivery_email; + + return $this; + } + + /** + * Gets delivery_email_address + * + * @return string|null + */ + public function getDeliveryEmailAddress() + { + return $this->container['delivery_email_address']; + } + + /** + * Sets delivery_email_address + * + * @param string|null $delivery_email_address For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. + * + * @return self + */ + public function setDeliveryEmailAddress($delivery_email_address) + { + if (is_null($delivery_email_address)) { + throw new \InvalidArgumentException('non-nullable delivery_email_address cannot be null'); + } + $this->container['delivery_email_address'] = $delivery_email_address; + + return $this; + } + + /** + * Gets delivery_timeframe + * + * @return string|null + */ + public function getDeliveryTimeframe() + { + return $this->container['delivery_timeframe']; + } + + /** + * Sets delivery_timeframe + * + * @param string|null $delivery_timeframe The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` + * + * @return self + */ + public function setDeliveryTimeframe($delivery_timeframe) + { + if (is_null($delivery_timeframe)) { + throw new \InvalidArgumentException('non-nullable delivery_timeframe cannot be null'); + } + $allowedValues = $this->getDeliveryTimeframeAllowableValues(); + if (!in_array($delivery_timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'delivery_timeframe', must be one of '%s'", + $delivery_timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['delivery_timeframe'] = $delivery_timeframe; + + return $this; + } + + /** + * Gets gift_card_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getGiftCardAmount() + { + return $this->container['gift_card_amount']; + } + + /** + * Sets gift_card_amount + * + * @param \Adyen\Model\Checkout\Amount|null $gift_card_amount gift_card_amount + * + * @return self + */ + public function setGiftCardAmount($gift_card_amount) + { + if (is_null($gift_card_amount)) { + throw new \InvalidArgumentException('non-nullable gift_card_amount cannot be null'); + } + $this->container['gift_card_amount'] = $gift_card_amount; + + return $this; + } + + /** + * Gets gift_card_count + * + * @return int|null + */ + public function getGiftCardCount() + { + return $this->container['gift_card_count']; + } + + /** + * Sets gift_card_count + * + * @param int|null $gift_card_count For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. + * + * @return self + */ + public function setGiftCardCount($gift_card_count) + { + // Do nothing for nullable integers + $this->container['gift_card_count'] = $gift_card_count; + + return $this; + } + + /** + * Gets gift_card_curr + * + * @return string|null + */ + public function getGiftCardCurr() + { + return $this->container['gift_card_curr']; + } + + /** + * Sets gift_card_curr + * + * @param string|null $gift_card_curr For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. + * + * @return self + */ + public function setGiftCardCurr($gift_card_curr) + { + if (is_null($gift_card_curr)) { + throw new \InvalidArgumentException('non-nullable gift_card_curr cannot be null'); + } + $this->container['gift_card_curr'] = $gift_card_curr; + + return $this; + } + + /** + * Gets pre_order_date + * + * @return \DateTime|null + */ + public function getPreOrderDate() + { + return $this->container['pre_order_date']; + } + + /** + * Sets pre_order_date + * + * @param \DateTime|null $pre_order_date For pre-order purchases, the expected date this product will be available to the shopper. + * + * @return self + */ + public function setPreOrderDate($pre_order_date) + { + if (is_null($pre_order_date)) { + throw new \InvalidArgumentException('non-nullable pre_order_date cannot be null'); + } + $this->container['pre_order_date'] = $pre_order_date; + + return $this; + } + + /** + * Gets pre_order_purchase + * + * @return bool|null + */ + public function getPreOrderPurchase() + { + return $this->container['pre_order_purchase']; + } + + /** + * Sets pre_order_purchase + * + * @param bool|null $pre_order_purchase Indicator for whether this transaction is for pre-ordering a product. + * + * @return self + */ + public function setPreOrderPurchase($pre_order_purchase) + { + if (is_null($pre_order_purchase)) { + throw new \InvalidArgumentException('non-nullable pre_order_purchase cannot be null'); + } + $this->container['pre_order_purchase'] = $pre_order_purchase; + + return $this; + } + + /** + * Gets pre_order_purchase_ind + * + * @return string|null + */ + public function getPreOrderPurchaseInd() + { + return $this->container['pre_order_purchase_ind']; + } + + /** + * Sets pre_order_purchase_ind + * + * @param string|null $pre_order_purchase_ind Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. + * + * @return self + */ + public function setPreOrderPurchaseInd($pre_order_purchase_ind) + { + if (is_null($pre_order_purchase_ind)) { + throw new \InvalidArgumentException('non-nullable pre_order_purchase_ind cannot be null'); + } + $this->container['pre_order_purchase_ind'] = $pre_order_purchase_ind; + + return $this; + } + + /** + * Gets reorder_items + * + * @return bool|null + */ + public function getReorderItems() + { + return $this->container['reorder_items']; + } + + /** + * Sets reorder_items + * + * @param bool|null $reorder_items Indicator for whether the shopper has already purchased the same items in the past. + * + * @return self + */ + public function setReorderItems($reorder_items) + { + if (is_null($reorder_items)) { + throw new \InvalidArgumentException('non-nullable reorder_items cannot be null'); + } + $this->container['reorder_items'] = $reorder_items; + + return $this; + } + + /** + * Gets reorder_items_ind + * + * @return string|null + */ + public function getReorderItemsInd() + { + return $this->container['reorder_items_ind']; + } + + /** + * Sets reorder_items_ind + * + * @param string|null $reorder_items_ind Indicates whether the cardholder is reordering previously purchased merchandise. + * + * @return self + */ + public function setReorderItemsInd($reorder_items_ind) + { + if (is_null($reorder_items_ind)) { + throw new \InvalidArgumentException('non-nullable reorder_items_ind cannot be null'); + } + $this->container['reorder_items_ind'] = $reorder_items_ind; + + return $this; + } + + /** + * Gets ship_indicator + * + * @return string|null + */ + public function getShipIndicator() + { + return $this->container['ship_indicator']; + } + + /** + * Sets ship_indicator + * + * @param string|null $ship_indicator Indicates shipping method chosen for the transaction. + * + * @return self + */ + public function setShipIndicator($ship_indicator) + { + if (is_null($ship_indicator)) { + throw new \InvalidArgumentException('non-nullable ship_indicator cannot be null'); + } + $this->container['ship_indicator'] = $ship_indicator; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/MobilePayDetails.php b/src/Adyen/Model/Checkout/MobilePayDetails.php new file mode 100644 index 000000000..adc72f611 --- /dev/null +++ b/src/Adyen/Model/Checkout/MobilePayDetails.php @@ -0,0 +1,452 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * MobilePayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MobilePayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MobilePayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_MOBILEPAY = 'mobilepay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MOBILEPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'mobilepay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **mobilepay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ModelInterface.php b/src/Adyen/Model/Checkout/ModelInterface.php new file mode 100644 index 000000000..9ea879876 --- /dev/null +++ b/src/Adyen/Model/Checkout/ModelInterface.php @@ -0,0 +1,95 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +interface ModelInterface +{ + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(); + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(); + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(); + + /** + * Array of attributes where the key is the local name, and the value is the original name + * + * @return array + */ + public static function attributeMap(); + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(); + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(); + + /** + * Show all the invalid properties with reasons. + * + * @return array + */ + public function listInvalidProperties(); + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool + */ + public function valid(); + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool; + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool; +} diff --git a/src/Adyen/Model/Checkout/MolPayDetails.php b/src/Adyen/Model/Checkout/MolPayDetails.php new file mode 100644 index 000000000..7b2bc5b27 --- /dev/null +++ b/src/Adyen/Model/Checkout/MolPayDetails.php @@ -0,0 +1,494 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * MolPayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MolPayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MolPayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'issuer' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'issuer' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'issuer' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'issuer' => 'issuer', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'issuer' => 'setIssuer', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'issuer' => 'getIssuer', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FPX_MY = 'molpay_ebanking_fpx_MY'; + public const TYPE_TH = 'molpay_ebanking_TH'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FPX_MY, + self::TYPE_TH, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['issuer'] === null) { + $invalidProperties[] = "'issuer' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets issuer + * + * @return string + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string $issuer The shopper's bank. Specify this with the issuer value that corresponds to this bank. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **molpay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Name.php b/src/Adyen/Model/Checkout/Name.php new file mode 100644 index 000000000..0f315034f --- /dev/null +++ b/src/Adyen/Model/Checkout/Name.php @@ -0,0 +1,427 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Name Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Name implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Name'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string' + ]; + + /** + * 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 + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'first_name' => false, + 'last_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'firstName', + 'last_name' => 'lastName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['first_name'] === null) { + $invalidProperties[] = "'first_name' can't be null"; + } + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' 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 first_name + * + * @return string + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string $first_name The first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string $last_name The last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/ObjectSerializer.php b/src/Adyen/Model/Checkout/ObjectSerializer.php new file mode 100644 index 000000000..035a10d64 --- /dev/null +++ b/src/Adyen/Model/Checkout/ObjectSerializer.php @@ -0,0 +1,320 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use Adyen\Model\Checkout\ModelInterface; + +class ObjectSerializer +{ + /** @var string */ + private static $dateTimeFormat = \DateTime::ATOM; + + /** + * Change the date format + * + * @param string $format the new date format to use + */ + public static function setDateTimeFormat($format) + { + self::$dateTimeFormat = $format; + } + + /** + * Serialize data + * + * @param mixed $data the data to serialize + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data + * + * @return scalar|object|array|null serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } + + if ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/Checkout/OpenInvoiceDetails.php b/src/Adyen/Model/Checkout/OpenInvoiceDetails.php new file mode 100644 index 000000000..0c52246de --- /dev/null +++ b/src/Adyen/Model/Checkout/OpenInvoiceDetails.php @@ -0,0 +1,628 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * OpenInvoiceDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class OpenInvoiceDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OpenInvoiceDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address' => 'string', + 'checkout_attempt_id' => 'string', + 'delivery_address' => 'string', + 'personal_details' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address' => null, + 'checkout_attempt_id' => null, + 'delivery_address' => null, + 'personal_details' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address' => false, + 'checkout_attempt_id' => false, + 'delivery_address' => false, + 'personal_details' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'delivery_address' => 'deliveryAddress', + 'personal_details' => 'personalDetails', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'delivery_address' => 'setDeliveryAddress', + 'personal_details' => 'setPersonalDetails', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'delivery_address' => 'getDeliveryAddress', + 'personal_details' => 'getPersonalDetails', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_OPENINVOICE = 'openinvoice'; + public const TYPE_AFTERPAY_DIRECTDEBIT = 'afterpay_directdebit'; + public const TYPE_ATOME_POS = 'atome_pos'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_OPENINVOICE, + self::TYPE_AFTERPAY_DIRECTDEBIT, + self::TYPE_ATOME_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('personal_details', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'openinvoice'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_address + * + * @return string|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param string|null $billing_address The address where to send the invoice. + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets delivery_address + * + * @return string|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param string|null $delivery_address The address where the goods should be delivered. + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets personal_details + * + * @return string|null + */ + public function getPersonalDetails() + { + return $this->container['personal_details']; + } + + /** + * Sets personal_details + * + * @param string|null $personal_details Shopper name, date of birth, phone number, and email address. + * + * @return self + */ + public function setPersonalDetails($personal_details) + { + if (is_null($personal_details)) { + throw new \InvalidArgumentException('non-nullable personal_details cannot be null'); + } + $this->container['personal_details'] = $personal_details; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **openinvoice** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PayPalDetails.php b/src/Adyen/Model/Checkout/PayPalDetails.php new file mode 100644 index 000000000..afde21ca5 --- /dev/null +++ b/src/Adyen/Model/Checkout/PayPalDetails.php @@ -0,0 +1,660 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PayPalDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PayPalDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayPalDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'order_id' => 'string', + 'payer_id' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'subtype' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'order_id' => null, + 'payer_id' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'subtype' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'order_id' => false, + 'payer_id' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'subtype' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'order_id' => 'orderID', + 'payer_id' => 'payerID', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'subtype' => 'subtype', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'order_id' => 'setOrderId', + 'payer_id' => 'setPayerId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'subtype' => 'setSubtype', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'order_id' => 'getOrderId', + 'payer_id' => 'getPayerId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'subtype' => 'getSubtype', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const SUBTYPE_REDIRECT = 'redirect'; + public const SUBTYPE_SDK = 'sdk'; + public const TYPE_PAYPAL = 'paypal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSubtypeAllowableValues() + { + return [ + self::SUBTYPE_REDIRECT, + self::SUBTYPE_SDK, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAYPAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('payer_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'paypal'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSubtypeAllowableValues(); + if (!is_null($this->container['subtype']) && !in_array($this->container['subtype'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'subtype', must be one of '%s'", + $this->container['subtype'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets order_id + * + * @return string|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string|null $order_id The unique ID associated with the order. + * + * @return self + */ + public function setOrderId($order_id) + { + if (is_null($order_id)) { + throw new \InvalidArgumentException('non-nullable order_id cannot be null'); + } + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets payer_id + * + * @return string|null + */ + public function getPayerId() + { + return $this->container['payer_id']; + } + + /** + * Sets payer_id + * + * @param string|null $payer_id The unique ID associated with the payer. + * + * @return self + */ + public function setPayerId($payer_id) + { + if (is_null($payer_id)) { + throw new \InvalidArgumentException('non-nullable payer_id cannot be null'); + } + $this->container['payer_id'] = $payer_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets subtype + * + * @return string|null + */ + public function getSubtype() + { + return $this->container['subtype']; + } + + /** + * Sets subtype + * + * @param string|null $subtype The type of flow to initiate. + * + * @return self + */ + public function setSubtype($subtype) + { + if (is_null($subtype)) { + throw new \InvalidArgumentException('non-nullable subtype cannot be null'); + } + $allowedValues = $this->getSubtypeAllowableValues(); + if (!in_array($subtype, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'subtype', must be one of '%s'", + $subtype, + implode("', '", $allowedValues) + ) + ); + } + $this->container['subtype'] = $subtype; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **paypal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PayUUpiDetails.php b/src/Adyen/Model/Checkout/PayUUpiDetails.php new file mode 100644 index 000000000..4a64c49d1 --- /dev/null +++ b/src/Adyen/Model/Checkout/PayUUpiDetails.php @@ -0,0 +1,593 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PayUUpiDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PayUUpiDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayUUpiDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'recurring_detail_reference' => 'string', + 'shopper_notification_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string', + 'virtual_payment_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'recurring_detail_reference' => null, + 'shopper_notification_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null, + 'virtual_payment_address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'recurring_detail_reference' => false, + 'shopper_notification_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false, + 'virtual_payment_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'recurring_detail_reference' => 'recurringDetailReference', + 'shopper_notification_reference' => 'shopperNotificationReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type', + 'virtual_payment_address' => 'virtualPaymentAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'shopper_notification_reference' => 'setShopperNotificationReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType', + 'virtual_payment_address' => 'setVirtualPaymentAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'shopper_notification_reference' => 'getShopperNotificationReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType', + 'virtual_payment_address' => 'getVirtualPaymentAddress' + ]; + + /** + * 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_PAYU_IN_UPI = 'payu_IN_upi'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAYU_IN_UPI, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('shopper_notification_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'payu_IN_upi'); + $this->setIfExists('virtual_payment_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets shopper_notification_reference + * + * @return string|null + */ + public function getShopperNotificationReference() + { + return $this->container['shopper_notification_reference']; + } + + /** + * Sets shopper_notification_reference + * + * @param string|null $shopper_notification_reference The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. + * + * @return self + */ + public function setShopperNotificationReference($shopper_notification_reference) + { + if (is_null($shopper_notification_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_notification_reference cannot be null'); + } + $this->container['shopper_notification_reference'] = $shopper_notification_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **payu_IN_upi** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets virtual_payment_address + * + * @return string|null + */ + public function getVirtualPaymentAddress() + { + return $this->container['virtual_payment_address']; + } + + /** + * Sets virtual_payment_address + * + * @param string|null $virtual_payment_address The virtual payment address for UPI. + * + * @return self + */ + public function setVirtualPaymentAddress($virtual_payment_address) + { + if (is_null($virtual_payment_address)) { + throw new \InvalidArgumentException('non-nullable virtual_payment_address cannot be null'); + } + $this->container['virtual_payment_address'] = $virtual_payment_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PayWithGoogleDetails.php b/src/Adyen/Model/Checkout/PayWithGoogleDetails.php new file mode 100644 index 000000000..7220cbd4f --- /dev/null +++ b/src/Adyen/Model/Checkout/PayWithGoogleDetails.php @@ -0,0 +1,624 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PayWithGoogleDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PayWithGoogleDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayWithGoogleDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'funding_source' => 'string', + 'google_pay_token' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'funding_source' => null, + 'google_pay_token' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'funding_source' => false, + 'google_pay_token' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'funding_source' => 'fundingSource', + 'google_pay_token' => 'googlePayToken', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'funding_source' => 'setFundingSource', + 'google_pay_token' => 'setGooglePayToken', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'funding_source' => 'getFundingSource', + 'google_pay_token' => 'getGooglePayToken', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_PAYWITHGOOGLE = 'paywithgoogle'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAYWITHGOOGLE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('google_pay_token', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'paywithgoogle'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['google_pay_token'] === null) { + $invalidProperties[] = "'google_pay_token' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets google_pay_token + * + * @return string + */ + public function getGooglePayToken() + { + return $this->container['google_pay_token']; + } + + /** + * Sets google_pay_token + * + * @param string $google_pay_token The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + * + * @return self + */ + public function setGooglePayToken($google_pay_token) + { + if (is_null($google_pay_token)) { + throw new \InvalidArgumentException('non-nullable google_pay_token cannot be null'); + } + $this->container['google_pay_token'] = $google_pay_token; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **paywithgoogle** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentAmountUpdateResource.php b/src/Adyen/Model/Checkout/PaymentAmountUpdateResource.php new file mode 100644 index 000000000..2b6ac69ac --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentAmountUpdateResource.php @@ -0,0 +1,709 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentAmountUpdateResource Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentAmountUpdateResource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentAmountUpdateResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'industry_usage' => 'string', + 'merchant_account' => 'string', + 'payment_psp_reference' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'industry_usage' => null, + 'merchant_account' => null, + 'payment_psp_reference' => null, + 'psp_reference' => null, + 'reference' => null, + 'splits' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'industry_usage' => false, + 'merchant_account' => false, + 'payment_psp_reference' => false, + 'psp_reference' => false, + 'reference' => false, + 'splits' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'industry_usage' => 'industryUsage', + 'merchant_account' => 'merchantAccount', + 'payment_psp_reference' => 'paymentPspReference', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'splits' => 'splits', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'industry_usage' => 'setIndustryUsage', + 'merchant_account' => 'setMerchantAccount', + 'payment_psp_reference' => 'setPaymentPspReference', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'industry_usage' => 'getIndustryUsage', + 'merchant_account' => 'getMerchantAccount', + 'payment_psp_reference' => 'getPaymentPspReference', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const INDUSTRY_USAGE_DELAYED_CHARGE = 'delayedCharge'; + public const INDUSTRY_USAGE_INSTALLMENT = 'installment'; + public const INDUSTRY_USAGE_NO_SHOW = 'noShow'; + public const STATUS_RECEIVED = 'received'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIndustryUsageAllowableValues() + { + return [ + self::INDUSTRY_USAGE_DELAYED_CHARGE, + self::INDUSTRY_USAGE_INSTALLMENT, + self::INDUSTRY_USAGE_NO_SHOW, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('industry_usage', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('payment_psp_reference', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!is_null($this->container['industry_usage']) && !in_array($this->container['industry_usage'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'industry_usage', must be one of '%s'", + $this->container['industry_usage'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_psp_reference'] === null) { + $invalidProperties[] = "'payment_psp_reference' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets industry_usage + * + * @return string|null + */ + public function getIndustryUsage() + { + return $this->container['industry_usage']; + } + + /** + * Sets industry_usage + * + * @param string|null $industry_usage The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + * + * @return self + */ + public function setIndustryUsage($industry_usage) + { + if (is_null($industry_usage)) { + throw new \InvalidArgumentException('non-nullable industry_usage cannot be null'); + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!in_array($industry_usage, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'industry_usage', must be one of '%s'", + $industry_usage, + implode("', '", $allowedValues) + ) + ); + } + $this->container['industry_usage'] = $industry_usage; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets payment_psp_reference + * + * @return string + */ + public function getPaymentPspReference() + { + return $this->container['payment_psp_reference']; + } + + /** + * Sets payment_psp_reference + * + * @param string $payment_psp_reference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. + * + * @return self + */ + public function setPaymentPspReference($payment_psp_reference) + { + if (is_null($payment_psp_reference)) { + throw new \InvalidArgumentException('non-nullable payment_psp_reference cannot be null'); + } + $this->container['payment_psp_reference'] = $payment_psp_reference; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference Adyen's 16-character reference associated with the amount update request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference Your reference for the amount update request. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of your request. This will always have the value **received**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentCancelResource.php b/src/Adyen/Model/Checkout/PaymentCancelResource.php new file mode 100644 index 000000000..06361645c --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentCancelResource.php @@ -0,0 +1,566 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentCancelResource Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentCancelResource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentCancelResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'payment_psp_reference' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'payment_psp_reference' => null, + 'psp_reference' => null, + 'reference' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'payment_psp_reference' => false, + 'psp_reference' => false, + 'reference' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'payment_psp_reference' => 'paymentPspReference', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'payment_psp_reference' => 'setPaymentPspReference', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'payment_psp_reference' => 'getPaymentPspReference', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_RECEIVED = 'received'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('payment_psp_reference', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_psp_reference'] === null) { + $invalidProperties[] = "'payment_psp_reference' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets payment_psp_reference + * + * @return string + */ + public function getPaymentPspReference() + { + return $this->container['payment_psp_reference']; + } + + /** + * Sets payment_psp_reference + * + * @param string $payment_psp_reference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. + * + * @return self + */ + public function setPaymentPspReference($payment_psp_reference) + { + if (is_null($payment_psp_reference)) { + throw new \InvalidArgumentException('non-nullable payment_psp_reference cannot be null'); + } + $this->container['payment_psp_reference'] = $payment_psp_reference; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference Adyen's 16-character reference associated with the cancel request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the cancel request. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of your request. This will always have the value **received**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentCaptureResource.php b/src/Adyen/Model/Checkout/PaymentCaptureResource.php new file mode 100644 index 000000000..d48af41e4 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentCaptureResource.php @@ -0,0 +1,671 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentCaptureResource Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentCaptureResource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentCaptureResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'merchant_account' => 'string', + 'payment_psp_reference' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'line_items' => null, + 'merchant_account' => null, + 'payment_psp_reference' => null, + 'psp_reference' => null, + 'reference' => null, + 'splits' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'line_items' => false, + 'merchant_account' => false, + 'payment_psp_reference' => false, + 'psp_reference' => false, + 'reference' => false, + 'splits' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'line_items' => 'lineItems', + 'merchant_account' => 'merchantAccount', + 'payment_psp_reference' => 'paymentPspReference', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'splits' => 'splits', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'line_items' => 'setLineItems', + 'merchant_account' => 'setMerchantAccount', + 'payment_psp_reference' => 'setPaymentPspReference', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'line_items' => 'getLineItems', + 'merchant_account' => 'getMerchantAccount', + 'payment_psp_reference' => 'getPaymentPspReference', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_RECEIVED = 'received'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('payment_psp_reference', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_psp_reference'] === null) { + $invalidProperties[] = "'payment_psp_reference' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets payment_psp_reference + * + * @return string + */ + public function getPaymentPspReference() + { + return $this->container['payment_psp_reference']; + } + + /** + * Sets payment_psp_reference + * + * @param string $payment_psp_reference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. + * + * @return self + */ + public function setPaymentPspReference($payment_psp_reference) + { + if (is_null($payment_psp_reference)) { + throw new \InvalidArgumentException('non-nullable payment_psp_reference cannot be null'); + } + $this->container['payment_psp_reference'] = $payment_psp_reference; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference Adyen's 16-character reference associated with the capture request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the capture request. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of your request. This will always have the value **received**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentCompletionDetails.php b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php new file mode 100644 index 000000000..b160e911b --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentCompletionDetails.php @@ -0,0 +1,931 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentCompletionDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentCompletionDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentCompletionDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'md' => 'string', + 'pa_req' => 'string', + 'pa_res' => 'string', + 'billing_token' => 'string', + 'cupsecureplus_smscode' => 'string', + 'facilitator_access_token' => 'string', + 'one_time_passcode' => 'string', + 'order_id' => 'string', + 'payer_id' => 'string', + 'payload' => 'string', + 'payment_id' => 'string', + 'payment_status' => 'string', + 'redirect_result' => 'string', + 'result_code' => 'string', + 'three_ds_result' => 'string', + 'threeds2_challenge_result' => 'string', + 'threeds2_fingerprint' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'md' => null, + 'pa_req' => null, + 'pa_res' => null, + 'billing_token' => null, + 'cupsecureplus_smscode' => null, + 'facilitator_access_token' => null, + 'one_time_passcode' => null, + 'order_id' => null, + 'payer_id' => null, + 'payload' => null, + 'payment_id' => null, + 'payment_status' => null, + 'redirect_result' => null, + 'result_code' => null, + 'three_ds_result' => null, + 'threeds2_challenge_result' => null, + 'threeds2_fingerprint' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'md' => false, + 'pa_req' => false, + 'pa_res' => false, + 'billing_token' => false, + 'cupsecureplus_smscode' => false, + 'facilitator_access_token' => false, + 'one_time_passcode' => false, + 'order_id' => false, + 'payer_id' => false, + 'payload' => false, + 'payment_id' => false, + 'payment_status' => false, + 'redirect_result' => false, + 'result_code' => false, + 'three_ds_result' => false, + 'threeds2_challenge_result' => false, + 'threeds2_fingerprint' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'md' => 'MD', + 'pa_req' => 'PaReq', + 'pa_res' => 'PaRes', + 'billing_token' => 'billingToken', + 'cupsecureplus_smscode' => 'cupsecureplus.smscode', + 'facilitator_access_token' => 'facilitatorAccessToken', + 'one_time_passcode' => 'oneTimePasscode', + 'order_id' => 'orderID', + 'payer_id' => 'payerID', + 'payload' => 'payload', + 'payment_id' => 'paymentID', + 'payment_status' => 'paymentStatus', + 'redirect_result' => 'redirectResult', + 'result_code' => 'resultCode', + 'three_ds_result' => 'threeDSResult', + 'threeds2_challenge_result' => 'threeds2.challengeResult', + 'threeds2_fingerprint' => 'threeds2.fingerprint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'md' => 'setMd', + 'pa_req' => 'setPaReq', + 'pa_res' => 'setPaRes', + 'billing_token' => 'setBillingToken', + 'cupsecureplus_smscode' => 'setCupsecureplusSmscode', + 'facilitator_access_token' => 'setFacilitatorAccessToken', + 'one_time_passcode' => 'setOneTimePasscode', + 'order_id' => 'setOrderId', + 'payer_id' => 'setPayerId', + 'payload' => 'setPayload', + 'payment_id' => 'setPaymentId', + 'payment_status' => 'setPaymentStatus', + 'redirect_result' => 'setRedirectResult', + 'result_code' => 'setResultCode', + 'three_ds_result' => 'setThreeDsResult', + 'threeds2_challenge_result' => 'setThreeds2ChallengeResult', + 'threeds2_fingerprint' => 'setThreeds2Fingerprint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'md' => 'getMd', + 'pa_req' => 'getPaReq', + 'pa_res' => 'getPaRes', + 'billing_token' => 'getBillingToken', + 'cupsecureplus_smscode' => 'getCupsecureplusSmscode', + 'facilitator_access_token' => 'getFacilitatorAccessToken', + 'one_time_passcode' => 'getOneTimePasscode', + 'order_id' => 'getOrderId', + 'payer_id' => 'getPayerId', + 'payload' => 'getPayload', + 'payment_id' => 'getPaymentId', + 'payment_status' => 'getPaymentStatus', + 'redirect_result' => 'getRedirectResult', + 'result_code' => 'getResultCode', + 'three_ds_result' => 'getThreeDsResult', + 'threeds2_challenge_result' => 'getThreeds2ChallengeResult', + 'threeds2_fingerprint' => 'getThreeds2Fingerprint' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('md', $data ?? [], null); + $this->setIfExists('pa_req', $data ?? [], null); + $this->setIfExists('pa_res', $data ?? [], null); + $this->setIfExists('billing_token', $data ?? [], null); + $this->setIfExists('cupsecureplus_smscode', $data ?? [], null); + $this->setIfExists('facilitator_access_token', $data ?? [], null); + $this->setIfExists('one_time_passcode', $data ?? [], null); + $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('payer_id', $data ?? [], null); + $this->setIfExists('payload', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('redirect_result', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + $this->setIfExists('three_ds_result', $data ?? [], null); + $this->setIfExists('threeds2_challenge_result', $data ?? [], null); + $this->setIfExists('threeds2_fingerprint', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets md + * + * @return string|null + */ + public function getMd() + { + return $this->container['md']; + } + + /** + * Sets md + * + * @param string|null $md A payment session identifier returned by the card issuer. + * + * @return self + */ + public function setMd($md) + { + if (is_null($md)) { + throw new \InvalidArgumentException('non-nullable md cannot be null'); + } + $this->container['md'] = $md; + + return $this; + } + + /** + * Gets pa_req + * + * @return string|null + */ + public function getPaReq() + { + return $this->container['pa_req']; + } + + /** + * Sets pa_req + * + * @param string|null $pa_req (3D) Payment Authentication Request data for the card issuer. + * + * @return self + */ + public function setPaReq($pa_req) + { + if (is_null($pa_req)) { + throw new \InvalidArgumentException('non-nullable pa_req cannot be null'); + } + $this->container['pa_req'] = $pa_req; + + return $this; + } + + /** + * Gets pa_res + * + * @return string|null + */ + public function getPaRes() + { + return $this->container['pa_res']; + } + + /** + * Sets pa_res + * + * @param string|null $pa_res (3D) Payment Authentication Response data by the card issuer. + * + * @return self + */ + public function setPaRes($pa_res) + { + if (is_null($pa_res)) { + throw new \InvalidArgumentException('non-nullable pa_res cannot be null'); + } + $this->container['pa_res'] = $pa_res; + + return $this; + } + + /** + * Gets billing_token + * + * @return string|null + */ + public function getBillingToken() + { + return $this->container['billing_token']; + } + + /** + * Sets billing_token + * + * @param string|null $billing_token PayPal-generated token for recurring payments. + * + * @return self + */ + public function setBillingToken($billing_token) + { + if (is_null($billing_token)) { + throw new \InvalidArgumentException('non-nullable billing_token cannot be null'); + } + $this->container['billing_token'] = $billing_token; + + return $this; + } + + /** + * Gets cupsecureplus_smscode + * + * @return string|null + */ + public function getCupsecureplusSmscode() + { + return $this->container['cupsecureplus_smscode']; + } + + /** + * Sets cupsecureplus_smscode + * + * @param string|null $cupsecureplus_smscode The SMS verification code collected from the shopper. + * + * @return self + */ + public function setCupsecureplusSmscode($cupsecureplus_smscode) + { + if (is_null($cupsecureplus_smscode)) { + throw new \InvalidArgumentException('non-nullable cupsecureplus_smscode cannot be null'); + } + $this->container['cupsecureplus_smscode'] = $cupsecureplus_smscode; + + return $this; + } + + /** + * Gets facilitator_access_token + * + * @return string|null + */ + public function getFacilitatorAccessToken() + { + return $this->container['facilitator_access_token']; + } + + /** + * Sets facilitator_access_token + * + * @param string|null $facilitator_access_token PayPal-generated third party access token. + * + * @return self + */ + public function setFacilitatorAccessToken($facilitator_access_token) + { + if (is_null($facilitator_access_token)) { + throw new \InvalidArgumentException('non-nullable facilitator_access_token cannot be null'); + } + $this->container['facilitator_access_token'] = $facilitator_access_token; + + return $this; + } + + /** + * Gets one_time_passcode + * + * @return string|null + */ + public function getOneTimePasscode() + { + return $this->container['one_time_passcode']; + } + + /** + * Sets one_time_passcode + * + * @param string|null $one_time_passcode A random number sent to the mobile phone number of the shopper to verify the payment. + * + * @return self + */ + public function setOneTimePasscode($one_time_passcode) + { + if (is_null($one_time_passcode)) { + throw new \InvalidArgumentException('non-nullable one_time_passcode cannot be null'); + } + $this->container['one_time_passcode'] = $one_time_passcode; + + return $this; + } + + /** + * Gets order_id + * + * @return string|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string|null $order_id PayPal-assigned ID for the order. + * + * @return self + */ + public function setOrderId($order_id) + { + if (is_null($order_id)) { + throw new \InvalidArgumentException('non-nullable order_id cannot be null'); + } + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets payer_id + * + * @return string|null + */ + public function getPayerId() + { + return $this->container['payer_id']; + } + + /** + * Sets payer_id + * + * @param string|null $payer_id PayPal-assigned ID for the payer (shopper). + * + * @return self + */ + public function setPayerId($payer_id) + { + if (is_null($payer_id)) { + throw new \InvalidArgumentException('non-nullable payer_id cannot be null'); + } + $this->container['payer_id'] = $payer_id; + + return $this; + } + + /** + * Gets payload + * + * @return string|null + */ + public function getPayload() + { + return $this->container['payload']; + } + + /** + * Sets payload + * + * @param string|null $payload Payload appended to the `returnURL` as a result of the redirect. + * + * @return self + */ + public function setPayload($payload) + { + if (is_null($payload)) { + throw new \InvalidArgumentException('non-nullable payload cannot be null'); + } + $this->container['payload'] = $payload; + + return $this; + } + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id PayPal-generated ID for the payment. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets payment_status + * + * @return string|null + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param string|null $payment_status Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets redirect_result + * + * @return string|null + */ + public function getRedirectResult() + { + return $this->container['redirect_result']; + } + + /** + * Sets redirect_result + * + * @param string|null $redirect_result The result of the redirect as appended to the `returnURL`. + * + * @return self + */ + public function setRedirectResult($redirect_result) + { + if (is_null($redirect_result)) { + throw new \InvalidArgumentException('non-nullable redirect_result cannot be null'); + } + $this->container['redirect_result'] = $redirect_result; + + return $this; + } + + /** + * Gets result_code + * + * @return string|null + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string|null $result_code Value you received from the WeChat Pay SDK. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $this->container['result_code'] = $result_code; + + return $this; + } + + /** + * Gets three_ds_result + * + * @return string|null + */ + public function getThreeDsResult() + { + return $this->container['three_ds_result']; + } + + /** + * Sets three_ds_result + * + * @param string|null $three_ds_result Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. + * + * @return self + */ + public function setThreeDsResult($three_ds_result) + { + if (is_null($three_ds_result)) { + throw new \InvalidArgumentException('non-nullable three_ds_result cannot be null'); + } + $this->container['three_ds_result'] = $three_ds_result; + + return $this; + } + + /** + * Gets threeds2_challenge_result + * + * @return string|null + */ + public function getThreeds2ChallengeResult() + { + return $this->container['threeds2_challenge_result']; + } + + /** + * Sets threeds2_challenge_result + * + * @param string|null $threeds2_challenge_result Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. + * + * @return self + */ + public function setThreeds2ChallengeResult($threeds2_challenge_result) + { + if (is_null($threeds2_challenge_result)) { + throw new \InvalidArgumentException('non-nullable threeds2_challenge_result cannot be null'); + } + $this->container['threeds2_challenge_result'] = $threeds2_challenge_result; + + return $this; + } + + /** + * Gets threeds2_fingerprint + * + * @return string|null + */ + public function getThreeds2Fingerprint() + { + return $this->container['threeds2_fingerprint']; + } + + /** + * Sets threeds2_fingerprint + * + * @param string|null $threeds2_fingerprint Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. + * + * @return self + */ + public function setThreeds2Fingerprint($threeds2_fingerprint) + { + if (is_null($threeds2_fingerprint)) { + throw new \InvalidArgumentException('non-nullable threeds2_fingerprint cannot be null'); + } + $this->container['threeds2_fingerprint'] = $threeds2_fingerprint; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentDetails.php b/src/Adyen/Model/Checkout/PaymentDetails.php new file mode 100644 index 000000000..61876e8af --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentDetails.php @@ -0,0 +1,634 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_ALIPAY = 'alipay'; + public const TYPE_MULTIBANCO = 'multibanco'; + public const TYPE_BANK_TRANSFER_IBAN = 'bankTransfer_IBAN'; + public const TYPE_PAYBRIGHT = 'paybright'; + public const TYPE_PAYNOW = 'paynow'; + public const TYPE_AFFIRM = 'affirm'; + public const TYPE_AFFIRM_POS = 'affirm_pos'; + public const TYPE_TRUSTLY = 'trustly'; + public const TYPE_TRUSTLYVECTOR = 'trustlyvector'; + public const TYPE_ONEY = 'oney'; + public const TYPE_FACILYPAY = 'facilypay'; + public const TYPE_FACILYPAY_3X = 'facilypay_3x'; + public const TYPE_FACILYPAY_4X = 'facilypay_4x'; + public const TYPE_FACILYPAY_6X = 'facilypay_6x'; + public const TYPE_FACILYPAY_10X = 'facilypay_10x'; + public const TYPE_FACILYPAY_12X = 'facilypay_12x'; + public const TYPE_UNIONPAY = 'unionpay'; + public const TYPE_KCP_BANKTRANSFER = 'kcp_banktransfer'; + public const TYPE_KCP_PAYCO = 'kcp_payco'; + public const TYPE_KCP_CREDITCARD = 'kcp_creditcard'; + public const TYPE_WECHATPAY_SDK = 'wechatpaySDK'; + public const TYPE_WECHATPAY_QR = 'wechatpayQR'; + public const TYPE_WECHATPAY_WEB = 'wechatpayWeb'; + public const TYPE_MOLPAY_BOOST = 'molpay_boost'; + public const TYPE_WALLET_IN = 'wallet_IN'; + public const TYPE_PAYU_IN_CASHCARD = 'payu_IN_cashcard'; + public const TYPE_PAYU_IN_NB = 'payu_IN_nb'; + public const TYPE_UPI_QR = 'upi_qr'; + public const TYPE_PAYTM = 'paytm'; + public const TYPE_MOLPAY_EBANKING_VN = 'molpay_ebanking_VN'; + public const TYPE_OPENBANKING_UK = 'openbanking_UK'; + public const TYPE_PAYBYBANK = 'paybybank'; + public const TYPE_EBANKING_FI = 'ebanking_FI'; + public const TYPE_MOLPAY_EBANKING_MY = 'molpay_ebanking_MY'; + public const TYPE_MOLPAY_EBANKING_DIRECT_MY = 'molpay_ebanking_direct_MY'; + public const TYPE_SWISH = 'swish'; + public const TYPE_TWINT = 'twint'; + public const TYPE_WALLEY = 'walley'; + public const TYPE_WALLEY_B2B = 'walley_b2b'; + public const TYPE_PIX = 'pix'; + public const TYPE_BIZUM = 'bizum'; + public const TYPE_ALMA = 'alma'; + public const TYPE_MOLPAY_FPX = 'molpay_fpx'; + public const TYPE_KONBINI = 'konbini'; + public const TYPE_DIRECT_EBANKING = 'directEbanking'; + public const TYPE_BOLETOBANCARIO = 'boletobancario'; + public const TYPE_NETELLER = 'neteller'; + public const TYPE_DANA = 'dana'; + public const TYPE_PAYSAFECARD = 'paysafecard'; + public const TYPE_CASHTICKET = 'cashticket'; + public const TYPE_IKANO = 'ikano'; + public const TYPE_KARENMILLEN = 'karenmillen'; + public const TYPE_OASIS = 'oasis'; + public const TYPE_WAREHOUSE = 'warehouse'; + public const TYPE_PRIMEIROPAY_BOLETO = 'primeiropay_boleto'; + public const TYPE_MADA = 'mada'; + public const TYPE_BENEFIT = 'benefit'; + public const TYPE_KNET = 'knet'; + public const TYPE_OMANNET = 'omannet'; + public const TYPE_GOPAY_WALLET = 'gopay_wallet'; + public const TYPE_POLI = 'poli'; + public const TYPE_KCP_NAVERPAY = 'kcp_naverpay'; + public const TYPE_ONLINEBANKING_IN = 'onlinebanking_IN'; + public const TYPE_FAWRY = 'fawry'; + public const TYPE_ATOME = 'atome'; + public const TYPE_MONEYBOOKERS = 'moneybookers'; + public const TYPE_NAPS = 'naps'; + public const TYPE_NORDEA = 'nordea'; + public const TYPE_BOLETOBANCARIO_BRADESCO = 'boletobancario_bradesco'; + public const TYPE_BOLETOBANCARIO_ITAU = 'boletobancario_itau'; + public const TYPE_BOLETOBANCARIO_SANTANDER = 'boletobancario_santander'; + public const TYPE_BOLETOBANCARIO_BANCODOBRASIL = 'boletobancario_bancodobrasil'; + public const TYPE_BOLETOBANCARIO_HSBC = 'boletobancario_hsbc'; + public const TYPE_MOLPAY_MAYBANK2U = 'molpay_maybank2u'; + public const TYPE_MOLPAY_CIMB = 'molpay_cimb'; + public const TYPE_MOLPAY_RHB = 'molpay_rhb'; + public const TYPE_MOLPAY_AMB = 'molpay_amb'; + public const TYPE_MOLPAY_HLB = 'molpay_hlb'; + public const TYPE_MOLPAY_AFFIN_EPG = 'molpay_affin_epg'; + public const TYPE_MOLPAY_BANKISLAM = 'molpay_bankislam'; + public const TYPE_MOLPAY_PUBLICBANK = 'molpay_publicbank'; + public const TYPE_FPX_AGROBANK = 'fpx_agrobank'; + public const TYPE_TOUCHNGO = 'touchngo'; + public const TYPE_MAYBANK2U_MAE = 'maybank2u_mae'; + public const TYPE_DUITNOW = 'duitnow'; + public const TYPE_PROMPTPAY = 'promptpay'; + public const TYPE_TWINT_POS = 'twint_pos'; + public const TYPE_ALIPAY_HK = 'alipay_hk'; + public const TYPE_ALIPAY_HK_WEB = 'alipay_hk_web'; + public const TYPE_ALIPAY_HK_WAP = 'alipay_hk_wap'; + public const TYPE_ALIPAY_WAP = 'alipay_wap'; + public const TYPE_BALANCEPLATFORM = 'balanceplatform'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ALIPAY, + self::TYPE_MULTIBANCO, + self::TYPE_BANK_TRANSFER_IBAN, + self::TYPE_PAYBRIGHT, + self::TYPE_PAYNOW, + self::TYPE_AFFIRM, + self::TYPE_AFFIRM_POS, + self::TYPE_TRUSTLY, + self::TYPE_TRUSTLYVECTOR, + self::TYPE_ONEY, + self::TYPE_FACILYPAY, + self::TYPE_FACILYPAY_3X, + self::TYPE_FACILYPAY_4X, + self::TYPE_FACILYPAY_6X, + self::TYPE_FACILYPAY_10X, + self::TYPE_FACILYPAY_12X, + self::TYPE_UNIONPAY, + self::TYPE_KCP_BANKTRANSFER, + self::TYPE_KCP_PAYCO, + self::TYPE_KCP_CREDITCARD, + self::TYPE_WECHATPAY_SDK, + self::TYPE_WECHATPAY_QR, + self::TYPE_WECHATPAY_WEB, + self::TYPE_MOLPAY_BOOST, + self::TYPE_WALLET_IN, + self::TYPE_PAYU_IN_CASHCARD, + self::TYPE_PAYU_IN_NB, + self::TYPE_UPI_QR, + self::TYPE_PAYTM, + self::TYPE_MOLPAY_EBANKING_VN, + self::TYPE_OPENBANKING_UK, + self::TYPE_PAYBYBANK, + self::TYPE_EBANKING_FI, + self::TYPE_MOLPAY_EBANKING_MY, + self::TYPE_MOLPAY_EBANKING_DIRECT_MY, + self::TYPE_SWISH, + self::TYPE_TWINT, + self::TYPE_WALLEY, + self::TYPE_WALLEY_B2B, + self::TYPE_PIX, + self::TYPE_BIZUM, + self::TYPE_ALMA, + self::TYPE_MOLPAY_FPX, + self::TYPE_KONBINI, + self::TYPE_DIRECT_EBANKING, + self::TYPE_BOLETOBANCARIO, + self::TYPE_NETELLER, + self::TYPE_DANA, + self::TYPE_PAYSAFECARD, + self::TYPE_CASHTICKET, + self::TYPE_IKANO, + self::TYPE_KARENMILLEN, + self::TYPE_OASIS, + self::TYPE_WAREHOUSE, + self::TYPE_PRIMEIROPAY_BOLETO, + self::TYPE_MADA, + self::TYPE_BENEFIT, + self::TYPE_KNET, + self::TYPE_OMANNET, + self::TYPE_GOPAY_WALLET, + self::TYPE_POLI, + self::TYPE_KCP_NAVERPAY, + self::TYPE_ONLINEBANKING_IN, + self::TYPE_FAWRY, + self::TYPE_ATOME, + self::TYPE_MONEYBOOKERS, + self::TYPE_NAPS, + self::TYPE_NORDEA, + self::TYPE_BOLETOBANCARIO_BRADESCO, + self::TYPE_BOLETOBANCARIO_ITAU, + self::TYPE_BOLETOBANCARIO_SANTANDER, + self::TYPE_BOLETOBANCARIO_BANCODOBRASIL, + self::TYPE_BOLETOBANCARIO_HSBC, + self::TYPE_MOLPAY_MAYBANK2U, + self::TYPE_MOLPAY_CIMB, + self::TYPE_MOLPAY_RHB, + self::TYPE_MOLPAY_AMB, + self::TYPE_MOLPAY_HLB, + self::TYPE_MOLPAY_AFFIN_EPG, + self::TYPE_MOLPAY_BANKISLAM, + self::TYPE_MOLPAY_PUBLICBANK, + self::TYPE_FPX_AGROBANK, + self::TYPE_TOUCHNGO, + self::TYPE_MAYBANK2U_MAE, + self::TYPE_DUITNOW, + self::TYPE_PROMPTPAY, + self::TYPE_TWINT_POS, + self::TYPE_ALIPAY_HK, + self::TYPE_ALIPAY_HK_WEB, + self::TYPE_ALIPAY_HK_WAP, + self::TYPE_ALIPAY_WAP, + self::TYPE_BALANCEPLATFORM, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The payment method type. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentDetailsResponse.php b/src/Adyen/Model/Checkout/PaymentDetailsResponse.php new file mode 100644 index 000000000..7d142c620 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentDetailsResponse.php @@ -0,0 +1,918 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentDetailsResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentDetailsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'donation_token' => 'string', + 'fraud_result' => '\Adyen\Model\Checkout\FraudResult', + 'merchant_reference' => 'string', + 'order' => '\Adyen\Model\Checkout\CheckoutOrderResponse', + 'payment_method' => '\Adyen\Model\Checkout\ResponsePaymentMethod', + 'psp_reference' => 'string', + 'refusal_reason' => 'string', + 'refusal_reason_code' => 'string', + 'result_code' => 'string', + 'shopper_locale' => 'string', + 'three_ds2_response_data' => '\Adyen\Model\Checkout\ThreeDS2ResponseData', + 'three_ds2_result' => '\Adyen\Model\Checkout\ThreeDS2Result', + 'three_ds_payment_data' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'amount' => null, + 'donation_token' => null, + 'fraud_result' => null, + 'merchant_reference' => null, + 'order' => null, + 'payment_method' => null, + 'psp_reference' => null, + 'refusal_reason' => null, + 'refusal_reason_code' => null, + 'result_code' => null, + 'shopper_locale' => null, + 'three_ds2_response_data' => null, + 'three_ds2_result' => null, + 'three_ds_payment_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'amount' => false, + 'donation_token' => false, + 'fraud_result' => false, + 'merchant_reference' => false, + 'order' => false, + 'payment_method' => false, + 'psp_reference' => false, + 'refusal_reason' => false, + 'refusal_reason_code' => false, + 'result_code' => false, + 'shopper_locale' => false, + 'three_ds2_response_data' => false, + 'three_ds2_result' => false, + 'three_ds_payment_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'donation_token' => 'donationToken', + 'fraud_result' => 'fraudResult', + 'merchant_reference' => 'merchantReference', + 'order' => 'order', + 'payment_method' => 'paymentMethod', + 'psp_reference' => 'pspReference', + 'refusal_reason' => 'refusalReason', + 'refusal_reason_code' => 'refusalReasonCode', + 'result_code' => 'resultCode', + 'shopper_locale' => 'shopperLocale', + 'three_ds2_response_data' => 'threeDS2ResponseData', + 'three_ds2_result' => 'threeDS2Result', + 'three_ds_payment_data' => 'threeDSPaymentData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'donation_token' => 'setDonationToken', + 'fraud_result' => 'setFraudResult', + 'merchant_reference' => 'setMerchantReference', + 'order' => 'setOrder', + 'payment_method' => 'setPaymentMethod', + 'psp_reference' => 'setPspReference', + 'refusal_reason' => 'setRefusalReason', + 'refusal_reason_code' => 'setRefusalReasonCode', + 'result_code' => 'setResultCode', + 'shopper_locale' => 'setShopperLocale', + 'three_ds2_response_data' => 'setThreeDs2ResponseData', + 'three_ds2_result' => 'setThreeDs2Result', + 'three_ds_payment_data' => 'setThreeDsPaymentData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'donation_token' => 'getDonationToken', + 'fraud_result' => 'getFraudResult', + 'merchant_reference' => 'getMerchantReference', + 'order' => 'getOrder', + 'payment_method' => 'getPaymentMethod', + 'psp_reference' => 'getPspReference', + 'refusal_reason' => 'getRefusalReason', + 'refusal_reason_code' => 'getRefusalReasonCode', + 'result_code' => 'getResultCode', + 'shopper_locale' => 'getShopperLocale', + 'three_ds2_response_data' => 'getThreeDs2ResponseData', + 'three_ds2_result' => 'getThreeDs2Result', + 'three_ds_payment_data' => 'getThreeDsPaymentData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_CODE_AUTHENTICATION_FINISHED = 'AuthenticationFinished'; + public const RESULT_CODE_AUTHENTICATION_NOT_REQUIRED = 'AuthenticationNotRequired'; + public const RESULT_CODE_AUTHORISED = 'Authorised'; + public const RESULT_CODE_CANCELLED = 'Cancelled'; + public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; + public const RESULT_CODE_ERROR = 'Error'; + public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PENDING = 'Pending'; + public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; + public const RESULT_CODE_RECEIVED = 'Received'; + public const RESULT_CODE_REDIRECT_SHOPPER = 'RedirectShopper'; + public const RESULT_CODE_REFUSED = 'Refused'; + public const RESULT_CODE_SUCCESS = 'Success'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultCodeAllowableValues() + { + return [ + self::RESULT_CODE_AUTHENTICATION_FINISHED, + self::RESULT_CODE_AUTHENTICATION_NOT_REQUIRED, + self::RESULT_CODE_AUTHORISED, + self::RESULT_CODE_CANCELLED, + self::RESULT_CODE_CHALLENGE_SHOPPER, + self::RESULT_CODE_ERROR, + self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PENDING, + self::RESULT_CODE_PRESENT_TO_SHOPPER, + self::RESULT_CODE_RECEIVED, + self::RESULT_CODE_REDIRECT_SHOPPER, + self::RESULT_CODE_REFUSED, + self::RESULT_CODE_SUCCESS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('donation_token', $data ?? [], null); + $this->setIfExists('fraud_result', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('refusal_reason', $data ?? [], null); + $this->setIfExists('refusal_reason_code', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('three_ds2_response_data', $data ?? [], null); + $this->setIfExists('three_ds2_result', $data ?? [], null); + $this->setIfExists('three_ds_payment_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getResultCodeAllowableValues(); + if (!is_null($this->container['result_code']) && !in_array($this->container['result_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result_code', must be one of '%s'", + $this->container['result_code'], + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets donation_token + * + * @return string|null + */ + public function getDonationToken() + { + return $this->container['donation_token']; + } + + /** + * Sets donation_token + * + * @param string|null $donation_token Donation Token containing payment details for Adyen Giving. + * + * @return self + */ + public function setDonationToken($donation_token) + { + if (is_null($donation_token)) { + throw new \InvalidArgumentException('non-nullable donation_token cannot be null'); + } + $this->container['donation_token'] = $donation_token; + + return $this; + } + + /** + * Gets fraud_result + * + * @return \Adyen\Model\Checkout\FraudResult|null + */ + public function getFraudResult() + { + return $this->container['fraud_result']; + } + + /** + * Sets fraud_result + * + * @param \Adyen\Model\Checkout\FraudResult|null $fraud_result fraud_result + * + * @return self + */ + public function setFraudResult($fraud_result) + { + if (is_null($fraud_result)) { + throw new \InvalidArgumentException('non-nullable fraud_result cannot be null'); + } + $this->container['fraud_result'] = $fraud_result; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string|null + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string|null $merchant_reference The reference used during the /payments request. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets order + * + * @return \Adyen\Model\Checkout\CheckoutOrderResponse|null + */ + public function getOrder() + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param \Adyen\Model\Checkout\CheckoutOrderResponse|null $order order + * + * @return self + */ + public function setOrder($order) + { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Adyen\Model\Checkout\ResponsePaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Adyen\Model\Checkout\ResponsePaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets refusal_reason + * + * @return string|null + */ + public function getRefusalReason() + { + return $this->container['refusal_reason']; + } + + /** + * Sets refusal_reason + * + * @param string|null $refusal_reason If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReason($refusal_reason) + { + if (is_null($refusal_reason)) { + throw new \InvalidArgumentException('non-nullable refusal_reason cannot be null'); + } + $this->container['refusal_reason'] = $refusal_reason; + + return $this; + } + + /** + * Gets refusal_reason_code + * + * @return string|null + */ + public function getRefusalReasonCode() + { + return $this->container['refusal_reason_code']; + } + + /** + * Sets refusal_reason_code + * + * @param string|null $refusal_reason_code Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReasonCode($refusal_reason_code) + { + if (is_null($refusal_reason_code)) { + throw new \InvalidArgumentException('non-nullable refusal_reason_code cannot be null'); + } + $this->container['refusal_reason_code'] = $refusal_reason_code; + + return $this; + } + + /** + * Gets result_code + * + * @return string|null + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string|null $result_code The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!in_array($result_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result_code', must be one of '%s'", + $result_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result_code'] = $result_code; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The shopperLocale. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets three_ds2_response_data + * + * @return \Adyen\Model\Checkout\ThreeDS2ResponseData|null + */ + public function getThreeDs2ResponseData() + { + return $this->container['three_ds2_response_data']; + } + + /** + * Sets three_ds2_response_data + * + * @param \Adyen\Model\Checkout\ThreeDS2ResponseData|null $three_ds2_response_data three_ds2_response_data + * + * @return self + */ + public function setThreeDs2ResponseData($three_ds2_response_data) + { + if (is_null($three_ds2_response_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_response_data cannot be null'); + } + $this->container['three_ds2_response_data'] = $three_ds2_response_data; + + return $this; + } + + /** + * Gets three_ds2_result + * + * @return \Adyen\Model\Checkout\ThreeDS2Result|null + */ + public function getThreeDs2Result() + { + return $this->container['three_ds2_result']; + } + + /** + * Sets three_ds2_result + * + * @param \Adyen\Model\Checkout\ThreeDS2Result|null $three_ds2_result three_ds2_result + * + * @return self + */ + public function setThreeDs2Result($three_ds2_result) + { + if (is_null($three_ds2_result)) { + throw new \InvalidArgumentException('non-nullable three_ds2_result cannot be null'); + } + $this->container['three_ds2_result'] = $three_ds2_result; + + return $this; + } + + /** + * Gets three_ds_payment_data + * + * @return string|null + */ + public function getThreeDsPaymentData() + { + return $this->container['three_ds_payment_data']; + } + + /** + * Sets three_ds_payment_data + * + * @param string|null $three_ds_payment_data When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. + * + * @return self + */ + public function setThreeDsPaymentData($three_ds_payment_data) + { + if (is_null($three_ds_payment_data)) { + throw new \InvalidArgumentException('non-nullable three_ds_payment_data cannot be null'); + } + $this->container['three_ds_payment_data'] = $three_ds_payment_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentDonationRequest.php b/src/Adyen/Model/Checkout/PaymentDonationRequest.php new file mode 100644 index 000000000..504755895 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentDonationRequest.php @@ -0,0 +1,2788 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentDonationRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentDonationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentDonationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Checkout\AccountInfo', + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'application_info' => '\Adyen\Model\Checkout\ApplicationInfo', + 'authentication_data' => '\Adyen\Model\Checkout\AuthenticationData', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'browser_info' => '\Adyen\Model\Checkout\BrowserInfo', + 'capture_delay_hours' => 'int', + 'channel' => 'string', + 'checkout_attempt_id' => 'string', + 'company' => '\Adyen\Model\Checkout\Company', + 'conversion_id' => 'string', + 'country_code' => 'string', + 'date_of_birth' => '\DateTime', + 'dcc_quote' => '\Adyen\Model\Checkout\ForexQuote', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'delivery_date' => '\DateTime', + 'device_fingerprint' => 'string', + 'donation_account' => 'string', + 'donation_original_psp_reference' => 'string', + 'donation_token' => 'string', + 'enable_one_click' => 'bool', + 'enable_pay_out' => 'bool', + 'enable_recurring' => 'bool', + 'entity_type' => 'string', + 'fraud_offset' => 'int', + 'industry_usage' => 'string', + 'installments' => '\Adyen\Model\Checkout\Installments', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'localized_shopper_statement' => 'array', + 'mandate' => '\Adyen\Model\Checkout\Mandate', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'merchant_risk_indicator' => '\Adyen\Model\Checkout\MerchantRiskIndicator', + 'metadata' => 'array', + 'mpi_data' => '\Adyen\Model\Checkout\ThreeDSecureData', + 'order' => '\Adyen\Model\Checkout\CheckoutOrder', + 'order_reference' => 'string', + 'origin' => 'string', + 'payment_method' => '\Adyen\Model\Checkout\CheckoutPaymentMethod', + 'platform_chargeback_logic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', + 'recurring_expiry' => 'string', + 'recurring_frequency' => 'string', + 'recurring_processing_model' => 'string', + 'redirect_from_issuer_method' => 'string', + 'redirect_to_issuer_method' => 'string', + 'reference' => 'string', + 'return_url' => 'string', + 'risk_data' => '\Adyen\Model\Checkout\RiskData', + 'session_validity' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'store' => 'string', + 'store_payment_method' => 'bool', + 'telephone_number' => 'string', + 'three_ds2_request_data' => '\Adyen\Model\Checkout\ThreeDS2RequestData', + 'three_ds_authentication_only' => 'bool', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_data' => null, + 'amount' => null, + 'application_info' => null, + 'authentication_data' => null, + 'billing_address' => null, + 'browser_info' => null, + 'capture_delay_hours' => 'int32', + 'channel' => null, + 'checkout_attempt_id' => null, + 'company' => null, + 'conversion_id' => null, + 'country_code' => null, + 'date_of_birth' => 'date', + 'dcc_quote' => null, + 'delivery_address' => null, + 'delivery_date' => 'date-time', + 'device_fingerprint' => null, + 'donation_account' => null, + 'donation_original_psp_reference' => null, + 'donation_token' => null, + 'enable_one_click' => null, + 'enable_pay_out' => null, + 'enable_recurring' => null, + 'entity_type' => null, + 'fraud_offset' => 'int32', + 'industry_usage' => null, + 'installments' => null, + 'line_items' => null, + 'localized_shopper_statement' => null, + 'mandate' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'merchant_risk_indicator' => null, + 'metadata' => null, + 'mpi_data' => null, + 'order' => null, + 'order_reference' => null, + 'origin' => null, + 'payment_method' => null, + 'platform_chargeback_logic' => null, + 'recurring_expiry' => null, + 'recurring_frequency' => null, + 'recurring_processing_model' => null, + 'redirect_from_issuer_method' => null, + 'redirect_to_issuer_method' => null, + 'reference' => null, + 'return_url' => null, + 'risk_data' => null, + 'session_validity' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'splits' => null, + 'store' => null, + 'store_payment_method' => null, + 'telephone_number' => null, + 'three_ds2_request_data' => null, + 'three_ds_authentication_only' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_data' => false, + 'amount' => false, + 'application_info' => false, + 'authentication_data' => false, + 'billing_address' => false, + 'browser_info' => false, + 'capture_delay_hours' => true, + 'channel' => false, + 'checkout_attempt_id' => false, + 'company' => false, + 'conversion_id' => false, + 'country_code' => false, + 'date_of_birth' => false, + 'dcc_quote' => false, + 'delivery_address' => false, + 'delivery_date' => false, + 'device_fingerprint' => false, + 'donation_account' => false, + 'donation_original_psp_reference' => false, + 'donation_token' => false, + 'enable_one_click' => false, + 'enable_pay_out' => false, + 'enable_recurring' => false, + 'entity_type' => false, + 'fraud_offset' => true, + 'industry_usage' => false, + 'installments' => false, + 'line_items' => false, + 'localized_shopper_statement' => false, + 'mandate' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'merchant_risk_indicator' => false, + 'metadata' => false, + 'mpi_data' => false, + 'order' => false, + 'order_reference' => false, + 'origin' => false, + 'payment_method' => false, + 'platform_chargeback_logic' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'recurring_processing_model' => false, + 'redirect_from_issuer_method' => false, + 'redirect_to_issuer_method' => false, + 'reference' => false, + 'return_url' => false, + 'risk_data' => false, + 'session_validity' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'splits' => false, + 'store' => false, + 'store_payment_method' => false, + 'telephone_number' => false, + 'three_ds2_request_data' => false, + 'three_ds_authentication_only' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'authentication_data' => 'authenticationData', + 'billing_address' => 'billingAddress', + 'browser_info' => 'browserInfo', + 'capture_delay_hours' => 'captureDelayHours', + 'channel' => 'channel', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'company' => 'company', + 'conversion_id' => 'conversionId', + 'country_code' => 'countryCode', + 'date_of_birth' => 'dateOfBirth', + 'dcc_quote' => 'dccQuote', + 'delivery_address' => 'deliveryAddress', + 'delivery_date' => 'deliveryDate', + 'device_fingerprint' => 'deviceFingerprint', + 'donation_account' => 'donationAccount', + 'donation_original_psp_reference' => 'donationOriginalPspReference', + 'donation_token' => 'donationToken', + 'enable_one_click' => 'enableOneClick', + 'enable_pay_out' => 'enablePayOut', + 'enable_recurring' => 'enableRecurring', + 'entity_type' => 'entityType', + 'fraud_offset' => 'fraudOffset', + 'industry_usage' => 'industryUsage', + 'installments' => 'installments', + 'line_items' => 'lineItems', + 'localized_shopper_statement' => 'localizedShopperStatement', + 'mandate' => 'mandate', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'merchant_risk_indicator' => 'merchantRiskIndicator', + 'metadata' => 'metadata', + 'mpi_data' => 'mpiData', + 'order' => 'order', + 'order_reference' => 'orderReference', + 'origin' => 'origin', + 'payment_method' => 'paymentMethod', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'recurring_processing_model' => 'recurringProcessingModel', + 'redirect_from_issuer_method' => 'redirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'redirectToIssuerMethod', + 'reference' => 'reference', + 'return_url' => 'returnUrl', + 'risk_data' => 'riskData', + 'session_validity' => 'sessionValidity', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'splits' => 'splits', + 'store' => 'store', + 'store_payment_method' => 'storePaymentMethod', + 'telephone_number' => 'telephoneNumber', + 'three_ds2_request_data' => 'threeDS2RequestData', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'authentication_data' => 'setAuthenticationData', + 'billing_address' => 'setBillingAddress', + 'browser_info' => 'setBrowserInfo', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'channel' => 'setChannel', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'company' => 'setCompany', + 'conversion_id' => 'setConversionId', + 'country_code' => 'setCountryCode', + 'date_of_birth' => 'setDateOfBirth', + 'dcc_quote' => 'setDccQuote', + 'delivery_address' => 'setDeliveryAddress', + 'delivery_date' => 'setDeliveryDate', + 'device_fingerprint' => 'setDeviceFingerprint', + 'donation_account' => 'setDonationAccount', + 'donation_original_psp_reference' => 'setDonationOriginalPspReference', + 'donation_token' => 'setDonationToken', + 'enable_one_click' => 'setEnableOneClick', + 'enable_pay_out' => 'setEnablePayOut', + 'enable_recurring' => 'setEnableRecurring', + 'entity_type' => 'setEntityType', + 'fraud_offset' => 'setFraudOffset', + 'industry_usage' => 'setIndustryUsage', + 'installments' => 'setInstallments', + 'line_items' => 'setLineItems', + 'localized_shopper_statement' => 'setLocalizedShopperStatement', + 'mandate' => 'setMandate', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'merchant_risk_indicator' => 'setMerchantRiskIndicator', + 'metadata' => 'setMetadata', + 'mpi_data' => 'setMpiData', + 'order' => 'setOrder', + 'order_reference' => 'setOrderReference', + 'origin' => 'setOrigin', + 'payment_method' => 'setPaymentMethod', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'redirect_from_issuer_method' => 'setRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'setRedirectToIssuerMethod', + 'reference' => 'setReference', + 'return_url' => 'setReturnUrl', + 'risk_data' => 'setRiskData', + 'session_validity' => 'setSessionValidity', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'store_payment_method' => 'setStorePaymentMethod', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds2_request_data' => 'setThreeDs2RequestData', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'authentication_data' => 'getAuthenticationData', + 'billing_address' => 'getBillingAddress', + 'browser_info' => 'getBrowserInfo', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'channel' => 'getChannel', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'company' => 'getCompany', + 'conversion_id' => 'getConversionId', + 'country_code' => 'getCountryCode', + 'date_of_birth' => 'getDateOfBirth', + 'dcc_quote' => 'getDccQuote', + 'delivery_address' => 'getDeliveryAddress', + 'delivery_date' => 'getDeliveryDate', + 'device_fingerprint' => 'getDeviceFingerprint', + 'donation_account' => 'getDonationAccount', + 'donation_original_psp_reference' => 'getDonationOriginalPspReference', + 'donation_token' => 'getDonationToken', + 'enable_one_click' => 'getEnableOneClick', + 'enable_pay_out' => 'getEnablePayOut', + 'enable_recurring' => 'getEnableRecurring', + 'entity_type' => 'getEntityType', + 'fraud_offset' => 'getFraudOffset', + 'industry_usage' => 'getIndustryUsage', + 'installments' => 'getInstallments', + 'line_items' => 'getLineItems', + 'localized_shopper_statement' => 'getLocalizedShopperStatement', + 'mandate' => 'getMandate', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'merchant_risk_indicator' => 'getMerchantRiskIndicator', + 'metadata' => 'getMetadata', + 'mpi_data' => 'getMpiData', + 'order' => 'getOrder', + 'order_reference' => 'getOrderReference', + 'origin' => 'getOrigin', + 'payment_method' => 'getPaymentMethod', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'redirect_from_issuer_method' => 'getRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'getRedirectToIssuerMethod', + 'reference' => 'getReference', + 'return_url' => 'getReturnUrl', + 'risk_data' => 'getRiskData', + 'session_validity' => 'getSessionValidity', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'store_payment_method' => 'getStorePaymentMethod', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds2_request_data' => 'getThreeDs2RequestData', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHANNEL_I_OS = 'iOS'; + public const CHANNEL_ANDROID = 'Android'; + public const CHANNEL_WEB = 'Web'; + public const ENTITY_TYPE_NATURAL_PERSON = 'NaturalPerson'; + public const ENTITY_TYPE_COMPANY_NAME = 'CompanyName'; + public const INDUSTRY_USAGE_DELAYED_CHARGE = 'delayedCharge'; + public const INDUSTRY_USAGE_INSTALLMENT = 'installment'; + public const INDUSTRY_USAGE_NO_SHOW = 'noShow'; + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChannelAllowableValues() + { + return [ + self::CHANNEL_I_OS, + self::CHANNEL_ANDROID, + self::CHANNEL_WEB, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEntityTypeAllowableValues() + { + return [ + self::ENTITY_TYPE_NATURAL_PERSON, + self::ENTITY_TYPE_COMPANY_NAME, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIndustryUsageAllowableValues() + { + return [ + self::INDUSTRY_USAGE_DELAYED_CHARGE, + self::INDUSTRY_USAGE_INSTALLMENT, + self::INDUSTRY_USAGE_NO_SHOW, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('authentication_data', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('browser_info', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('conversion_id', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('dcc_quote', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('delivery_date', $data ?? [], null); + $this->setIfExists('device_fingerprint', $data ?? [], null); + $this->setIfExists('donation_account', $data ?? [], null); + $this->setIfExists('donation_original_psp_reference', $data ?? [], null); + $this->setIfExists('donation_token', $data ?? [], null); + $this->setIfExists('enable_one_click', $data ?? [], null); + $this->setIfExists('enable_pay_out', $data ?? [], null); + $this->setIfExists('enable_recurring', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('industry_usage', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('localized_shopper_statement', $data ?? [], null); + $this->setIfExists('mandate', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('merchant_risk_indicator', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('order_reference', $data ?? [], null); + $this->setIfExists('origin', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('redirect_from_issuer_method', $data ?? [], null); + $this->setIfExists('redirect_to_issuer_method', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('risk_data', $data ?? [], null); + $this->setIfExists('session_validity', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_payment_method', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds2_request_data', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getChannelAllowableValues(); + if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['donation_account'] === null) { + $invalidProperties[] = "'donation_account' can't be null"; + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!is_null($this->container['entity_type']) && !in_array($this->container['entity_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'entity_type', must be one of '%s'", + $this->container['entity_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!is_null($this->container['industry_usage']) && !in_array($this->container['industry_usage'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'industry_usage', must be one of '%s'", + $this->container['industry_usage'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['return_url'] === null) { + $invalidProperties[] = "'return_url' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + 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 account_info + * + * @return \Adyen\Model\Checkout\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Checkout\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets authentication_data + * + * @return \Adyen\Model\Checkout\AuthenticationData|null + */ + public function getAuthenticationData() + { + return $this->container['authentication_data']; + } + + /** + * Sets authentication_data + * + * @param \Adyen\Model\Checkout\AuthenticationData|null $authentication_data authentication_data + * + * @return self + */ + public function setAuthenticationData($authentication_data) + { + if (is_null($authentication_data)) { + throw new \InvalidArgumentException('non-nullable authentication_data cannot be null'); + } + $this->container['authentication_data'] = $authentication_data; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets browser_info + * + * @return \Adyen\Model\Checkout\BrowserInfo|null + */ + public function getBrowserInfo() + { + return $this->container['browser_info']; + } + + /** + * Sets browser_info + * + * @param \Adyen\Model\Checkout\BrowserInfo|null $browser_info browser_info + * + * @return self + */ + public function setBrowserInfo($browser_info) + { + if (is_null($browser_info)) { + throw new \InvalidArgumentException('non-nullable browser_info cannot be null'); + } + $this->container['browser_info'] = $browser_info; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets channel + * + * @return string|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string|null $channel The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $allowedValues = $this->getChannelAllowableValues(); + if (!in_array($channel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets company + * + * @return \Adyen\Model\Checkout\Company|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param \Adyen\Model\Checkout\Company|null $company company + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets conversion_id + * + * @return string|null + */ + public function getConversionId() + { + return $this->container['conversion_id']; + } + + /** + * Sets conversion_id + * + * @param string|null $conversion_id Conversion ID that corresponds to the Id generated for tracking user payment journey. + * + * @return self + */ + public function setConversionId($conversion_id) + { + if (is_null($conversion_id)) { + throw new \InvalidArgumentException('non-nullable conversion_id cannot be null'); + } + $this->container['conversion_id'] = $conversion_id; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets dcc_quote + * + * @return \Adyen\Model\Checkout\ForexQuote|null + */ + public function getDccQuote() + { + return $this->container['dcc_quote']; + } + + /** + * Sets dcc_quote + * + * @param \Adyen\Model\Checkout\ForexQuote|null $dcc_quote dcc_quote + * + * @return self + */ + public function setDccQuote($dcc_quote) + { + if (is_null($dcc_quote)) { + throw new \InvalidArgumentException('non-nullable dcc_quote cannot be null'); + } + $this->container['dcc_quote'] = $dcc_quote; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets delivery_date + * + * @return \DateTime|null + */ + public function getDeliveryDate() + { + return $this->container['delivery_date']; + } + + /** + * Sets delivery_date + * + * @param \DateTime|null $delivery_date The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliveryDate($delivery_date) + { + if (is_null($delivery_date)) { + throw new \InvalidArgumentException('non-nullable delivery_date cannot be null'); + } + $this->container['delivery_date'] = $delivery_date; + + return $this; + } + + /** + * Gets device_fingerprint + * + * @return string|null + */ + public function getDeviceFingerprint() + { + return $this->container['device_fingerprint']; + } + + /** + * Sets device_fingerprint + * + * @param string|null $device_fingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + * + * @return self + */ + public function setDeviceFingerprint($device_fingerprint) + { + if (is_null($device_fingerprint)) { + throw new \InvalidArgumentException('non-nullable device_fingerprint cannot be null'); + } + $this->container['device_fingerprint'] = $device_fingerprint; + + return $this; + } + + /** + * Gets donation_account + * + * @return string + */ + public function getDonationAccount() + { + return $this->container['donation_account']; + } + + /** + * Sets donation_account + * + * @param string $donation_account Donation account to which the transaction is credited. + * + * @return self + */ + public function setDonationAccount($donation_account) + { + if (is_null($donation_account)) { + throw new \InvalidArgumentException('non-nullable donation_account cannot be null'); + } + $this->container['donation_account'] = $donation_account; + + return $this; + } + + /** + * Gets donation_original_psp_reference + * + * @return string|null + */ + public function getDonationOriginalPspReference() + { + return $this->container['donation_original_psp_reference']; + } + + /** + * Sets donation_original_psp_reference + * + * @param string|null $donation_original_psp_reference PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. + * + * @return self + */ + public function setDonationOriginalPspReference($donation_original_psp_reference) + { + if (is_null($donation_original_psp_reference)) { + throw new \InvalidArgumentException('non-nullable donation_original_psp_reference cannot be null'); + } + $this->container['donation_original_psp_reference'] = $donation_original_psp_reference; + + return $this; + } + + /** + * Gets donation_token + * + * @return string|null + */ + public function getDonationToken() + { + return $this->container['donation_token']; + } + + /** + * Sets donation_token + * + * @param string|null $donation_token Donation token received in the `/payments` call. + * + * @return self + */ + public function setDonationToken($donation_token) + { + if (is_null($donation_token)) { + throw new \InvalidArgumentException('non-nullable donation_token cannot be null'); + } + $this->container['donation_token'] = $donation_token; + + return $this; + } + + /** + * Gets enable_one_click + * + * @return bool|null + */ + public function getEnableOneClick() + { + return $this->container['enable_one_click']; + } + + /** + * Sets enable_one_click + * + * @param bool|null $enable_one_click When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * + * @return self + */ + public function setEnableOneClick($enable_one_click) + { + if (is_null($enable_one_click)) { + throw new \InvalidArgumentException('non-nullable enable_one_click cannot be null'); + } + $this->container['enable_one_click'] = $enable_one_click; + + return $this; + } + + /** + * Gets enable_pay_out + * + * @return bool|null + */ + public function getEnablePayOut() + { + return $this->container['enable_pay_out']; + } + + /** + * Sets enable_pay_out + * + * @param bool|null $enable_pay_out When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + * + * @return self + */ + public function setEnablePayOut($enable_pay_out) + { + if (is_null($enable_pay_out)) { + throw new \InvalidArgumentException('non-nullable enable_pay_out cannot be null'); + } + $this->container['enable_pay_out'] = $enable_pay_out; + + return $this; + } + + /** + * Gets enable_recurring + * + * @return bool|null + */ + public function getEnableRecurring() + { + return $this->container['enable_recurring']; + } + + /** + * Sets enable_recurring + * + * @param bool|null $enable_recurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * + * @return self + */ + public function setEnableRecurring($enable_recurring) + { + if (is_null($enable_recurring)) { + throw new \InvalidArgumentException('non-nullable enable_recurring cannot be null'); + } + $this->container['enable_recurring'] = $enable_recurring; + + return $this; + } + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type The type of the entity the payment is processed for. + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + throw new \InvalidArgumentException('non-nullable entity_type cannot be null'); + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!in_array($entity_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'entity_type', must be one of '%s'", + $entity_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets industry_usage + * + * @return string|null + */ + public function getIndustryUsage() + { + return $this->container['industry_usage']; + } + + /** + * Sets industry_usage + * + * @param string|null $industry_usage The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + * + * @return self + */ + public function setIndustryUsage($industry_usage) + { + if (is_null($industry_usage)) { + throw new \InvalidArgumentException('non-nullable industry_usage cannot be null'); + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!in_array($industry_usage, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'industry_usage', must be one of '%s'", + $industry_usage, + implode("', '", $allowedValues) + ) + ); + } + $this->container['industry_usage'] = $industry_usage; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Checkout\Installments|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Checkout\Installments|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets localized_shopper_statement + * + * @return array|null + */ + public function getLocalizedShopperStatement() + { + return $this->container['localized_shopper_statement']; + } + + /** + * Sets localized_shopper_statement + * + * @param array|null $localized_shopper_statement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * + * @return self + */ + public function setLocalizedShopperStatement($localized_shopper_statement) + { + if (is_null($localized_shopper_statement)) { + throw new \InvalidArgumentException('non-nullable localized_shopper_statement cannot be null'); + } + $this->container['localized_shopper_statement'] = $localized_shopper_statement; + + return $this; + } + + /** + * Gets mandate + * + * @return \Adyen\Model\Checkout\Mandate|null + */ + public function getMandate() + { + return $this->container['mandate']; + } + + /** + * Sets mandate + * + * @param \Adyen\Model\Checkout\Mandate|null $mandate mandate + * + * @return self + */ + public function setMandate($mandate) + { + if (is_null($mandate)) { + throw new \InvalidArgumentException('non-nullable mandate cannot be null'); + } + $this->container['mandate'] = $mandate; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets merchant_risk_indicator + * + * @return \Adyen\Model\Checkout\MerchantRiskIndicator|null + */ + public function getMerchantRiskIndicator() + { + return $this->container['merchant_risk_indicator']; + } + + /** + * Sets merchant_risk_indicator + * + * @param \Adyen\Model\Checkout\MerchantRiskIndicator|null $merchant_risk_indicator merchant_risk_indicator + * + * @return self + */ + public function setMerchantRiskIndicator($merchant_risk_indicator) + { + if (is_null($merchant_risk_indicator)) { + throw new \InvalidArgumentException('non-nullable merchant_risk_indicator cannot be null'); + } + $this->container['merchant_risk_indicator'] = $merchant_risk_indicator; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Checkout\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Checkout\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets order + * + * @return \Adyen\Model\Checkout\CheckoutOrder|null + */ + public function getOrder() + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param \Adyen\Model\Checkout\CheckoutOrder|null $order order + * + * @return self + */ + public function setOrder($order) + { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets order_reference + * + * @return string|null + */ + public function getOrderReference() + { + return $this->container['order_reference']; + } + + /** + * Sets order_reference + * + * @param string|null $order_reference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + * + * @return self + */ + public function setOrderReference($order_reference) + { + if (is_null($order_reference)) { + throw new \InvalidArgumentException('non-nullable order_reference cannot be null'); + } + $this->container['order_reference'] = $order_reference; + + return $this; + } + + /** + * Gets origin + * + * @return string|null + */ + public function getOrigin() + { + return $this->container['origin']; + } + + /** + * Sets origin + * + * @param string|null $origin Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + * + * @return self + */ + public function setOrigin($origin) + { + if (is_null($origin)) { + throw new \InvalidArgumentException('non-nullable origin cannot be null'); + } + $this->container['origin'] = $origin; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Adyen\Model\Checkout\CheckoutPaymentMethod + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Adyen\Model\Checkout\CheckoutPaymentMethod $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param string|null $recurring_expiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Minimum number of days between authorisations. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets redirect_from_issuer_method + * + * @return string|null + */ + public function getRedirectFromIssuerMethod() + { + return $this->container['redirect_from_issuer_method']; + } + + /** + * Sets redirect_from_issuer_method + * + * @param string|null $redirect_from_issuer_method Specifies the redirect method (GET or POST) when redirecting back from the issuer. + * + * @return self + */ + public function setRedirectFromIssuerMethod($redirect_from_issuer_method) + { + if (is_null($redirect_from_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_from_issuer_method cannot be null'); + } + $this->container['redirect_from_issuer_method'] = $redirect_from_issuer_method; + + return $this; + } + + /** + * Gets redirect_to_issuer_method + * + * @return string|null + */ + public function getRedirectToIssuerMethod() + { + return $this->container['redirect_to_issuer_method']; + } + + /** + * Sets redirect_to_issuer_method + * + * @param string|null $redirect_to_issuer_method Specifies the redirect method (GET or POST) when redirecting to the issuer. + * + * @return self + */ + public function setRedirectToIssuerMethod($redirect_to_issuer_method) + { + if (is_null($redirect_to_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_to_issuer_method cannot be null'); + } + $this->container['redirect_to_issuer_method'] = $redirect_to_issuer_method; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets return_url + * + * @return string + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string $return_url The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets risk_data + * + * @return \Adyen\Model\Checkout\RiskData|null + */ + public function getRiskData() + { + return $this->container['risk_data']; + } + + /** + * Sets risk_data + * + * @param \Adyen\Model\Checkout\RiskData|null $risk_data risk_data + * + * @return self + */ + public function setRiskData($risk_data) + { + if (is_null($risk_data)) { + throw new \InvalidArgumentException('non-nullable risk_data cannot be null'); + } + $this->container['risk_data'] = $risk_data; + + return $this; + } + + /** + * Gets session_validity + * + * @return string|null + */ + public function getSessionValidity() + { + return $this->container['session_validity']; + } + + /** + * Sets session_validity + * + * @param string|null $session_validity The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + * + * @return self + */ + public function setSessionValidity($session_validity) + { + if (is_null($session_validity)) { + throw new \InvalidArgumentException('non-nullable session_validity cannot be null'); + } + $this->container['session_validity'] = $session_validity; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_payment_method + * + * @return bool|null + */ + public function getStorePaymentMethod() + { + return $this->container['store_payment_method']; + } + + /** + * Sets store_payment_method + * + * @param bool|null $store_payment_method When true and `shopperReference` is provided, the payment details will be stored. + * + * @return self + */ + public function setStorePaymentMethod($store_payment_method) + { + if (is_null($store_payment_method)) { + throw new \InvalidArgumentException('non-nullable store_payment_method cannot be null'); + } + $this->container['store_payment_method'] = $store_payment_method; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds2_request_data + * + * @return \Adyen\Model\Checkout\ThreeDS2RequestData|null + */ + public function getThreeDs2RequestData() + { + return $this->container['three_ds2_request_data']; + } + + /** + * Sets three_ds2_request_data + * + * @param \Adyen\Model\Checkout\ThreeDS2RequestData|null $three_ds2_request_data three_ds2_request_data + * + * @return self + */ + public function setThreeDs2RequestData($three_ds2_request_data) + { + if (is_null($three_ds2_request_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_request_data cannot be null'); + } + $this->container['three_ds2_request_data'] = $three_ds2_request_data; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + * @deprecated + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + * @deprecated + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentLinkResponse.php b/src/Adyen/Model/Checkout/PaymentLinkResponse.php new file mode 100644 index 000000000..64a89a0a6 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentLinkResponse.php @@ -0,0 +1,1901 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentLinkResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentLinkResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentLinkResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed_payment_methods' => 'string[]', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'blocked_payment_methods' => 'string[]', + 'capture_delay_hours' => 'int', + 'country_code' => 'string', + 'date_of_birth' => '\DateTime', + 'deliver_at' => '\DateTime', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'description' => 'string', + 'expires_at' => 'string', + 'id' => 'string', + 'installment_options' => 'array', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'manual_capture' => 'bool', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'metadata' => 'array', + 'recurring_processing_model' => 'string', + 'reference' => 'string', + 'required_shopper_fields' => 'string[]', + 'return_url' => 'string', + 'reusable' => 'bool', + 'risk_data' => '\Adyen\Model\Checkout\RiskData', + 'shopper_email' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'show_remove_payment_method_button' => 'bool', + 'social_security_number' => 'string', + 'split_card_funding_sources' => 'bool', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'status' => 'string', + 'store' => 'string', + 'store_payment_method_mode' => 'string', + 'telephone_number' => 'string', + 'theme_id' => 'string', + 'updated_at' => '\DateTime', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed_payment_methods' => null, + 'amount' => null, + 'billing_address' => null, + 'blocked_payment_methods' => null, + 'capture_delay_hours' => 'int32', + 'country_code' => null, + 'date_of_birth' => 'date', + 'deliver_at' => 'date-time', + 'delivery_address' => null, + 'description' => null, + 'expires_at' => null, + 'id' => null, + 'installment_options' => null, + 'line_items' => null, + 'manual_capture' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'metadata' => null, + 'recurring_processing_model' => null, + 'reference' => null, + 'required_shopper_fields' => null, + 'return_url' => null, + 'reusable' => null, + 'risk_data' => null, + 'shopper_email' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'show_remove_payment_method_button' => null, + 'social_security_number' => null, + 'split_card_funding_sources' => null, + 'splits' => null, + 'status' => null, + 'store' => null, + 'store_payment_method_mode' => null, + 'telephone_number' => null, + 'theme_id' => null, + 'updated_at' => 'date-time', + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed_payment_methods' => false, + 'amount' => false, + 'billing_address' => false, + 'blocked_payment_methods' => false, + 'capture_delay_hours' => true, + 'country_code' => false, + 'date_of_birth' => false, + 'deliver_at' => false, + 'delivery_address' => false, + 'description' => false, + 'expires_at' => false, + 'id' => false, + 'installment_options' => false, + 'line_items' => false, + 'manual_capture' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'metadata' => false, + 'recurring_processing_model' => false, + 'reference' => false, + 'required_shopper_fields' => false, + 'return_url' => false, + 'reusable' => false, + 'risk_data' => false, + 'shopper_email' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'show_remove_payment_method_button' => false, + 'social_security_number' => false, + 'split_card_funding_sources' => false, + 'splits' => false, + 'status' => false, + 'store' => false, + 'store_payment_method_mode' => false, + 'telephone_number' => false, + 'theme_id' => false, + 'updated_at' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_payment_methods' => 'allowedPaymentMethods', + 'amount' => 'amount', + 'billing_address' => 'billingAddress', + 'blocked_payment_methods' => 'blockedPaymentMethods', + 'capture_delay_hours' => 'captureDelayHours', + 'country_code' => 'countryCode', + 'date_of_birth' => 'dateOfBirth', + 'deliver_at' => 'deliverAt', + 'delivery_address' => 'deliveryAddress', + 'description' => 'description', + 'expires_at' => 'expiresAt', + 'id' => 'id', + 'installment_options' => 'installmentOptions', + 'line_items' => 'lineItems', + 'manual_capture' => 'manualCapture', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'metadata' => 'metadata', + 'recurring_processing_model' => 'recurringProcessingModel', + 'reference' => 'reference', + 'required_shopper_fields' => 'requiredShopperFields', + 'return_url' => 'returnUrl', + 'reusable' => 'reusable', + 'risk_data' => 'riskData', + 'shopper_email' => 'shopperEmail', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'show_remove_payment_method_button' => 'showRemovePaymentMethodButton', + 'social_security_number' => 'socialSecurityNumber', + 'split_card_funding_sources' => 'splitCardFundingSources', + 'splits' => 'splits', + 'status' => 'status', + 'store' => 'store', + 'store_payment_method_mode' => 'storePaymentMethodMode', + 'telephone_number' => 'telephoneNumber', + 'theme_id' => 'themeId', + 'updated_at' => 'updatedAt', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_payment_methods' => 'setAllowedPaymentMethods', + 'amount' => 'setAmount', + 'billing_address' => 'setBillingAddress', + 'blocked_payment_methods' => 'setBlockedPaymentMethods', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'country_code' => 'setCountryCode', + 'date_of_birth' => 'setDateOfBirth', + 'deliver_at' => 'setDeliverAt', + 'delivery_address' => 'setDeliveryAddress', + 'description' => 'setDescription', + 'expires_at' => 'setExpiresAt', + 'id' => 'setId', + 'installment_options' => 'setInstallmentOptions', + 'line_items' => 'setLineItems', + 'manual_capture' => 'setManualCapture', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'metadata' => 'setMetadata', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'reference' => 'setReference', + 'required_shopper_fields' => 'setRequiredShopperFields', + 'return_url' => 'setReturnUrl', + 'reusable' => 'setReusable', + 'risk_data' => 'setRiskData', + 'shopper_email' => 'setShopperEmail', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'show_remove_payment_method_button' => 'setShowRemovePaymentMethodButton', + 'social_security_number' => 'setSocialSecurityNumber', + 'split_card_funding_sources' => 'setSplitCardFundingSources', + 'splits' => 'setSplits', + 'status' => 'setStatus', + 'store' => 'setStore', + 'store_payment_method_mode' => 'setStorePaymentMethodMode', + 'telephone_number' => 'setTelephoneNumber', + 'theme_id' => 'setThemeId', + 'updated_at' => 'setUpdatedAt', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_payment_methods' => 'getAllowedPaymentMethods', + 'amount' => 'getAmount', + 'billing_address' => 'getBillingAddress', + 'blocked_payment_methods' => 'getBlockedPaymentMethods', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'country_code' => 'getCountryCode', + 'date_of_birth' => 'getDateOfBirth', + 'deliver_at' => 'getDeliverAt', + 'delivery_address' => 'getDeliveryAddress', + 'description' => 'getDescription', + 'expires_at' => 'getExpiresAt', + 'id' => 'getId', + 'installment_options' => 'getInstallmentOptions', + 'line_items' => 'getLineItems', + 'manual_capture' => 'getManualCapture', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'metadata' => 'getMetadata', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'reference' => 'getReference', + 'required_shopper_fields' => 'getRequiredShopperFields', + 'return_url' => 'getReturnUrl', + 'reusable' => 'getReusable', + 'risk_data' => 'getRiskData', + 'shopper_email' => 'getShopperEmail', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'show_remove_payment_method_button' => 'getShowRemovePaymentMethodButton', + 'social_security_number' => 'getSocialSecurityNumber', + 'split_card_funding_sources' => 'getSplitCardFundingSources', + 'splits' => 'getSplits', + 'status' => 'getStatus', + 'store' => 'getStore', + 'store_payment_method_mode' => 'getStorePaymentMethodMode', + 'telephone_number' => 'getTelephoneNumber', + 'theme_id' => 'getThemeId', + 'updated_at' => 'getUpdatedAt', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const REQUIRED_SHOPPER_FIELDS_BILLING_ADDRESS = 'billingAddress'; + public const REQUIRED_SHOPPER_FIELDS_DELIVERY_ADDRESS = 'deliveryAddress'; + public const REQUIRED_SHOPPER_FIELDS_SHOPPER_EMAIL = 'shopperEmail'; + public const REQUIRED_SHOPPER_FIELDS_SHOPPER_NAME = 'shopperName'; + public const REQUIRED_SHOPPER_FIELDS_TELEPHONE_NUMBER = 'telephoneNumber'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_COMPLETED = 'completed'; + public const STATUS_EXPIRED = 'expired'; + public const STATUS_PAID = 'paid'; + public const STATUS_PAYMENT_PENDING = 'paymentPending'; + public const STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT = 'askForConsent'; + public const STORE_PAYMENT_METHOD_MODE_DISABLED = 'disabled'; + public const STORE_PAYMENT_METHOD_MODE_ENABLED = 'enabled'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRequiredShopperFieldsAllowableValues() + { + return [ + self::REQUIRED_SHOPPER_FIELDS_BILLING_ADDRESS, + self::REQUIRED_SHOPPER_FIELDS_DELIVERY_ADDRESS, + self::REQUIRED_SHOPPER_FIELDS_SHOPPER_EMAIL, + self::REQUIRED_SHOPPER_FIELDS_SHOPPER_NAME, + self::REQUIRED_SHOPPER_FIELDS_TELEPHONE_NUMBER, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_COMPLETED, + self::STATUS_EXPIRED, + self::STATUS_PAID, + self::STATUS_PAYMENT_PENDING, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStorePaymentMethodModeAllowableValues() + { + return [ + self::STORE_PAYMENT_METHOD_MODE_ASK_FOR_CONSENT, + self::STORE_PAYMENT_METHOD_MODE_DISABLED, + self::STORE_PAYMENT_METHOD_MODE_ENABLED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed_payment_methods', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('blocked_payment_methods', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('deliver_at', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('installment_options', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('manual_capture', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('required_shopper_fields', $data ?? [], null); + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('reusable', $data ?? [], null); + $this->setIfExists('risk_data', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('show_remove_payment_method_button', $data ?? [], true); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('split_card_funding_sources', $data ?? [], false); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_payment_method_mode', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('theme_id', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!is_null($this->container['store_payment_method_mode']) && !in_array($this->container['store_payment_method_mode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $this->container['store_payment_method_mode'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed_payment_methods + * + * @return string[]|null + */ + public function getAllowedPaymentMethods() + { + return $this->container['allowed_payment_methods']; + } + + /** + * Sets allowed_payment_methods + * + * @param string[]|null $allowed_payment_methods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setAllowedPaymentMethods($allowed_payment_methods) + { + if (is_null($allowed_payment_methods)) { + throw new \InvalidArgumentException('non-nullable allowed_payment_methods cannot be null'); + } + $this->container['allowed_payment_methods'] = $allowed_payment_methods; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets blocked_payment_methods + * + * @return string[]|null + */ + public function getBlockedPaymentMethods() + { + return $this->container['blocked_payment_methods']; + } + + /** + * Sets blocked_payment_methods + * + * @param string[]|null $blocked_payment_methods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setBlockedPaymentMethods($blocked_payment_methods) + { + if (is_null($blocked_payment_methods)) { + throw new \InvalidArgumentException('non-nullable blocked_payment_methods cannot be null'); + } + $this->container['blocked_payment_methods'] = $blocked_payment_methods; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper's two-letter country code. + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets deliver_at + * + * @return \DateTime|null + */ + public function getDeliverAt() + { + return $this->container['deliver_at']; + } + + /** + * Sets deliver_at + * + * @param \DateTime|null $deliver_at The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setDeliverAt($deliver_at) + { + if (is_null($deliver_at)) { + throw new \InvalidArgumentException('non-nullable deliver_at cannot be null'); + } + $this->container['deliver_at'] = $deliver_at; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A short description visible on the payment page. Maximum length: 280 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets expires_at + * + * @return string|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string|null $expires_at The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id A unique identifier of the payment link. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets installment_options + * + * @return array|null + */ + public function getInstallmentOptions() + { + return $this->container['installment_options']; + } + + /** + * Sets installment_options + * + * @param array|null $installment_options A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + * + * @return self + */ + public function setInstallmentOptions($installment_options) + { + if (is_null($installment_options)) { + throw new \InvalidArgumentException('non-nullable installment_options cannot be null'); + } + $this->container['installment_options'] = $installment_options; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, and Zip. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets manual_capture + * + * @return bool|null + */ + public function getManualCapture() + { + return $this->container['manual_capture']; + } + + /** + * Sets manual_capture + * + * @param bool|null $manual_capture Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). + * + * @return self + */ + public function setManualCapture($manual_capture) + { + if (is_null($manual_capture)) { + throw new \InvalidArgumentException('non-nullable manual_capture cannot be null'); + } + $this->container['manual_capture'] = $manual_capture; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier for which the payment link is created. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Required when creating a token to store payment details. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference A reference that is used to uniquely identify the payment in future communications about the payment status. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets required_shopper_fields + * + * @return string[]|null + */ + public function getRequiredShopperFields() + { + return $this->container['required_shopper_fields']; + } + + /** + * Sets required_shopper_fields + * + * @param string[]|null $required_shopper_fields List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + * + * @return self + */ + public function setRequiredShopperFields($required_shopper_fields) + { + if (is_null($required_shopper_fields)) { + throw new \InvalidArgumentException('non-nullable required_shopper_fields cannot be null'); + } + $allowedValues = $this->getRequiredShopperFieldsAllowableValues(); + if (array_diff($required_shopper_fields, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'required_shopper_fields', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['required_shopper_fields'] = $required_shopper_fields; + + return $this; + } + + /** + * Gets return_url + * + * @return string|null + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string|null $return_url Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets reusable + * + * @return bool|null + */ + public function getReusable() + { + return $this->container['reusable']; + } + + /** + * Sets reusable + * + * @param bool|null $reusable Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. + * + * @return self + */ + public function setReusable($reusable) + { + if (is_null($reusable)) { + throw new \InvalidArgumentException('non-nullable reusable cannot be null'); + } + $this->container['reusable'] = $reusable; + + return $this; + } + + /** + * Gets risk_data + * + * @return \Adyen\Model\Checkout\RiskData|null + */ + public function getRiskData() + { + return $this->container['risk_data']; + } + + /** + * Sets risk_data + * + * @param \Adyen\Model\Checkout\RiskData|null $risk_data risk_data + * + * @return self + */ + public function setRiskData($risk_data) + { + if (is_null($risk_data)) { + throw new \InvalidArgumentException('non-nullable risk_data cannot be null'); + } + $this->container['risk_data'] = $risk_data; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets show_remove_payment_method_button + * + * @return bool|null + */ + public function getShowRemovePaymentMethodButton() + { + return $this->container['show_remove_payment_method_button']; + } + + /** + * Sets show_remove_payment_method_button + * + * @param bool|null $show_remove_payment_method_button Set to **false** to hide the button that lets the shopper remove a stored payment method. + * + * @return self + */ + public function setShowRemovePaymentMethodButton($show_remove_payment_method_button) + { + if (is_null($show_remove_payment_method_button)) { + throw new \InvalidArgumentException('non-nullable show_remove_payment_method_button cannot be null'); + } + $this->container['show_remove_payment_method_button'] = $show_remove_payment_method_button; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets split_card_funding_sources + * + * @return bool|null + */ + public function getSplitCardFundingSources() + { + return $this->container['split_card_funding_sources']; + } + + /** + * Sets split_card_funding_sources + * + * @param bool|null $split_card_funding_sources Boolean value indicating whether the card payment method should be split into separate debit and credit options. + * + * @return self + */ + public function setSplitCardFundingSources($split_card_funding_sources) + { + if (is_null($split_card_funding_sources)) { + throw new \InvalidArgumentException('non-nullable split_card_funding_sources cannot be null'); + } + $this->container['split_card_funding_sources'] = $split_card_funding_sources; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The physical store, for which this payment is processed. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_payment_method_mode + * + * @return string|null + */ + public function getStorePaymentMethodMode() + { + return $this->container['store_payment_method_mode']; + } + + /** + * Sets store_payment_method_mode + * + * @param string|null $store_payment_method_mode Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + * + * @return self + */ + public function setStorePaymentMethodMode($store_payment_method_mode) + { + if (is_null($store_payment_method_mode)) { + throw new \InvalidArgumentException('non-nullable store_payment_method_mode cannot be null'); + } + $allowedValues = $this->getStorePaymentMethodModeAllowableValues(); + if (!in_array($store_payment_method_mode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'store_payment_method_mode', must be one of '%s'", + $store_payment_method_mode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['store_payment_method_mode'] = $store_payment_method_mode; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets theme_id + * + * @return string|null + */ + public function getThemeId() + { + return $this->container['theme_id']; + } + + /** + * Sets theme_id + * + * @param string|null $theme_id A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. + * + * @return self + */ + public function setThemeId($theme_id) + { + if (is_null($theme_id)) { + throw new \InvalidArgumentException('non-nullable theme_id cannot be null'); + } + $this->container['theme_id'] = $theme_id; + + 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 when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url The URL at which the shopper can complete the payment. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentMethod.php b/src/Adyen/Model/Checkout/PaymentMethod.php new file mode 100644 index 000000000..ef668dd3c --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentMethod.php @@ -0,0 +1,692 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentMethod Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brand' => 'string', + 'brands' => 'string[]', + 'configuration' => 'array', + 'funding_source' => 'string', + 'group' => '\Adyen\Model\Checkout\PaymentMethodGroup', + 'input_details' => '\Adyen\Model\Checkout\InputDetail[]', + 'issuers' => '\Adyen\Model\Checkout\PaymentMethodIssuer[]', + 'name' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brand' => null, + 'brands' => null, + 'configuration' => null, + 'funding_source' => null, + 'group' => null, + 'input_details' => null, + 'issuers' => null, + 'name' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brand' => false, + 'brands' => false, + 'configuration' => false, + 'funding_source' => false, + 'group' => false, + 'input_details' => false, + 'issuers' => false, + 'name' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brand' => 'brand', + 'brands' => 'brands', + 'configuration' => 'configuration', + 'funding_source' => 'fundingSource', + 'group' => 'group', + 'input_details' => 'inputDetails', + 'issuers' => 'issuers', + 'name' => 'name', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brand' => 'setBrand', + 'brands' => 'setBrands', + 'configuration' => 'setConfiguration', + 'funding_source' => 'setFundingSource', + 'group' => 'setGroup', + 'input_details' => 'setInputDetails', + 'issuers' => 'setIssuers', + 'name' => 'setName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brand' => 'getBrand', + 'brands' => 'getBrands', + 'configuration' => 'getConfiguration', + 'funding_source' => 'getFundingSource', + 'group' => 'getGroup', + 'input_details' => 'getInputDetails', + 'issuers' => 'getIssuers', + 'name' => 'getName', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('brands', $data ?? [], null); + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('group', $data ?? [], null); + $this->setIfExists('input_details', $data ?? [], null); + $this->setIfExists('issuers', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + 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 brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand Brand for the selected gift card. For example: plastix, hmclub. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets brands + * + * @return string[]|null + */ + public function getBrands() + { + return $this->container['brands']; + } + + /** + * Sets brands + * + * @param string[]|null $brands List of possible brands. For example: visa, mc. + * + * @return self + */ + public function setBrands($brands) + { + if (is_null($brands)) { + throw new \InvalidArgumentException('non-nullable brands cannot be null'); + } + $this->container['brands'] = $brands; + + return $this; + } + + /** + * Gets configuration + * + * @return array|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param array|null $configuration The configuration of the payment method. + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source of the payment method. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets group + * + * @return \Adyen\Model\Checkout\PaymentMethodGroup|null + */ + public function getGroup() + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param \Adyen\Model\Checkout\PaymentMethodGroup|null $group group + * + * @return self + */ + public function setGroup($group) + { + if (is_null($group)) { + throw new \InvalidArgumentException('non-nullable group cannot be null'); + } + $this->container['group'] = $group; + + return $this; + } + + /** + * Gets input_details + * + * @return \Adyen\Model\Checkout\InputDetail[]|null + * @deprecated + */ + public function getInputDetails() + { + return $this->container['input_details']; + } + + /** + * Sets input_details + * + * @param \Adyen\Model\Checkout\InputDetail[]|null $input_details All input details to be provided to complete the payment with this payment method. + * + * @return self + * @deprecated + */ + public function setInputDetails($input_details) + { + if (is_null($input_details)) { + throw new \InvalidArgumentException('non-nullable input_details cannot be null'); + } + $this->container['input_details'] = $input_details; + + return $this; + } + + /** + * Gets issuers + * + * @return \Adyen\Model\Checkout\PaymentMethodIssuer[]|null + */ + public function getIssuers() + { + return $this->container['issuers']; + } + + /** + * Sets issuers + * + * @param \Adyen\Model\Checkout\PaymentMethodIssuer[]|null $issuers A list of issuers for this payment method. + * + * @return self + */ + public function setIssuers($issuers) + { + if (is_null($issuers)) { + throw new \InvalidArgumentException('non-nullable issuers cannot be null'); + } + $this->container['issuers'] = $issuers; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The displayable name of this payment method. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The unique payment method code. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentMethodGroup.php b/src/Adyen/Model/Checkout/PaymentMethodGroup.php new file mode 100644 index 000000000..6370186fa --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentMethodGroup.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentMethodGroup Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentMethodGroup implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'payment_method_data' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'payment_method_data' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false, + 'payment_method_data' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'payment_method_data' => 'paymentMethodData', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'payment_method_data' => 'setPaymentMethodData', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'payment_method_data' => 'getPaymentMethodData', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('payment_method_data', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the group. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets payment_method_data + * + * @return string|null + */ + public function getPaymentMethodData() + { + return $this->container['payment_method_data']; + } + + /** + * Sets payment_method_data + * + * @param string|null $payment_method_data Echo data to be used if the payment method is displayed as part of this group. + * + * @return self + */ + public function setPaymentMethodData($payment_method_data) + { + if (is_null($payment_method_data)) { + throw new \InvalidArgumentException('non-nullable payment_method_data cannot be null'); + } + $this->container['payment_method_data'] = $payment_method_data; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The unique code of the group. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentMethodIssuer.php b/src/Adyen/Model/Checkout/PaymentMethodIssuer.php new file mode 100644 index 000000000..0f43d00f9 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentMethodIssuer.php @@ -0,0 +1,461 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentMethodIssuer Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentMethodIssuer implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodIssuer'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'disabled' => 'bool', + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'disabled' => null, + 'id' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'disabled' => false, + 'id' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'disabled' => 'disabled', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'disabled' => 'setDisabled', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'disabled' => 'getDisabled', + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('disabled', $data ?? [], false); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 disabled + * + * @return bool|null + */ + public function getDisabled() + { + return $this->container['disabled']; + } + + /** + * Sets disabled + * + * @param bool|null $disabled A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. + * + * @return self + */ + public function setDisabled($disabled) + { + if (is_null($disabled)) { + throw new \InvalidArgumentException('non-nullable disabled cannot be null'); + } + $this->container['disabled'] = $disabled; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of this issuer, to submit in requests to /payments. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name A localized name of the issuer. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentMethodsRequest.php b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php new file mode 100644 index 000000000..85015d93a --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentMethodsRequest.php @@ -0,0 +1,799 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentMethodsRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentMethodsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'allowed_payment_methods' => 'string[]', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'blocked_payment_methods' => 'string[]', + 'channel' => 'string', + 'country_code' => 'string', + 'merchant_account' => 'string', + 'order' => '\Adyen\Model\Checkout\CheckoutOrder', + 'shopper_locale' => 'string', + 'shopper_reference' => 'string', + 'split_card_funding_sources' => 'bool', + 'store' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'allowed_payment_methods' => null, + 'amount' => null, + 'blocked_payment_methods' => null, + 'channel' => null, + 'country_code' => null, + 'merchant_account' => null, + 'order' => null, + 'shopper_locale' => null, + 'shopper_reference' => null, + 'split_card_funding_sources' => null, + 'store' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'allowed_payment_methods' => false, + 'amount' => false, + 'blocked_payment_methods' => false, + 'channel' => false, + 'country_code' => false, + 'merchant_account' => false, + 'order' => false, + 'shopper_locale' => false, + 'shopper_reference' => false, + 'split_card_funding_sources' => false, + 'store' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'allowed_payment_methods' => 'allowedPaymentMethods', + 'amount' => 'amount', + 'blocked_payment_methods' => 'blockedPaymentMethods', + 'channel' => 'channel', + 'country_code' => 'countryCode', + 'merchant_account' => 'merchantAccount', + 'order' => 'order', + 'shopper_locale' => 'shopperLocale', + 'shopper_reference' => 'shopperReference', + 'split_card_funding_sources' => 'splitCardFundingSources', + 'store' => 'store' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'allowed_payment_methods' => 'setAllowedPaymentMethods', + 'amount' => 'setAmount', + 'blocked_payment_methods' => 'setBlockedPaymentMethods', + 'channel' => 'setChannel', + 'country_code' => 'setCountryCode', + 'merchant_account' => 'setMerchantAccount', + 'order' => 'setOrder', + 'shopper_locale' => 'setShopperLocale', + 'shopper_reference' => 'setShopperReference', + 'split_card_funding_sources' => 'setSplitCardFundingSources', + 'store' => 'setStore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'allowed_payment_methods' => 'getAllowedPaymentMethods', + 'amount' => 'getAmount', + 'blocked_payment_methods' => 'getBlockedPaymentMethods', + 'channel' => 'getChannel', + 'country_code' => 'getCountryCode', + 'merchant_account' => 'getMerchantAccount', + 'order' => 'getOrder', + 'shopper_locale' => 'getShopperLocale', + 'shopper_reference' => 'getShopperReference', + 'split_card_funding_sources' => 'getSplitCardFundingSources', + 'store' => 'getStore' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHANNEL_I_OS = 'iOS'; + public const CHANNEL_ANDROID = 'Android'; + public const CHANNEL_WEB = 'Web'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChannelAllowableValues() + { + return [ + self::CHANNEL_I_OS, + self::CHANNEL_ANDROID, + self::CHANNEL_WEB, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('allowed_payment_methods', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('blocked_payment_methods', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('split_card_funding_sources', $data ?? [], false); + $this->setIfExists('store', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChannelAllowableValues(); + if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets allowed_payment_methods + * + * @return string[]|null + */ + public function getAllowedPaymentMethods() + { + return $this->container['allowed_payment_methods']; + } + + /** + * Sets allowed_payment_methods + * + * @param string[]|null $allowed_payment_methods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setAllowedPaymentMethods($allowed_payment_methods) + { + if (is_null($allowed_payment_methods)) { + throw new \InvalidArgumentException('non-nullable allowed_payment_methods cannot be null'); + } + $this->container['allowed_payment_methods'] = $allowed_payment_methods; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets blocked_payment_methods + * + * @return string[]|null + */ + public function getBlockedPaymentMethods() + { + return $this->container['blocked_payment_methods']; + } + + /** + * Sets blocked_payment_methods + * + * @param string[]|null $blocked_payment_methods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setBlockedPaymentMethods($blocked_payment_methods) + { + if (is_null($blocked_payment_methods)) { + throw new \InvalidArgumentException('non-nullable blocked_payment_methods cannot be null'); + } + $this->container['blocked_payment_methods'] = $blocked_payment_methods; + + return $this; + } + + /** + * Gets channel + * + * @return string|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string|null $channel The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $allowedValues = $this->getChannelAllowableValues(); + if (!in_array($channel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper's country code. + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets order + * + * @return \Adyen\Model\Checkout\CheckoutOrder|null + */ + public function getOrder() + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param \Adyen\Model\Checkout\CheckoutOrder|null $order order + * + * @return self + */ + public function setOrder($order) + { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets split_card_funding_sources + * + * @return bool|null + */ + public function getSplitCardFundingSources() + { + return $this->container['split_card_funding_sources']; + } + + /** + * Sets split_card_funding_sources + * + * @param bool|null $split_card_funding_sources Boolean value indicating whether the card payment method should be split into separate debit and credit options. + * + * @return self + */ + public function setSplitCardFundingSources($split_card_funding_sources) + { + if (is_null($split_card_funding_sources)) { + throw new \InvalidArgumentException('non-nullable split_card_funding_sources cannot be null'); + } + $this->container['split_card_funding_sources'] = $split_card_funding_sources; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentMethodsResponse.php b/src/Adyen/Model/Checkout/PaymentMethodsResponse.php new file mode 100644 index 000000000..b0027adb7 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentMethodsResponse.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentMethodsResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentMethodsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_methods' => '\Adyen\Model\Checkout\PaymentMethod[]', + 'stored_payment_methods' => '\Adyen\Model\Checkout\StoredPaymentMethod[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_methods' => null, + 'stored_payment_methods' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_methods' => false, + 'stored_payment_methods' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_methods' => 'paymentMethods', + 'stored_payment_methods' => 'storedPaymentMethods' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_methods' => 'setPaymentMethods', + 'stored_payment_methods' => 'setStoredPaymentMethods' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_methods' => 'getPaymentMethods', + 'stored_payment_methods' => 'getStoredPaymentMethods' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_methods', $data ?? [], null); + $this->setIfExists('stored_payment_methods', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_methods + * + * @return \Adyen\Model\Checkout\PaymentMethod[]|null + */ + public function getPaymentMethods() + { + return $this->container['payment_methods']; + } + + /** + * Sets payment_methods + * + * @param \Adyen\Model\Checkout\PaymentMethod[]|null $payment_methods Detailed list of payment methods required to generate payment forms. + * + * @return self + */ + public function setPaymentMethods($payment_methods) + { + if (is_null($payment_methods)) { + throw new \InvalidArgumentException('non-nullable payment_methods cannot be null'); + } + $this->container['payment_methods'] = $payment_methods; + + return $this; + } + + /** + * Gets stored_payment_methods + * + * @return \Adyen\Model\Checkout\StoredPaymentMethod[]|null + */ + public function getStoredPaymentMethods() + { + return $this->container['stored_payment_methods']; + } + + /** + * Sets stored_payment_methods + * + * @param \Adyen\Model\Checkout\StoredPaymentMethod[]|null $stored_payment_methods List of all stored payment methods. + * + * @return self + */ + public function setStoredPaymentMethods($stored_payment_methods) + { + if (is_null($stored_payment_methods)) { + throw new \InvalidArgumentException('non-nullable stored_payment_methods cannot be null'); + } + $this->container['stored_payment_methods'] = $stored_payment_methods; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentRefundResource.php b/src/Adyen/Model/Checkout/PaymentRefundResource.php new file mode 100644 index 000000000..9d507513a --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentRefundResource.php @@ -0,0 +1,744 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentRefundResource Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentRefundResource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentRefundResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Checkout\Amount', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'merchant_account' => 'string', + 'merchant_refund_reason' => 'string', + 'payment_psp_reference' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'line_items' => null, + 'merchant_account' => null, + 'merchant_refund_reason' => null, + 'payment_psp_reference' => null, + 'psp_reference' => null, + 'reference' => null, + 'splits' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'line_items' => false, + 'merchant_account' => false, + 'merchant_refund_reason' => false, + 'payment_psp_reference' => false, + 'psp_reference' => false, + 'reference' => false, + 'splits' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'line_items' => 'lineItems', + 'merchant_account' => 'merchantAccount', + 'merchant_refund_reason' => 'merchantRefundReason', + 'payment_psp_reference' => 'paymentPspReference', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'splits' => 'splits', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'line_items' => 'setLineItems', + 'merchant_account' => 'setMerchantAccount', + 'merchant_refund_reason' => 'setMerchantRefundReason', + 'payment_psp_reference' => 'setPaymentPspReference', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'line_items' => 'getLineItems', + 'merchant_account' => 'getMerchantAccount', + 'merchant_refund_reason' => 'getMerchantRefundReason', + 'payment_psp_reference' => 'getPaymentPspReference', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const MERCHANT_REFUND_REASON_FRAUD = 'FRAUD'; + public const MERCHANT_REFUND_REASON_CUSTOMER_REQUEST = 'CUSTOMER REQUEST'; + public const MERCHANT_REFUND_REASON__RETURN = 'RETURN'; + public const MERCHANT_REFUND_REASON_DUPLICATE = 'DUPLICATE'; + public const MERCHANT_REFUND_REASON_OTHER = 'OTHER'; + public const STATUS_RECEIVED = 'received'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMerchantRefundReasonAllowableValues() + { + return [ + self::MERCHANT_REFUND_REASON_FRAUD, + self::MERCHANT_REFUND_REASON_CUSTOMER_REQUEST, + self::MERCHANT_REFUND_REASON__RETURN, + self::MERCHANT_REFUND_REASON_DUPLICATE, + self::MERCHANT_REFUND_REASON_OTHER, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_refund_reason', $data ?? [], null); + $this->setIfExists('payment_psp_reference', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getMerchantRefundReasonAllowableValues(); + if (!is_null($this->container['merchant_refund_reason']) && !in_array($this->container['merchant_refund_reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'merchant_refund_reason', must be one of '%s'", + $this->container['merchant_refund_reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['payment_psp_reference'] === null) { + $invalidProperties[] = "'payment_psp_reference' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_refund_reason + * + * @return string|null + */ + public function getMerchantRefundReason() + { + return $this->container['merchant_refund_reason']; + } + + /** + * Sets merchant_refund_reason + * + * @param string|null $merchant_refund_reason Your reason for the refund request. + * + * @return self + */ + public function setMerchantRefundReason($merchant_refund_reason) + { + if (is_null($merchant_refund_reason)) { + throw new \InvalidArgumentException('non-nullable merchant_refund_reason cannot be null'); + } + $allowedValues = $this->getMerchantRefundReasonAllowableValues(); + if (!in_array($merchant_refund_reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'merchant_refund_reason', must be one of '%s'", + $merchant_refund_reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['merchant_refund_reason'] = $merchant_refund_reason; + + return $this; + } + + /** + * Gets payment_psp_reference + * + * @return string + */ + public function getPaymentPspReference() + { + return $this->container['payment_psp_reference']; + } + + /** + * Sets payment_psp_reference + * + * @param string $payment_psp_reference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. + * + * @return self + */ + public function setPaymentPspReference($payment_psp_reference) + { + if (is_null($payment_psp_reference)) { + throw new \InvalidArgumentException('non-nullable payment_psp_reference cannot be null'); + } + $this->container['payment_psp_reference'] = $payment_psp_reference; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference Adyen's 16-character reference associated with the refund request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the refund request. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of your request. This will always have the value **received**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentRequest.php b/src/Adyen/Model/Checkout/PaymentRequest.php new file mode 100644 index 000000000..200f26963 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentRequest.php @@ -0,0 +1,2683 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Checkout\AccountInfo', + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'application_info' => '\Adyen\Model\Checkout\ApplicationInfo', + 'authentication_data' => '\Adyen\Model\Checkout\AuthenticationData', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'browser_info' => '\Adyen\Model\Checkout\BrowserInfo', + 'capture_delay_hours' => 'int', + 'channel' => 'string', + 'checkout_attempt_id' => 'string', + 'company' => '\Adyen\Model\Checkout\Company', + 'conversion_id' => 'string', + 'country_code' => 'string', + 'date_of_birth' => '\DateTime', + 'dcc_quote' => '\Adyen\Model\Checkout\ForexQuote', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'delivery_date' => '\DateTime', + 'device_fingerprint' => 'string', + 'enable_one_click' => 'bool', + 'enable_pay_out' => 'bool', + 'enable_recurring' => 'bool', + 'entity_type' => 'string', + 'fraud_offset' => 'int', + 'industry_usage' => 'string', + 'installments' => '\Adyen\Model\Checkout\Installments', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'localized_shopper_statement' => 'array', + 'mandate' => '\Adyen\Model\Checkout\Mandate', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'merchant_risk_indicator' => '\Adyen\Model\Checkout\MerchantRiskIndicator', + 'metadata' => 'array', + 'mpi_data' => '\Adyen\Model\Checkout\ThreeDSecureData', + 'order' => '\Adyen\Model\Checkout\CheckoutOrder', + 'order_reference' => 'string', + 'origin' => 'string', + 'payment_method' => '\Adyen\Model\Checkout\CheckoutPaymentMethod', + 'platform_chargeback_logic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', + 'recurring_expiry' => 'string', + 'recurring_frequency' => 'string', + 'recurring_processing_model' => 'string', + 'redirect_from_issuer_method' => 'string', + 'redirect_to_issuer_method' => 'string', + 'reference' => 'string', + 'return_url' => 'string', + 'risk_data' => '\Adyen\Model\Checkout\RiskData', + 'session_validity' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'store' => 'string', + 'store_payment_method' => 'bool', + 'telephone_number' => 'string', + 'three_ds2_request_data' => '\Adyen\Model\Checkout\ThreeDS2RequestData', + 'three_ds_authentication_only' => 'bool', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_data' => null, + 'amount' => null, + 'application_info' => null, + 'authentication_data' => null, + 'billing_address' => null, + 'browser_info' => null, + 'capture_delay_hours' => 'int32', + 'channel' => null, + 'checkout_attempt_id' => null, + 'company' => null, + 'conversion_id' => null, + 'country_code' => null, + 'date_of_birth' => 'date', + 'dcc_quote' => null, + 'delivery_address' => null, + 'delivery_date' => 'date-time', + 'device_fingerprint' => null, + 'enable_one_click' => null, + 'enable_pay_out' => null, + 'enable_recurring' => null, + 'entity_type' => null, + 'fraud_offset' => 'int32', + 'industry_usage' => null, + 'installments' => null, + 'line_items' => null, + 'localized_shopper_statement' => null, + 'mandate' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'merchant_risk_indicator' => null, + 'metadata' => null, + 'mpi_data' => null, + 'order' => null, + 'order_reference' => null, + 'origin' => null, + 'payment_method' => null, + 'platform_chargeback_logic' => null, + 'recurring_expiry' => null, + 'recurring_frequency' => null, + 'recurring_processing_model' => null, + 'redirect_from_issuer_method' => null, + 'redirect_to_issuer_method' => null, + 'reference' => null, + 'return_url' => null, + 'risk_data' => null, + 'session_validity' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'splits' => null, + 'store' => null, + 'store_payment_method' => null, + 'telephone_number' => null, + 'three_ds2_request_data' => null, + 'three_ds_authentication_only' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_data' => false, + 'amount' => false, + 'application_info' => false, + 'authentication_data' => false, + 'billing_address' => false, + 'browser_info' => false, + 'capture_delay_hours' => true, + 'channel' => false, + 'checkout_attempt_id' => false, + 'company' => false, + 'conversion_id' => false, + 'country_code' => false, + 'date_of_birth' => false, + 'dcc_quote' => false, + 'delivery_address' => false, + 'delivery_date' => false, + 'device_fingerprint' => false, + 'enable_one_click' => false, + 'enable_pay_out' => false, + 'enable_recurring' => false, + 'entity_type' => false, + 'fraud_offset' => true, + 'industry_usage' => false, + 'installments' => false, + 'line_items' => false, + 'localized_shopper_statement' => false, + 'mandate' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'merchant_risk_indicator' => false, + 'metadata' => false, + 'mpi_data' => false, + 'order' => false, + 'order_reference' => false, + 'origin' => false, + 'payment_method' => false, + 'platform_chargeback_logic' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'recurring_processing_model' => false, + 'redirect_from_issuer_method' => false, + 'redirect_to_issuer_method' => false, + 'reference' => false, + 'return_url' => false, + 'risk_data' => false, + 'session_validity' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'splits' => false, + 'store' => false, + 'store_payment_method' => false, + 'telephone_number' => false, + 'three_ds2_request_data' => false, + 'three_ds_authentication_only' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'authentication_data' => 'authenticationData', + 'billing_address' => 'billingAddress', + 'browser_info' => 'browserInfo', + 'capture_delay_hours' => 'captureDelayHours', + 'channel' => 'channel', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'company' => 'company', + 'conversion_id' => 'conversionId', + 'country_code' => 'countryCode', + 'date_of_birth' => 'dateOfBirth', + 'dcc_quote' => 'dccQuote', + 'delivery_address' => 'deliveryAddress', + 'delivery_date' => 'deliveryDate', + 'device_fingerprint' => 'deviceFingerprint', + 'enable_one_click' => 'enableOneClick', + 'enable_pay_out' => 'enablePayOut', + 'enable_recurring' => 'enableRecurring', + 'entity_type' => 'entityType', + 'fraud_offset' => 'fraudOffset', + 'industry_usage' => 'industryUsage', + 'installments' => 'installments', + 'line_items' => 'lineItems', + 'localized_shopper_statement' => 'localizedShopperStatement', + 'mandate' => 'mandate', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'merchant_risk_indicator' => 'merchantRiskIndicator', + 'metadata' => 'metadata', + 'mpi_data' => 'mpiData', + 'order' => 'order', + 'order_reference' => 'orderReference', + 'origin' => 'origin', + 'payment_method' => 'paymentMethod', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'recurring_processing_model' => 'recurringProcessingModel', + 'redirect_from_issuer_method' => 'redirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'redirectToIssuerMethod', + 'reference' => 'reference', + 'return_url' => 'returnUrl', + 'risk_data' => 'riskData', + 'session_validity' => 'sessionValidity', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'splits' => 'splits', + 'store' => 'store', + 'store_payment_method' => 'storePaymentMethod', + 'telephone_number' => 'telephoneNumber', + 'three_ds2_request_data' => 'threeDS2RequestData', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'authentication_data' => 'setAuthenticationData', + 'billing_address' => 'setBillingAddress', + 'browser_info' => 'setBrowserInfo', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'channel' => 'setChannel', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'company' => 'setCompany', + 'conversion_id' => 'setConversionId', + 'country_code' => 'setCountryCode', + 'date_of_birth' => 'setDateOfBirth', + 'dcc_quote' => 'setDccQuote', + 'delivery_address' => 'setDeliveryAddress', + 'delivery_date' => 'setDeliveryDate', + 'device_fingerprint' => 'setDeviceFingerprint', + 'enable_one_click' => 'setEnableOneClick', + 'enable_pay_out' => 'setEnablePayOut', + 'enable_recurring' => 'setEnableRecurring', + 'entity_type' => 'setEntityType', + 'fraud_offset' => 'setFraudOffset', + 'industry_usage' => 'setIndustryUsage', + 'installments' => 'setInstallments', + 'line_items' => 'setLineItems', + 'localized_shopper_statement' => 'setLocalizedShopperStatement', + 'mandate' => 'setMandate', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'merchant_risk_indicator' => 'setMerchantRiskIndicator', + 'metadata' => 'setMetadata', + 'mpi_data' => 'setMpiData', + 'order' => 'setOrder', + 'order_reference' => 'setOrderReference', + 'origin' => 'setOrigin', + 'payment_method' => 'setPaymentMethod', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'redirect_from_issuer_method' => 'setRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'setRedirectToIssuerMethod', + 'reference' => 'setReference', + 'return_url' => 'setReturnUrl', + 'risk_data' => 'setRiskData', + 'session_validity' => 'setSessionValidity', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'store_payment_method' => 'setStorePaymentMethod', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds2_request_data' => 'setThreeDs2RequestData', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'authentication_data' => 'getAuthenticationData', + 'billing_address' => 'getBillingAddress', + 'browser_info' => 'getBrowserInfo', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'channel' => 'getChannel', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'company' => 'getCompany', + 'conversion_id' => 'getConversionId', + 'country_code' => 'getCountryCode', + 'date_of_birth' => 'getDateOfBirth', + 'dcc_quote' => 'getDccQuote', + 'delivery_address' => 'getDeliveryAddress', + 'delivery_date' => 'getDeliveryDate', + 'device_fingerprint' => 'getDeviceFingerprint', + 'enable_one_click' => 'getEnableOneClick', + 'enable_pay_out' => 'getEnablePayOut', + 'enable_recurring' => 'getEnableRecurring', + 'entity_type' => 'getEntityType', + 'fraud_offset' => 'getFraudOffset', + 'industry_usage' => 'getIndustryUsage', + 'installments' => 'getInstallments', + 'line_items' => 'getLineItems', + 'localized_shopper_statement' => 'getLocalizedShopperStatement', + 'mandate' => 'getMandate', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'merchant_risk_indicator' => 'getMerchantRiskIndicator', + 'metadata' => 'getMetadata', + 'mpi_data' => 'getMpiData', + 'order' => 'getOrder', + 'order_reference' => 'getOrderReference', + 'origin' => 'getOrigin', + 'payment_method' => 'getPaymentMethod', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'redirect_from_issuer_method' => 'getRedirectFromIssuerMethod', + 'redirect_to_issuer_method' => 'getRedirectToIssuerMethod', + 'reference' => 'getReference', + 'return_url' => 'getReturnUrl', + 'risk_data' => 'getRiskData', + 'session_validity' => 'getSessionValidity', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'store_payment_method' => 'getStorePaymentMethod', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds2_request_data' => 'getThreeDs2RequestData', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHANNEL_I_OS = 'iOS'; + public const CHANNEL_ANDROID = 'Android'; + public const CHANNEL_WEB = 'Web'; + public const ENTITY_TYPE_NATURAL_PERSON = 'NaturalPerson'; + public const ENTITY_TYPE_COMPANY_NAME = 'CompanyName'; + public const INDUSTRY_USAGE_DELAYED_CHARGE = 'delayedCharge'; + public const INDUSTRY_USAGE_INSTALLMENT = 'installment'; + public const INDUSTRY_USAGE_NO_SHOW = 'noShow'; + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChannelAllowableValues() + { + return [ + self::CHANNEL_I_OS, + self::CHANNEL_ANDROID, + self::CHANNEL_WEB, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEntityTypeAllowableValues() + { + return [ + self::ENTITY_TYPE_NATURAL_PERSON, + self::ENTITY_TYPE_COMPANY_NAME, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIndustryUsageAllowableValues() + { + return [ + self::INDUSTRY_USAGE_DELAYED_CHARGE, + self::INDUSTRY_USAGE_INSTALLMENT, + self::INDUSTRY_USAGE_NO_SHOW, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('authentication_data', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('browser_info', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('conversion_id', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('dcc_quote', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('delivery_date', $data ?? [], null); + $this->setIfExists('device_fingerprint', $data ?? [], null); + $this->setIfExists('enable_one_click', $data ?? [], null); + $this->setIfExists('enable_pay_out', $data ?? [], null); + $this->setIfExists('enable_recurring', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('industry_usage', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('localized_shopper_statement', $data ?? [], null); + $this->setIfExists('mandate', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('merchant_risk_indicator', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('order_reference', $data ?? [], null); + $this->setIfExists('origin', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('redirect_from_issuer_method', $data ?? [], null); + $this->setIfExists('redirect_to_issuer_method', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('risk_data', $data ?? [], null); + $this->setIfExists('session_validity', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_payment_method', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds2_request_data', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getChannelAllowableValues(); + if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!is_null($this->container['entity_type']) && !in_array($this->container['entity_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'entity_type', must be one of '%s'", + $this->container['entity_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!is_null($this->container['industry_usage']) && !in_array($this->container['industry_usage'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'industry_usage', must be one of '%s'", + $this->container['industry_usage'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['return_url'] === null) { + $invalidProperties[] = "'return_url' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + 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 account_info + * + * @return \Adyen\Model\Checkout\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Checkout\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets authentication_data + * + * @return \Adyen\Model\Checkout\AuthenticationData|null + */ + public function getAuthenticationData() + { + return $this->container['authentication_data']; + } + + /** + * Sets authentication_data + * + * @param \Adyen\Model\Checkout\AuthenticationData|null $authentication_data authentication_data + * + * @return self + */ + public function setAuthenticationData($authentication_data) + { + if (is_null($authentication_data)) { + throw new \InvalidArgumentException('non-nullable authentication_data cannot be null'); + } + $this->container['authentication_data'] = $authentication_data; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets browser_info + * + * @return \Adyen\Model\Checkout\BrowserInfo|null + */ + public function getBrowserInfo() + { + return $this->container['browser_info']; + } + + /** + * Sets browser_info + * + * @param \Adyen\Model\Checkout\BrowserInfo|null $browser_info browser_info + * + * @return self + */ + public function setBrowserInfo($browser_info) + { + if (is_null($browser_info)) { + throw new \InvalidArgumentException('non-nullable browser_info cannot be null'); + } + $this->container['browser_info'] = $browser_info; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets channel + * + * @return string|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string|null $channel The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $allowedValues = $this->getChannelAllowableValues(); + if (!in_array($channel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets company + * + * @return \Adyen\Model\Checkout\Company|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param \Adyen\Model\Checkout\Company|null $company company + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets conversion_id + * + * @return string|null + */ + public function getConversionId() + { + return $this->container['conversion_id']; + } + + /** + * Sets conversion_id + * + * @param string|null $conversion_id Conversion ID that corresponds to the Id generated for tracking user payment journey. + * + * @return self + */ + public function setConversionId($conversion_id) + { + if (is_null($conversion_id)) { + throw new \InvalidArgumentException('non-nullable conversion_id cannot be null'); + } + $this->container['conversion_id'] = $conversion_id; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets dcc_quote + * + * @return \Adyen\Model\Checkout\ForexQuote|null + */ + public function getDccQuote() + { + return $this->container['dcc_quote']; + } + + /** + * Sets dcc_quote + * + * @param \Adyen\Model\Checkout\ForexQuote|null $dcc_quote dcc_quote + * + * @return self + */ + public function setDccQuote($dcc_quote) + { + if (is_null($dcc_quote)) { + throw new \InvalidArgumentException('non-nullable dcc_quote cannot be null'); + } + $this->container['dcc_quote'] = $dcc_quote; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets delivery_date + * + * @return \DateTime|null + */ + public function getDeliveryDate() + { + return $this->container['delivery_date']; + } + + /** + * Sets delivery_date + * + * @param \DateTime|null $delivery_date The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliveryDate($delivery_date) + { + if (is_null($delivery_date)) { + throw new \InvalidArgumentException('non-nullable delivery_date cannot be null'); + } + $this->container['delivery_date'] = $delivery_date; + + return $this; + } + + /** + * Gets device_fingerprint + * + * @return string|null + */ + public function getDeviceFingerprint() + { + return $this->container['device_fingerprint']; + } + + /** + * Sets device_fingerprint + * + * @param string|null $device_fingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + * + * @return self + */ + public function setDeviceFingerprint($device_fingerprint) + { + if (is_null($device_fingerprint)) { + throw new \InvalidArgumentException('non-nullable device_fingerprint cannot be null'); + } + $this->container['device_fingerprint'] = $device_fingerprint; + + return $this; + } + + /** + * Gets enable_one_click + * + * @return bool|null + */ + public function getEnableOneClick() + { + return $this->container['enable_one_click']; + } + + /** + * Sets enable_one_click + * + * @param bool|null $enable_one_click When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * + * @return self + */ + public function setEnableOneClick($enable_one_click) + { + if (is_null($enable_one_click)) { + throw new \InvalidArgumentException('non-nullable enable_one_click cannot be null'); + } + $this->container['enable_one_click'] = $enable_one_click; + + return $this; + } + + /** + * Gets enable_pay_out + * + * @return bool|null + */ + public function getEnablePayOut() + { + return $this->container['enable_pay_out']; + } + + /** + * Sets enable_pay_out + * + * @param bool|null $enable_pay_out When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + * + * @return self + */ + public function setEnablePayOut($enable_pay_out) + { + if (is_null($enable_pay_out)) { + throw new \InvalidArgumentException('non-nullable enable_pay_out cannot be null'); + } + $this->container['enable_pay_out'] = $enable_pay_out; + + return $this; + } + + /** + * Gets enable_recurring + * + * @return bool|null + */ + public function getEnableRecurring() + { + return $this->container['enable_recurring']; + } + + /** + * Sets enable_recurring + * + * @param bool|null $enable_recurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * + * @return self + */ + public function setEnableRecurring($enable_recurring) + { + if (is_null($enable_recurring)) { + throw new \InvalidArgumentException('non-nullable enable_recurring cannot be null'); + } + $this->container['enable_recurring'] = $enable_recurring; + + return $this; + } + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type The type of the entity the payment is processed for. + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + throw new \InvalidArgumentException('non-nullable entity_type cannot be null'); + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!in_array($entity_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'entity_type', must be one of '%s'", + $entity_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets industry_usage + * + * @return string|null + */ + public function getIndustryUsage() + { + return $this->container['industry_usage']; + } + + /** + * Sets industry_usage + * + * @param string|null $industry_usage The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + * + * @return self + */ + public function setIndustryUsage($industry_usage) + { + if (is_null($industry_usage)) { + throw new \InvalidArgumentException('non-nullable industry_usage cannot be null'); + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!in_array($industry_usage, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'industry_usage', must be one of '%s'", + $industry_usage, + implode("', '", $allowedValues) + ) + ); + } + $this->container['industry_usage'] = $industry_usage; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Checkout\Installments|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Checkout\Installments|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets localized_shopper_statement + * + * @return array|null + */ + public function getLocalizedShopperStatement() + { + return $this->container['localized_shopper_statement']; + } + + /** + * Sets localized_shopper_statement + * + * @param array|null $localized_shopper_statement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * + * @return self + */ + public function setLocalizedShopperStatement($localized_shopper_statement) + { + if (is_null($localized_shopper_statement)) { + throw new \InvalidArgumentException('non-nullable localized_shopper_statement cannot be null'); + } + $this->container['localized_shopper_statement'] = $localized_shopper_statement; + + return $this; + } + + /** + * Gets mandate + * + * @return \Adyen\Model\Checkout\Mandate|null + */ + public function getMandate() + { + return $this->container['mandate']; + } + + /** + * Sets mandate + * + * @param \Adyen\Model\Checkout\Mandate|null $mandate mandate + * + * @return self + */ + public function setMandate($mandate) + { + if (is_null($mandate)) { + throw new \InvalidArgumentException('non-nullable mandate cannot be null'); + } + $this->container['mandate'] = $mandate; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets merchant_risk_indicator + * + * @return \Adyen\Model\Checkout\MerchantRiskIndicator|null + */ + public function getMerchantRiskIndicator() + { + return $this->container['merchant_risk_indicator']; + } + + /** + * Sets merchant_risk_indicator + * + * @param \Adyen\Model\Checkout\MerchantRiskIndicator|null $merchant_risk_indicator merchant_risk_indicator + * + * @return self + */ + public function setMerchantRiskIndicator($merchant_risk_indicator) + { + if (is_null($merchant_risk_indicator)) { + throw new \InvalidArgumentException('non-nullable merchant_risk_indicator cannot be null'); + } + $this->container['merchant_risk_indicator'] = $merchant_risk_indicator; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Checkout\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Checkout\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets order + * + * @return \Adyen\Model\Checkout\CheckoutOrder|null + */ + public function getOrder() + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param \Adyen\Model\Checkout\CheckoutOrder|null $order order + * + * @return self + */ + public function setOrder($order) + { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets order_reference + * + * @return string|null + */ + public function getOrderReference() + { + return $this->container['order_reference']; + } + + /** + * Sets order_reference + * + * @param string|null $order_reference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + * + * @return self + */ + public function setOrderReference($order_reference) + { + if (is_null($order_reference)) { + throw new \InvalidArgumentException('non-nullable order_reference cannot be null'); + } + $this->container['order_reference'] = $order_reference; + + return $this; + } + + /** + * Gets origin + * + * @return string|null + */ + public function getOrigin() + { + return $this->container['origin']; + } + + /** + * Sets origin + * + * @param string|null $origin Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + * + * @return self + */ + public function setOrigin($origin) + { + if (is_null($origin)) { + throw new \InvalidArgumentException('non-nullable origin cannot be null'); + } + $this->container['origin'] = $origin; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Adyen\Model\Checkout\CheckoutPaymentMethod + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Adyen\Model\Checkout\CheckoutPaymentMethod $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param string|null $recurring_expiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Minimum number of days between authorisations. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets redirect_from_issuer_method + * + * @return string|null + */ + public function getRedirectFromIssuerMethod() + { + return $this->container['redirect_from_issuer_method']; + } + + /** + * Sets redirect_from_issuer_method + * + * @param string|null $redirect_from_issuer_method Specifies the redirect method (GET or POST) when redirecting back from the issuer. + * + * @return self + */ + public function setRedirectFromIssuerMethod($redirect_from_issuer_method) + { + if (is_null($redirect_from_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_from_issuer_method cannot be null'); + } + $this->container['redirect_from_issuer_method'] = $redirect_from_issuer_method; + + return $this; + } + + /** + * Gets redirect_to_issuer_method + * + * @return string|null + */ + public function getRedirectToIssuerMethod() + { + return $this->container['redirect_to_issuer_method']; + } + + /** + * Sets redirect_to_issuer_method + * + * @param string|null $redirect_to_issuer_method Specifies the redirect method (GET or POST) when redirecting to the issuer. + * + * @return self + */ + public function setRedirectToIssuerMethod($redirect_to_issuer_method) + { + if (is_null($redirect_to_issuer_method)) { + throw new \InvalidArgumentException('non-nullable redirect_to_issuer_method cannot be null'); + } + $this->container['redirect_to_issuer_method'] = $redirect_to_issuer_method; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets return_url + * + * @return string + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string $return_url The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets risk_data + * + * @return \Adyen\Model\Checkout\RiskData|null + */ + public function getRiskData() + { + return $this->container['risk_data']; + } + + /** + * Sets risk_data + * + * @param \Adyen\Model\Checkout\RiskData|null $risk_data risk_data + * + * @return self + */ + public function setRiskData($risk_data) + { + if (is_null($risk_data)) { + throw new \InvalidArgumentException('non-nullable risk_data cannot be null'); + } + $this->container['risk_data'] = $risk_data; + + return $this; + } + + /** + * Gets session_validity + * + * @return string|null + */ + public function getSessionValidity() + { + return $this->container['session_validity']; + } + + /** + * Sets session_validity + * + * @param string|null $session_validity The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + * + * @return self + */ + public function setSessionValidity($session_validity) + { + if (is_null($session_validity)) { + throw new \InvalidArgumentException('non-nullable session_validity cannot be null'); + } + $this->container['session_validity'] = $session_validity; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_payment_method + * + * @return bool|null + */ + public function getStorePaymentMethod() + { + return $this->container['store_payment_method']; + } + + /** + * Sets store_payment_method + * + * @param bool|null $store_payment_method When true and `shopperReference` is provided, the payment details will be stored. + * + * @return self + */ + public function setStorePaymentMethod($store_payment_method) + { + if (is_null($store_payment_method)) { + throw new \InvalidArgumentException('non-nullable store_payment_method cannot be null'); + } + $this->container['store_payment_method'] = $store_payment_method; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds2_request_data + * + * @return \Adyen\Model\Checkout\ThreeDS2RequestData|null + */ + public function getThreeDs2RequestData() + { + return $this->container['three_ds2_request_data']; + } + + /** + * Sets three_ds2_request_data + * + * @param \Adyen\Model\Checkout\ThreeDS2RequestData|null $three_ds2_request_data three_ds2_request_data + * + * @return self + */ + public function setThreeDs2RequestData($three_ds2_request_data) + { + if (is_null($three_ds2_request_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_request_data cannot be null'); + } + $this->container['three_ds2_request_data'] = $three_ds2_request_data; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + * @deprecated + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + * @deprecated + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentResponse.php b/src/Adyen/Model/Checkout/PaymentResponse.php new file mode 100644 index 000000000..e102a5fd7 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentResponse.php @@ -0,0 +1,918 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action' => '\Adyen\Model\Checkout\PaymentResponseAction', + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'donation_token' => 'string', + 'fraud_result' => '\Adyen\Model\Checkout\FraudResult', + 'merchant_reference' => 'string', + 'order' => '\Adyen\Model\Checkout\CheckoutOrderResponse', + 'payment_method' => '\Adyen\Model\Checkout\ResponsePaymentMethod', + 'psp_reference' => 'string', + 'refusal_reason' => 'string', + 'refusal_reason_code' => 'string', + 'result_code' => 'string', + 'three_ds2_response_data' => '\Adyen\Model\Checkout\ThreeDS2ResponseData', + 'three_ds2_result' => '\Adyen\Model\Checkout\ThreeDS2Result', + 'three_ds_payment_data' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action' => null, + 'additional_data' => null, + 'amount' => null, + 'donation_token' => null, + 'fraud_result' => null, + 'merchant_reference' => null, + 'order' => null, + 'payment_method' => null, + 'psp_reference' => null, + 'refusal_reason' => null, + 'refusal_reason_code' => null, + 'result_code' => null, + 'three_ds2_response_data' => null, + 'three_ds2_result' => null, + 'three_ds_payment_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'action' => false, + 'additional_data' => false, + 'amount' => false, + 'donation_token' => false, + 'fraud_result' => false, + 'merchant_reference' => false, + 'order' => false, + 'payment_method' => false, + 'psp_reference' => false, + 'refusal_reason' => false, + 'refusal_reason_code' => false, + 'result_code' => false, + 'three_ds2_response_data' => false, + 'three_ds2_result' => false, + 'three_ds_payment_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'donation_token' => 'donationToken', + 'fraud_result' => 'fraudResult', + 'merchant_reference' => 'merchantReference', + 'order' => 'order', + 'payment_method' => 'paymentMethod', + 'psp_reference' => 'pspReference', + 'refusal_reason' => 'refusalReason', + 'refusal_reason_code' => 'refusalReasonCode', + 'result_code' => 'resultCode', + 'three_ds2_response_data' => 'threeDS2ResponseData', + 'three_ds2_result' => 'threeDS2Result', + 'three_ds_payment_data' => 'threeDSPaymentData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'donation_token' => 'setDonationToken', + 'fraud_result' => 'setFraudResult', + 'merchant_reference' => 'setMerchantReference', + 'order' => 'setOrder', + 'payment_method' => 'setPaymentMethod', + 'psp_reference' => 'setPspReference', + 'refusal_reason' => 'setRefusalReason', + 'refusal_reason_code' => 'setRefusalReasonCode', + 'result_code' => 'setResultCode', + 'three_ds2_response_data' => 'setThreeDs2ResponseData', + 'three_ds2_result' => 'setThreeDs2Result', + 'three_ds_payment_data' => 'setThreeDsPaymentData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'donation_token' => 'getDonationToken', + 'fraud_result' => 'getFraudResult', + 'merchant_reference' => 'getMerchantReference', + 'order' => 'getOrder', + 'payment_method' => 'getPaymentMethod', + 'psp_reference' => 'getPspReference', + 'refusal_reason' => 'getRefusalReason', + 'refusal_reason_code' => 'getRefusalReasonCode', + 'result_code' => 'getResultCode', + 'three_ds2_response_data' => 'getThreeDs2ResponseData', + 'three_ds2_result' => 'getThreeDs2Result', + 'three_ds_payment_data' => 'getThreeDsPaymentData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_CODE_AUTHENTICATION_FINISHED = 'AuthenticationFinished'; + public const RESULT_CODE_AUTHENTICATION_NOT_REQUIRED = 'AuthenticationNotRequired'; + public const RESULT_CODE_AUTHORISED = 'Authorised'; + public const RESULT_CODE_CANCELLED = 'Cancelled'; + public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; + public const RESULT_CODE_ERROR = 'Error'; + public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PENDING = 'Pending'; + public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; + public const RESULT_CODE_RECEIVED = 'Received'; + public const RESULT_CODE_REDIRECT_SHOPPER = 'RedirectShopper'; + public const RESULT_CODE_REFUSED = 'Refused'; + public const RESULT_CODE_SUCCESS = 'Success'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultCodeAllowableValues() + { + return [ + self::RESULT_CODE_AUTHENTICATION_FINISHED, + self::RESULT_CODE_AUTHENTICATION_NOT_REQUIRED, + self::RESULT_CODE_AUTHORISED, + self::RESULT_CODE_CANCELLED, + self::RESULT_CODE_CHALLENGE_SHOPPER, + self::RESULT_CODE_ERROR, + self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PENDING, + self::RESULT_CODE_PRESENT_TO_SHOPPER, + self::RESULT_CODE_RECEIVED, + self::RESULT_CODE_REDIRECT_SHOPPER, + self::RESULT_CODE_REFUSED, + self::RESULT_CODE_SUCCESS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('donation_token', $data ?? [], null); + $this->setIfExists('fraud_result', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('refusal_reason', $data ?? [], null); + $this->setIfExists('refusal_reason_code', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + $this->setIfExists('three_ds2_response_data', $data ?? [], null); + $this->setIfExists('three_ds2_result', $data ?? [], null); + $this->setIfExists('three_ds_payment_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getResultCodeAllowableValues(); + if (!is_null($this->container['result_code']) && !in_array($this->container['result_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result_code', must be one of '%s'", + $this->container['result_code'], + 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 action + * + * @return \Adyen\Model\Checkout\PaymentResponseAction|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \Adyen\Model\Checkout\PaymentResponseAction|null $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets donation_token + * + * @return string|null + */ + public function getDonationToken() + { + return $this->container['donation_token']; + } + + /** + * Sets donation_token + * + * @param string|null $donation_token Donation Token containing payment details for Adyen Giving. + * + * @return self + */ + public function setDonationToken($donation_token) + { + if (is_null($donation_token)) { + throw new \InvalidArgumentException('non-nullable donation_token cannot be null'); + } + $this->container['donation_token'] = $donation_token; + + return $this; + } + + /** + * Gets fraud_result + * + * @return \Adyen\Model\Checkout\FraudResult|null + */ + public function getFraudResult() + { + return $this->container['fraud_result']; + } + + /** + * Sets fraud_result + * + * @param \Adyen\Model\Checkout\FraudResult|null $fraud_result fraud_result + * + * @return self + */ + public function setFraudResult($fraud_result) + { + if (is_null($fraud_result)) { + throw new \InvalidArgumentException('non-nullable fraud_result cannot be null'); + } + $this->container['fraud_result'] = $fraud_result; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string|null + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string|null $merchant_reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets order + * + * @return \Adyen\Model\Checkout\CheckoutOrderResponse|null + */ + public function getOrder() + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param \Adyen\Model\Checkout\CheckoutOrderResponse|null $order order + * + * @return self + */ + public function setOrder($order) + { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Adyen\Model\Checkout\ResponsePaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Adyen\Model\Checkout\ResponsePaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets refusal_reason + * + * @return string|null + */ + public function getRefusalReason() + { + return $this->container['refusal_reason']; + } + + /** + * Sets refusal_reason + * + * @param string|null $refusal_reason If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReason($refusal_reason) + { + if (is_null($refusal_reason)) { + throw new \InvalidArgumentException('non-nullable refusal_reason cannot be null'); + } + $this->container['refusal_reason'] = $refusal_reason; + + return $this; + } + + /** + * Gets refusal_reason_code + * + * @return string|null + */ + public function getRefusalReasonCode() + { + return $this->container['refusal_reason_code']; + } + + /** + * Sets refusal_reason_code + * + * @param string|null $refusal_reason_code Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReasonCode($refusal_reason_code) + { + if (is_null($refusal_reason_code)) { + throw new \InvalidArgumentException('non-nullable refusal_reason_code cannot be null'); + } + $this->container['refusal_reason_code'] = $refusal_reason_code; + + return $this; + } + + /** + * Gets result_code + * + * @return string|null + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string|null $result_code The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!in_array($result_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result_code', must be one of '%s'", + $result_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result_code'] = $result_code; + + return $this; + } + + /** + * Gets three_ds2_response_data + * + * @return \Adyen\Model\Checkout\ThreeDS2ResponseData|null + */ + public function getThreeDs2ResponseData() + { + return $this->container['three_ds2_response_data']; + } + + /** + * Sets three_ds2_response_data + * + * @param \Adyen\Model\Checkout\ThreeDS2ResponseData|null $three_ds2_response_data three_ds2_response_data + * + * @return self + */ + public function setThreeDs2ResponseData($three_ds2_response_data) + { + if (is_null($three_ds2_response_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_response_data cannot be null'); + } + $this->container['three_ds2_response_data'] = $three_ds2_response_data; + + return $this; + } + + /** + * Gets three_ds2_result + * + * @return \Adyen\Model\Checkout\ThreeDS2Result|null + */ + public function getThreeDs2Result() + { + return $this->container['three_ds2_result']; + } + + /** + * Sets three_ds2_result + * + * @param \Adyen\Model\Checkout\ThreeDS2Result|null $three_ds2_result three_ds2_result + * + * @return self + */ + public function setThreeDs2Result($three_ds2_result) + { + if (is_null($three_ds2_result)) { + throw new \InvalidArgumentException('non-nullable three_ds2_result cannot be null'); + } + $this->container['three_ds2_result'] = $three_ds2_result; + + return $this; + } + + /** + * Gets three_ds_payment_data + * + * @return string|null + */ + public function getThreeDsPaymentData() + { + return $this->container['three_ds_payment_data']; + } + + /** + * Sets three_ds_payment_data + * + * @param string|null $three_ds_payment_data When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. + * + * @return self + */ + public function setThreeDsPaymentData($three_ds_payment_data) + { + if (is_null($three_ds_payment_data)) { + throw new \InvalidArgumentException('non-nullable three_ds_payment_data cannot be null'); + } + $this->container['three_ds_payment_data'] = $three_ds_payment_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentResponseAction.php b/src/Adyen/Model/Checkout/PaymentResponseAction.php new file mode 100644 index 000000000..2a8d10470 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentResponseAction.php @@ -0,0 +1,1309 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentResponseAction Class Doc Comment + * + * @category Class + * @description Action to be taken for completing the payment. + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentResponse_action'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_data' => 'string', + 'payment_method_type' => 'string', + 'type' => 'string', + 'url' => 'string', + 'data' => 'array', + 'method' => 'string', + 'native_redirect_data' => 'string', + 'expires_at' => 'string', + 'qr_code_data' => 'string', + 'sdk_data' => 'array', + 'authorisation_token' => 'string', + 'subtype' => 'string', + 'token' => 'string', + 'alternative_reference' => 'string', + 'collection_institution_number' => 'string', + 'download_url' => 'string', + 'entity' => 'string', + 'initial_amount' => '\Adyen\Model\Checkout\Amount', + 'instructions_url' => 'string', + 'issuer' => 'string', + 'masked_telephone_number' => 'string', + 'merchant_name' => 'string', + 'merchant_reference' => 'string', + 'reference' => 'string', + 'shopper_email' => 'string', + 'shopper_name' => 'string', + 'surcharge' => '\Adyen\Model\Checkout\Amount', + 'total_amount' => '\Adyen\Model\Checkout\Amount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_data' => null, + 'payment_method_type' => null, + 'type' => null, + 'url' => null, + 'data' => null, + 'method' => null, + 'native_redirect_data' => null, + 'expires_at' => null, + 'qr_code_data' => null, + 'sdk_data' => null, + 'authorisation_token' => null, + 'subtype' => null, + 'token' => null, + 'alternative_reference' => null, + 'collection_institution_number' => null, + 'download_url' => null, + 'entity' => null, + 'initial_amount' => null, + 'instructions_url' => null, + 'issuer' => null, + 'masked_telephone_number' => null, + 'merchant_name' => null, + 'merchant_reference' => null, + 'reference' => null, + 'shopper_email' => null, + 'shopper_name' => null, + 'surcharge' => null, + 'total_amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_data' => false, + 'payment_method_type' => false, + 'type' => false, + 'url' => false, + 'data' => false, + 'method' => false, + 'native_redirect_data' => false, + 'expires_at' => false, + 'qr_code_data' => false, + 'sdk_data' => false, + 'authorisation_token' => false, + 'subtype' => false, + 'token' => false, + 'alternative_reference' => false, + 'collection_institution_number' => false, + 'download_url' => false, + 'entity' => false, + 'initial_amount' => false, + 'instructions_url' => false, + 'issuer' => false, + 'masked_telephone_number' => false, + 'merchant_name' => false, + 'merchant_reference' => false, + 'reference' => false, + 'shopper_email' => false, + 'shopper_name' => false, + 'surcharge' => false, + 'total_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_data' => 'paymentData', + 'payment_method_type' => 'paymentMethodType', + 'type' => 'type', + 'url' => 'url', + 'data' => 'data', + 'method' => 'method', + 'native_redirect_data' => 'nativeRedirectData', + 'expires_at' => 'expiresAt', + 'qr_code_data' => 'qrCodeData', + 'sdk_data' => 'sdkData', + 'authorisation_token' => 'authorisationToken', + 'subtype' => 'subtype', + 'token' => 'token', + 'alternative_reference' => 'alternativeReference', + 'collection_institution_number' => 'collectionInstitutionNumber', + 'download_url' => 'downloadUrl', + 'entity' => 'entity', + 'initial_amount' => 'initialAmount', + 'instructions_url' => 'instructionsUrl', + 'issuer' => 'issuer', + 'masked_telephone_number' => 'maskedTelephoneNumber', + 'merchant_name' => 'merchantName', + 'merchant_reference' => 'merchantReference', + 'reference' => 'reference', + 'shopper_email' => 'shopperEmail', + 'shopper_name' => 'shopperName', + 'surcharge' => 'surcharge', + 'total_amount' => 'totalAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_data' => 'setPaymentData', + 'payment_method_type' => 'setPaymentMethodType', + 'type' => 'setType', + 'url' => 'setUrl', + 'data' => 'setData', + 'method' => 'setMethod', + 'native_redirect_data' => 'setNativeRedirectData', + 'expires_at' => 'setExpiresAt', + 'qr_code_data' => 'setQrCodeData', + 'sdk_data' => 'setSdkData', + 'authorisation_token' => 'setAuthorisationToken', + 'subtype' => 'setSubtype', + 'token' => 'setToken', + 'alternative_reference' => 'setAlternativeReference', + 'collection_institution_number' => 'setCollectionInstitutionNumber', + 'download_url' => 'setDownloadUrl', + 'entity' => 'setEntity', + 'initial_amount' => 'setInitialAmount', + 'instructions_url' => 'setInstructionsUrl', + 'issuer' => 'setIssuer', + 'masked_telephone_number' => 'setMaskedTelephoneNumber', + 'merchant_name' => 'setMerchantName', + 'merchant_reference' => 'setMerchantReference', + 'reference' => 'setReference', + 'shopper_email' => 'setShopperEmail', + 'shopper_name' => 'setShopperName', + 'surcharge' => 'setSurcharge', + 'total_amount' => 'setTotalAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_data' => 'getPaymentData', + 'payment_method_type' => 'getPaymentMethodType', + 'type' => 'getType', + 'url' => 'getUrl', + 'data' => 'getData', + 'method' => 'getMethod', + 'native_redirect_data' => 'getNativeRedirectData', + 'expires_at' => 'getExpiresAt', + 'qr_code_data' => 'getQrCodeData', + 'sdk_data' => 'getSdkData', + 'authorisation_token' => 'getAuthorisationToken', + 'subtype' => 'getSubtype', + 'token' => 'getToken', + 'alternative_reference' => 'getAlternativeReference', + 'collection_institution_number' => 'getCollectionInstitutionNumber', + 'download_url' => 'getDownloadUrl', + 'entity' => 'getEntity', + 'initial_amount' => 'getInitialAmount', + 'instructions_url' => 'getInstructionsUrl', + 'issuer' => 'getIssuer', + 'masked_telephone_number' => 'getMaskedTelephoneNumber', + 'merchant_name' => 'getMerchantName', + 'merchant_reference' => 'getMerchantReference', + 'reference' => 'getReference', + 'shopper_email' => 'getShopperEmail', + 'shopper_name' => 'getShopperName', + 'surcharge' => 'getSurcharge', + 'total_amount' => 'getTotalAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_data', $data ?? [], null); + $this->setIfExists('payment_method_type', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('native_redirect_data', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('qr_code_data', $data ?? [], null); + $this->setIfExists('sdk_data', $data ?? [], null); + $this->setIfExists('authorisation_token', $data ?? [], null); + $this->setIfExists('subtype', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); + $this->setIfExists('alternative_reference', $data ?? [], null); + $this->setIfExists('collection_institution_number', $data ?? [], null); + $this->setIfExists('download_url', $data ?? [], null); + $this->setIfExists('entity', $data ?? [], null); + $this->setIfExists('initial_amount', $data ?? [], null); + $this->setIfExists('instructions_url', $data ?? [], null); + $this->setIfExists('issuer', $data ?? [], null); + $this->setIfExists('masked_telephone_number', $data ?? [], null); + $this->setIfExists('merchant_name', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('surcharge', $data ?? [], null); + $this->setIfExists('total_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_data + * + * @return string|null + */ + public function getPaymentData() + { + return $this->container['payment_data']; + } + + /** + * Sets payment_data + * + * @param string|null $payment_data A value that must be submitted to the `/payments/details` endpoint to verify this payment. + * + * @return self + */ + public function setPaymentData($payment_data) + { + if (is_null($payment_data)) { + throw new \InvalidArgumentException('non-nullable payment_data cannot be null'); + } + $this->container['payment_data'] = $payment_data; + + return $this; + } + + /** + * Gets payment_method_type + * + * @return string|null + */ + public function getPaymentMethodType() + { + return $this->container['payment_method_type']; + } + + /** + * Sets payment_method_type + * + * @param string|null $payment_method_type Specifies the payment method. + * + * @return self + */ + public function setPaymentMethodType($payment_method_type) + { + if (is_null($payment_method_type)) { + throw new \InvalidArgumentException('non-nullable payment_method_type cannot be null'); + } + $this->container['payment_method_type'] = $payment_method_type; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **voucher** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Specifies the URL to redirect to. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets data + * + * @return array|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param array|null $data When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets method + * + * @return string|null + */ + public function getMethod() + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param string|null $method Specifies the HTTP method, for example GET or POST. + * + * @return self + */ + public function setMethod($method) + { + if (is_null($method)) { + throw new \InvalidArgumentException('non-nullable method cannot be null'); + } + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets native_redirect_data + * + * @return string|null + */ + public function getNativeRedirectData() + { + return $this->container['native_redirect_data']; + } + + /** + * Sets native_redirect_data + * + * @param string|null $native_redirect_data Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. + * + * @return self + */ + public function setNativeRedirectData($native_redirect_data) + { + if (is_null($native_redirect_data)) { + throw new \InvalidArgumentException('non-nullable native_redirect_data cannot be null'); + } + $this->container['native_redirect_data'] = $native_redirect_data; + + return $this; + } + + /** + * Gets expires_at + * + * @return string|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param string|null $expires_at The date time of the voucher expiry. + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets qr_code_data + * + * @return string|null + */ + public function getQrCodeData() + { + return $this->container['qr_code_data']; + } + + /** + * Sets qr_code_data + * + * @param string|null $qr_code_data The contents of the QR code as a UTF8 string. + * + * @return self + */ + public function setQrCodeData($qr_code_data) + { + if (is_null($qr_code_data)) { + throw new \InvalidArgumentException('non-nullable qr_code_data cannot be null'); + } + $this->container['qr_code_data'] = $qr_code_data; + + return $this; + } + + /** + * Gets sdk_data + * + * @return array|null + */ + public function getSdkData() + { + return $this->container['sdk_data']; + } + + /** + * Sets sdk_data + * + * @param array|null $sdk_data The data to pass to the SDK. + * + * @return self + */ + public function setSdkData($sdk_data) + { + if (is_null($sdk_data)) { + throw new \InvalidArgumentException('non-nullable sdk_data cannot be null'); + } + $this->container['sdk_data'] = $sdk_data; + + return $this; + } + + /** + * Gets authorisation_token + * + * @return string|null + */ + public function getAuthorisationToken() + { + return $this->container['authorisation_token']; + } + + /** + * Sets authorisation_token + * + * @param string|null $authorisation_token A token needed to authorise a payment. + * + * @return self + */ + public function setAuthorisationToken($authorisation_token) + { + if (is_null($authorisation_token)) { + throw new \InvalidArgumentException('non-nullable authorisation_token cannot be null'); + } + $this->container['authorisation_token'] = $authorisation_token; + + return $this; + } + + /** + * Gets subtype + * + * @return string|null + */ + public function getSubtype() + { + return $this->container['subtype']; + } + + /** + * Sets subtype + * + * @param string|null $subtype A subtype of the token. + * + * @return self + */ + public function setSubtype($subtype) + { + if (is_null($subtype)) { + throw new \InvalidArgumentException('non-nullable subtype cannot be null'); + } + $this->container['subtype'] = $subtype; + + return $this; + } + + /** + * Gets token + * + * @return string|null + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string|null $token A token to pass to the 3DS2 Component to get the fingerprint. + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + return $this; + } + + /** + * Gets alternative_reference + * + * @return string|null + */ + public function getAlternativeReference() + { + return $this->container['alternative_reference']; + } + + /** + * Sets alternative_reference + * + * @param string|null $alternative_reference The voucher alternative reference code. + * + * @return self + */ + public function setAlternativeReference($alternative_reference) + { + if (is_null($alternative_reference)) { + throw new \InvalidArgumentException('non-nullable alternative_reference cannot be null'); + } + $this->container['alternative_reference'] = $alternative_reference; + + return $this; + } + + /** + * Gets collection_institution_number + * + * @return string|null + */ + public function getCollectionInstitutionNumber() + { + return $this->container['collection_institution_number']; + } + + /** + * Sets collection_institution_number + * + * @param string|null $collection_institution_number A collection institution number (store number) for Econtext Pay-Easy ATM. + * + * @return self + */ + public function setCollectionInstitutionNumber($collection_institution_number) + { + if (is_null($collection_institution_number)) { + throw new \InvalidArgumentException('non-nullable collection_institution_number cannot be null'); + } + $this->container['collection_institution_number'] = $collection_institution_number; + + return $this; + } + + /** + * Gets download_url + * + * @return string|null + */ + public function getDownloadUrl() + { + return $this->container['download_url']; + } + + /** + * Sets download_url + * + * @param string|null $download_url The URL to download the voucher. + * + * @return self + */ + public function setDownloadUrl($download_url) + { + if (is_null($download_url)) { + throw new \InvalidArgumentException('non-nullable download_url cannot be null'); + } + $this->container['download_url'] = $download_url; + + return $this; + } + + /** + * Gets entity + * + * @return string|null + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param string|null $entity An entity number of Multibanco. + * + * @return self + */ + public function setEntity($entity) + { + if (is_null($entity)) { + throw new \InvalidArgumentException('non-nullable entity cannot be null'); + } + $this->container['entity'] = $entity; + + return $this; + } + + /** + * Gets initial_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getInitialAmount() + { + return $this->container['initial_amount']; + } + + /** + * Sets initial_amount + * + * @param \Adyen\Model\Checkout\Amount|null $initial_amount initial_amount + * + * @return self + */ + public function setInitialAmount($initial_amount) + { + if (is_null($initial_amount)) { + throw new \InvalidArgumentException('non-nullable initial_amount cannot be null'); + } + $this->container['initial_amount'] = $initial_amount; + + return $this; + } + + /** + * Gets instructions_url + * + * @return string|null + */ + public function getInstructionsUrl() + { + return $this->container['instructions_url']; + } + + /** + * Sets instructions_url + * + * @param string|null $instructions_url The URL to the detailed instructions to make payment using the voucher. + * + * @return self + */ + public function setInstructionsUrl($instructions_url) + { + if (is_null($instructions_url)) { + throw new \InvalidArgumentException('non-nullable instructions_url cannot be null'); + } + $this->container['instructions_url'] = $instructions_url; + + return $this; + } + + /** + * Gets issuer + * + * @return string|null + */ + public function getIssuer() + { + return $this->container['issuer']; + } + + /** + * Sets issuer + * + * @param string|null $issuer The issuer of the voucher. + * + * @return self + */ + public function setIssuer($issuer) + { + if (is_null($issuer)) { + throw new \InvalidArgumentException('non-nullable issuer cannot be null'); + } + $this->container['issuer'] = $issuer; + + return $this; + } + + /** + * Gets masked_telephone_number + * + * @return string|null + */ + public function getMaskedTelephoneNumber() + { + return $this->container['masked_telephone_number']; + } + + /** + * Sets masked_telephone_number + * + * @param string|null $masked_telephone_number The shopper telephone number (partially masked). + * + * @return self + */ + public function setMaskedTelephoneNumber($masked_telephone_number) + { + if (is_null($masked_telephone_number)) { + throw new \InvalidArgumentException('non-nullable masked_telephone_number cannot be null'); + } + $this->container['masked_telephone_number'] = $masked_telephone_number; + + return $this; + } + + /** + * Gets merchant_name + * + * @return string|null + */ + public function getMerchantName() + { + return $this->container['merchant_name']; + } + + /** + * Sets merchant_name + * + * @param string|null $merchant_name The merchant name. + * + * @return self + */ + public function setMerchantName($merchant_name) + { + if (is_null($merchant_name)) { + throw new \InvalidArgumentException('non-nullable merchant_name cannot be null'); + } + $this->container['merchant_name'] = $merchant_name; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string|null + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string|null $merchant_reference The merchant reference. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The voucher reference code. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper email. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_name + * + * @return string|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param string|null $shopper_name The shopper name. + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets surcharge + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getSurcharge() + { + return $this->container['surcharge']; + } + + /** + * Sets surcharge + * + * @param \Adyen\Model\Checkout\Amount|null $surcharge surcharge + * + * @return self + */ + public function setSurcharge($surcharge) + { + if (is_null($surcharge)) { + throw new \InvalidArgumentException('non-nullable surcharge cannot be null'); + } + $this->container['surcharge'] = $surcharge; + + return $this; + } + + /** + * Gets total_amount + * + * @return \Adyen\Model\Checkout\Amount|null + */ + public function getTotalAmount() + { + return $this->container['total_amount']; + } + + /** + * Sets total_amount + * + * @param \Adyen\Model\Checkout\Amount|null $total_amount total_amount + * + * @return self + */ + public function setTotalAmount($total_amount) + { + if (is_null($total_amount)) { + throw new \InvalidArgumentException('non-nullable total_amount cannot be null'); + } + $this->container['total_amount'] = $total_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentReversalResource.php b/src/Adyen/Model/Checkout/PaymentReversalResource.php new file mode 100644 index 000000000..d0409d729 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentReversalResource.php @@ -0,0 +1,566 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentReversalResource Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentReversalResource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentReversalResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'payment_psp_reference' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'payment_psp_reference' => null, + 'psp_reference' => null, + 'reference' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'payment_psp_reference' => false, + 'psp_reference' => false, + 'reference' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'payment_psp_reference' => 'paymentPspReference', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'payment_psp_reference' => 'setPaymentPspReference', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'payment_psp_reference' => 'getPaymentPspReference', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_RECEIVED = 'received'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('payment_psp_reference', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_psp_reference'] === null) { + $invalidProperties[] = "'payment_psp_reference' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets payment_psp_reference + * + * @return string + */ + public function getPaymentPspReference() + { + return $this->container['payment_psp_reference']; + } + + /** + * Sets payment_psp_reference + * + * @param string $payment_psp_reference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. + * + * @return self + */ + public function setPaymentPspReference($payment_psp_reference) + { + if (is_null($payment_psp_reference)) { + throw new \InvalidArgumentException('non-nullable payment_psp_reference cannot be null'); + } + $this->container['payment_psp_reference'] = $payment_psp_reference; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference Adyen's 16-character reference associated with the reversal request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the reversal request. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of your request. This will always have the value **received**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentSetupRequest.php b/src/Adyen/Model/Checkout/PaymentSetupRequest.php new file mode 100644 index 000000000..015e85337 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentSetupRequest.php @@ -0,0 +1,2341 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentSetupRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentSetupRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentSetupRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'allowed_payment_methods' => 'string[]', + 'amount' => '\Adyen\Model\Checkout\Amount', + 'application_info' => '\Adyen\Model\Checkout\ApplicationInfo', + 'billing_address' => '\Adyen\Model\Checkout\Address', + 'blocked_payment_methods' => 'string[]', + 'capture_delay_hours' => 'int', + 'channel' => 'string', + 'checkout_attempt_id' => 'string', + 'company' => '\Adyen\Model\Checkout\Company', + 'configuration' => '\Adyen\Model\Checkout\Configuration', + 'conversion_id' => 'string', + 'country_code' => 'string', + 'date_of_birth' => '\DateTime', + 'dcc_quote' => '\Adyen\Model\Checkout\ForexQuote', + 'delivery_address' => '\Adyen\Model\Checkout\Address', + 'delivery_date' => '\DateTime', + 'enable_one_click' => 'bool', + 'enable_pay_out' => 'bool', + 'enable_recurring' => 'bool', + 'entity_type' => 'string', + 'fraud_offset' => 'int', + 'installments' => '\Adyen\Model\Checkout\Installments', + 'line_items' => '\Adyen\Model\Checkout\LineItem[]', + 'localized_shopper_statement' => 'array', + 'mandate' => '\Adyen\Model\Checkout\Mandate', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'metadata' => 'array', + 'order_reference' => 'string', + 'origin' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Checkout\PlatformChargebackLogic', + 'recurring_expiry' => 'string', + 'recurring_frequency' => 'string', + 'reference' => 'string', + 'return_url' => 'string', + 'risk_data' => '\Adyen\Model\Checkout\RiskData', + 'sdk_version' => 'string', + 'session_validity' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Checkout\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'splits' => '\Adyen\Model\Checkout\Split[]', + 'store' => 'string', + 'store_payment_method' => 'bool', + 'telephone_number' => 'string', + 'three_ds_authentication_only' => 'bool', + 'token' => 'string', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'allowed_payment_methods' => null, + 'amount' => null, + 'application_info' => null, + 'billing_address' => null, + 'blocked_payment_methods' => null, + 'capture_delay_hours' => 'int32', + 'channel' => null, + 'checkout_attempt_id' => null, + 'company' => null, + 'configuration' => null, + 'conversion_id' => null, + 'country_code' => null, + 'date_of_birth' => 'date', + 'dcc_quote' => null, + 'delivery_address' => null, + 'delivery_date' => 'date-time', + 'enable_one_click' => null, + 'enable_pay_out' => null, + 'enable_recurring' => null, + 'entity_type' => null, + 'fraud_offset' => 'int32', + 'installments' => null, + 'line_items' => null, + 'localized_shopper_statement' => null, + 'mandate' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'metadata' => null, + 'order_reference' => null, + 'origin' => null, + 'platform_chargeback_logic' => null, + 'recurring_expiry' => null, + 'recurring_frequency' => null, + 'reference' => null, + 'return_url' => null, + 'risk_data' => null, + 'sdk_version' => null, + 'session_validity' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'splits' => null, + 'store' => null, + 'store_payment_method' => null, + 'telephone_number' => null, + 'three_ds_authentication_only' => null, + 'token' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'allowed_payment_methods' => false, + 'amount' => false, + 'application_info' => false, + 'billing_address' => false, + 'blocked_payment_methods' => false, + 'capture_delay_hours' => true, + 'channel' => false, + 'checkout_attempt_id' => false, + 'company' => false, + 'configuration' => false, + 'conversion_id' => false, + 'country_code' => false, + 'date_of_birth' => false, + 'dcc_quote' => false, + 'delivery_address' => false, + 'delivery_date' => false, + 'enable_one_click' => false, + 'enable_pay_out' => false, + 'enable_recurring' => false, + 'entity_type' => false, + 'fraud_offset' => true, + 'installments' => false, + 'line_items' => false, + 'localized_shopper_statement' => false, + 'mandate' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'metadata' => false, + 'order_reference' => false, + 'origin' => false, + 'platform_chargeback_logic' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'reference' => false, + 'return_url' => false, + 'risk_data' => false, + 'sdk_version' => false, + 'session_validity' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'splits' => false, + 'store' => false, + 'store_payment_method' => false, + 'telephone_number' => false, + 'three_ds_authentication_only' => false, + 'token' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'allowed_payment_methods' => 'allowedPaymentMethods', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'billing_address' => 'billingAddress', + 'blocked_payment_methods' => 'blockedPaymentMethods', + 'capture_delay_hours' => 'captureDelayHours', + 'channel' => 'channel', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'company' => 'company', + 'configuration' => 'configuration', + 'conversion_id' => 'conversionId', + 'country_code' => 'countryCode', + 'date_of_birth' => 'dateOfBirth', + 'dcc_quote' => 'dccQuote', + 'delivery_address' => 'deliveryAddress', + 'delivery_date' => 'deliveryDate', + 'enable_one_click' => 'enableOneClick', + 'enable_pay_out' => 'enablePayOut', + 'enable_recurring' => 'enableRecurring', + 'entity_type' => 'entityType', + 'fraud_offset' => 'fraudOffset', + 'installments' => 'installments', + 'line_items' => 'lineItems', + 'localized_shopper_statement' => 'localizedShopperStatement', + 'mandate' => 'mandate', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'metadata' => 'metadata', + 'order_reference' => 'orderReference', + 'origin' => 'origin', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'reference' => 'reference', + 'return_url' => 'returnUrl', + 'risk_data' => 'riskData', + 'sdk_version' => 'sdkVersion', + 'session_validity' => 'sessionValidity', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'splits' => 'splits', + 'store' => 'store', + 'store_payment_method' => 'storePaymentMethod', + 'telephone_number' => 'telephoneNumber', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'token' => 'token', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'allowed_payment_methods' => 'setAllowedPaymentMethods', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'billing_address' => 'setBillingAddress', + 'blocked_payment_methods' => 'setBlockedPaymentMethods', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'channel' => 'setChannel', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'company' => 'setCompany', + 'configuration' => 'setConfiguration', + 'conversion_id' => 'setConversionId', + 'country_code' => 'setCountryCode', + 'date_of_birth' => 'setDateOfBirth', + 'dcc_quote' => 'setDccQuote', + 'delivery_address' => 'setDeliveryAddress', + 'delivery_date' => 'setDeliveryDate', + 'enable_one_click' => 'setEnableOneClick', + 'enable_pay_out' => 'setEnablePayOut', + 'enable_recurring' => 'setEnableRecurring', + 'entity_type' => 'setEntityType', + 'fraud_offset' => 'setFraudOffset', + 'installments' => 'setInstallments', + 'line_items' => 'setLineItems', + 'localized_shopper_statement' => 'setLocalizedShopperStatement', + 'mandate' => 'setMandate', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'metadata' => 'setMetadata', + 'order_reference' => 'setOrderReference', + 'origin' => 'setOrigin', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'reference' => 'setReference', + 'return_url' => 'setReturnUrl', + 'risk_data' => 'setRiskData', + 'sdk_version' => 'setSdkVersion', + 'session_validity' => 'setSessionValidity', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'store_payment_method' => 'setStorePaymentMethod', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'token' => 'setToken', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'allowed_payment_methods' => 'getAllowedPaymentMethods', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'billing_address' => 'getBillingAddress', + 'blocked_payment_methods' => 'getBlockedPaymentMethods', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'channel' => 'getChannel', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'company' => 'getCompany', + 'configuration' => 'getConfiguration', + 'conversion_id' => 'getConversionId', + 'country_code' => 'getCountryCode', + 'date_of_birth' => 'getDateOfBirth', + 'dcc_quote' => 'getDccQuote', + 'delivery_address' => 'getDeliveryAddress', + 'delivery_date' => 'getDeliveryDate', + 'enable_one_click' => 'getEnableOneClick', + 'enable_pay_out' => 'getEnablePayOut', + 'enable_recurring' => 'getEnableRecurring', + 'entity_type' => 'getEntityType', + 'fraud_offset' => 'getFraudOffset', + 'installments' => 'getInstallments', + 'line_items' => 'getLineItems', + 'localized_shopper_statement' => 'getLocalizedShopperStatement', + 'mandate' => 'getMandate', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'metadata' => 'getMetadata', + 'order_reference' => 'getOrderReference', + 'origin' => 'getOrigin', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'reference' => 'getReference', + 'return_url' => 'getReturnUrl', + 'risk_data' => 'getRiskData', + 'sdk_version' => 'getSdkVersion', + 'session_validity' => 'getSessionValidity', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'store_payment_method' => 'getStorePaymentMethod', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'token' => 'getToken', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHANNEL_I_OS = 'iOS'; + public const CHANNEL_ANDROID = 'Android'; + public const CHANNEL_WEB = 'Web'; + public const ENTITY_TYPE_NATURAL_PERSON = 'NaturalPerson'; + public const ENTITY_TYPE_COMPANY_NAME = 'CompanyName'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChannelAllowableValues() + { + return [ + self::CHANNEL_I_OS, + self::CHANNEL_ANDROID, + self::CHANNEL_WEB, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEntityTypeAllowableValues() + { + return [ + self::ENTITY_TYPE_NATURAL_PERSON, + self::ENTITY_TYPE_COMPANY_NAME, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('allowed_payment_methods', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('blocked_payment_methods', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('conversion_id', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('dcc_quote', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('delivery_date', $data ?? [], null); + $this->setIfExists('enable_one_click', $data ?? [], null); + $this->setIfExists('enable_pay_out', $data ?? [], null); + $this->setIfExists('enable_recurring', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('line_items', $data ?? [], null); + $this->setIfExists('localized_shopper_statement', $data ?? [], null); + $this->setIfExists('mandate', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('order_reference', $data ?? [], null); + $this->setIfExists('origin', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('risk_data', $data ?? [], null); + $this->setIfExists('sdk_version', $data ?? [], null); + $this->setIfExists('session_validity', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_payment_method', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('token', $data ?? [], null); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getChannelAllowableValues(); + if (!is_null($this->container['channel']) && !in_array($this->container['channel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'channel', must be one of '%s'", + $this->container['channel'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['country_code'] === null) { + $invalidProperties[] = "'country_code' can't be null"; + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!is_null($this->container['entity_type']) && !in_array($this->container['entity_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'entity_type', must be one of '%s'", + $this->container['entity_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['return_url'] === null) { + $invalidProperties[] = "'return_url' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets allowed_payment_methods + * + * @return string[]|null + */ + public function getAllowedPaymentMethods() + { + return $this->container['allowed_payment_methods']; + } + + /** + * Sets allowed_payment_methods + * + * @param string[]|null $allowed_payment_methods List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setAllowedPaymentMethods($allowed_payment_methods) + { + if (is_null($allowed_payment_methods)) { + throw new \InvalidArgumentException('non-nullable allowed_payment_methods cannot be null'); + } + $this->container['allowed_payment_methods'] = $allowed_payment_methods; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Checkout\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Checkout\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Checkout\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets blocked_payment_methods + * + * @return string[]|null + */ + public function getBlockedPaymentMethods() + { + return $this->container['blocked_payment_methods']; + } + + /** + * Sets blocked_payment_methods + * + * @param string[]|null $blocked_payment_methods List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * + * @return self + */ + public function setBlockedPaymentMethods($blocked_payment_methods) + { + if (is_null($blocked_payment_methods)) { + throw new \InvalidArgumentException('non-nullable blocked_payment_methods cannot be null'); + } + $this->container['blocked_payment_methods'] = $blocked_payment_methods; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets channel + * + * @return string|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string|null $channel The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $allowedValues = $this->getChannelAllowableValues(); + if (!in_array($channel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'channel', must be one of '%s'", + $channel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets company + * + * @return \Adyen\Model\Checkout\Company|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param \Adyen\Model\Checkout\Company|null $company company + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets configuration + * + * @return \Adyen\Model\Checkout\Configuration|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param \Adyen\Model\Checkout\Configuration|null $configuration configuration + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets conversion_id + * + * @return string|null + */ + public function getConversionId() + { + return $this->container['conversion_id']; + } + + /** + * Sets conversion_id + * + * @param string|null $conversion_id Conversion ID that corresponds to the Id generated for tracking user payment journey. + * + * @return self + */ + public function setConversionId($conversion_id) + { + if (is_null($conversion_id)) { + throw new \InvalidArgumentException('non-nullable conversion_id cannot be null'); + } + $this->container['conversion_id'] = $conversion_id; + + return $this; + } + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets dcc_quote + * + * @return \Adyen\Model\Checkout\ForexQuote|null + */ + public function getDccQuote() + { + return $this->container['dcc_quote']; + } + + /** + * Sets dcc_quote + * + * @param \Adyen\Model\Checkout\ForexQuote|null $dcc_quote dcc_quote + * + * @return self + */ + public function setDccQuote($dcc_quote) + { + if (is_null($dcc_quote)) { + throw new \InvalidArgumentException('non-nullable dcc_quote cannot be null'); + } + $this->container['dcc_quote'] = $dcc_quote; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Checkout\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Checkout\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets delivery_date + * + * @return \DateTime|null + */ + public function getDeliveryDate() + { + return $this->container['delivery_date']; + } + + /** + * Sets delivery_date + * + * @param \DateTime|null $delivery_date The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliveryDate($delivery_date) + { + if (is_null($delivery_date)) { + throw new \InvalidArgumentException('non-nullable delivery_date cannot be null'); + } + $this->container['delivery_date'] = $delivery_date; + + return $this; + } + + /** + * Gets enable_one_click + * + * @return bool|null + */ + public function getEnableOneClick() + { + return $this->container['enable_one_click']; + } + + /** + * Sets enable_one_click + * + * @param bool|null $enable_one_click When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + * + * @return self + */ + public function setEnableOneClick($enable_one_click) + { + if (is_null($enable_one_click)) { + throw new \InvalidArgumentException('non-nullable enable_one_click cannot be null'); + } + $this->container['enable_one_click'] = $enable_one_click; + + return $this; + } + + /** + * Gets enable_pay_out + * + * @return bool|null + */ + public function getEnablePayOut() + { + return $this->container['enable_pay_out']; + } + + /** + * Sets enable_pay_out + * + * @param bool|null $enable_pay_out When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + * + * @return self + */ + public function setEnablePayOut($enable_pay_out) + { + if (is_null($enable_pay_out)) { + throw new \InvalidArgumentException('non-nullable enable_pay_out cannot be null'); + } + $this->container['enable_pay_out'] = $enable_pay_out; + + return $this; + } + + /** + * Gets enable_recurring + * + * @return bool|null + */ + public function getEnableRecurring() + { + return $this->container['enable_recurring']; + } + + /** + * Sets enable_recurring + * + * @param bool|null $enable_recurring When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + * + * @return self + */ + public function setEnableRecurring($enable_recurring) + { + if (is_null($enable_recurring)) { + throw new \InvalidArgumentException('non-nullable enable_recurring cannot be null'); + } + $this->container['enable_recurring'] = $enable_recurring; + + return $this; + } + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type The type of the entity the payment is processed for. + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + throw new \InvalidArgumentException('non-nullable entity_type cannot be null'); + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!in_array($entity_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'entity_type', must be one of '%s'", + $entity_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Checkout\Installments|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Checkout\Installments|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets line_items + * + * @return \Adyen\Model\Checkout\LineItem[]|null + */ + public function getLineItems() + { + return $this->container['line_items']; + } + + /** + * Sets line_items + * + * @param \Adyen\Model\Checkout\LineItem[]|null $line_items Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * + * @return self + */ + public function setLineItems($line_items) + { + if (is_null($line_items)) { + throw new \InvalidArgumentException('non-nullable line_items cannot be null'); + } + $this->container['line_items'] = $line_items; + + return $this; + } + + /** + * Gets localized_shopper_statement + * + * @return array|null + */ + public function getLocalizedShopperStatement() + { + return $this->container['localized_shopper_statement']; + } + + /** + * Sets localized_shopper_statement + * + * @param array|null $localized_shopper_statement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * + * @return self + */ + public function setLocalizedShopperStatement($localized_shopper_statement) + { + if (is_null($localized_shopper_statement)) { + throw new \InvalidArgumentException('non-nullable localized_shopper_statement cannot be null'); + } + $this->container['localized_shopper_statement'] = $localized_shopper_statement; + + return $this; + } + + /** + * Gets mandate + * + * @return \Adyen\Model\Checkout\Mandate|null + */ + public function getMandate() + { + return $this->container['mandate']; + } + + /** + * Sets mandate + * + * @param \Adyen\Model\Checkout\Mandate|null $mandate mandate + * + * @return self + */ + public function setMandate($mandate) + { + if (is_null($mandate)) { + throw new \InvalidArgumentException('non-nullable mandate cannot be null'); + } + $this->container['mandate'] = $mandate; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets order_reference + * + * @return string|null + */ + public function getOrderReference() + { + return $this->container['order_reference']; + } + + /** + * Sets order_reference + * + * @param string|null $order_reference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + * + * @return self + */ + public function setOrderReference($order_reference) + { + if (is_null($order_reference)) { + throw new \InvalidArgumentException('non-nullable order_reference cannot be null'); + } + $this->container['order_reference'] = $order_reference; + + return $this; + } + + /** + * Gets origin + * + * @return string|null + */ + public function getOrigin() + { + return $this->container['origin']; + } + + /** + * Sets origin + * + * @param string|null $origin Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from. + * + * @return self + */ + public function setOrigin($origin) + { + if (is_null($origin)) { + throw new \InvalidArgumentException('non-nullable origin cannot be null'); + } + $this->container['origin'] = $origin; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Checkout\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Checkout\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param string|null $recurring_expiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Minimum number of days between authorisations. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets return_url + * + * @return string + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string $return_url The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets risk_data + * + * @return \Adyen\Model\Checkout\RiskData|null + */ + public function getRiskData() + { + return $this->container['risk_data']; + } + + /** + * Sets risk_data + * + * @param \Adyen\Model\Checkout\RiskData|null $risk_data risk_data + * + * @return self + */ + public function setRiskData($risk_data) + { + if (is_null($risk_data)) { + throw new \InvalidArgumentException('non-nullable risk_data cannot be null'); + } + $this->container['risk_data'] = $risk_data; + + return $this; + } + + /** + * Gets sdk_version + * + * @return string|null + */ + public function getSdkVersion() + { + return $this->container['sdk_version']; + } + + /** + * Sets sdk_version + * + * @param string|null $sdk_version The version of the SDK you are using (for Web SDK integrations only). + * + * @return self + */ + public function setSdkVersion($sdk_version) + { + if (is_null($sdk_version)) { + throw new \InvalidArgumentException('non-nullable sdk_version cannot be null'); + } + $this->container['sdk_version'] = $sdk_version; + + return $this; + } + + /** + * Gets session_validity + * + * @return string|null + */ + public function getSessionValidity() + { + return $this->container['session_validity']; + } + + /** + * Sets session_validity + * + * @param string|null $session_validity The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + * + * @return self + */ + public function setSessionValidity($session_validity) + { + if (is_null($session_validity)) { + throw new \InvalidArgumentException('non-nullable session_validity cannot be null'); + } + $this->container['session_validity'] = $session_validity; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Checkout\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Checkout\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Checkout\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Checkout\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_payment_method + * + * @return bool|null + */ + public function getStorePaymentMethod() + { + return $this->container['store_payment_method']; + } + + /** + * Sets store_payment_method + * + * @param bool|null $store_payment_method When true and `shopperReference` is provided, the payment details will be stored. + * + * @return self + */ + public function setStorePaymentMethod($store_payment_method) + { + if (is_null($store_payment_method)) { + throw new \InvalidArgumentException('non-nullable store_payment_method cannot be null'); + } + $this->container['store_payment_method'] = $store_payment_method; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + * @deprecated + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + * @deprecated + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets token + * + * @return string|null + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string|null $token The token obtained when initializing the SDK. > This parameter is required for iOS and Android; not required for Web. + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentSetupResponse.php b/src/Adyen/Model/Checkout/PaymentSetupResponse.php new file mode 100644 index 000000000..df6deba84 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentSetupResponse.php @@ -0,0 +1,423 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentSetupResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentSetupResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentSetupResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_session' => 'string', + 'recurring_details' => '\Adyen\Model\Checkout\RecurringDetail[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_session' => null, + 'recurring_details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_session' => false, + 'recurring_details' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_session' => 'paymentSession', + 'recurring_details' => 'recurringDetails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_session' => 'setPaymentSession', + 'recurring_details' => 'setRecurringDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_session' => 'getPaymentSession', + 'recurring_details' => 'getRecurringDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_session', $data ?? [], null); + $this->setIfExists('recurring_details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_session + * + * @return string|null + */ + public function getPaymentSession() + { + return $this->container['payment_session']; + } + + /** + * Sets payment_session + * + * @param string|null $payment_session The encoded payment session that you need to pass to the SDK. + * + * @return self + */ + public function setPaymentSession($payment_session) + { + if (is_null($payment_session)) { + throw new \InvalidArgumentException('non-nullable payment_session cannot be null'); + } + $this->container['payment_session'] = $payment_session; + + return $this; + } + + /** + * Gets recurring_details + * + * @return \Adyen\Model\Checkout\RecurringDetail[]|null + * @deprecated + */ + public function getRecurringDetails() + { + return $this->container['recurring_details']; + } + + /** + * Sets recurring_details + * + * @param \Adyen\Model\Checkout\RecurringDetail[]|null $recurring_details The detailed list of stored payment details required to generate payment forms. Will be empty if oneClick is set to false in the request. + * + * @return self + * @deprecated + */ + public function setRecurringDetails($recurring_details) + { + if (is_null($recurring_details)) { + throw new \InvalidArgumentException('non-nullable recurring_details cannot be null'); + } + $this->container['recurring_details'] = $recurring_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentVerificationRequest.php b/src/Adyen/Model/Checkout/PaymentVerificationRequest.php new file mode 100644 index 000000000..05fda4c0f --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentVerificationRequest.php @@ -0,0 +1,390 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentVerificationRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentVerificationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentVerificationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payload' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payload' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payload' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payload' => 'payload' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payload' => 'setPayload' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payload' => 'getPayload' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payload', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payload'] === null) { + $invalidProperties[] = "'payload' 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 payload + * + * @return string + */ + public function getPayload() + { + return $this->container['payload']; + } + + /** + * Sets payload + * + * @param string $payload Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment. + * + * @return self + */ + public function setPayload($payload) + { + if (is_null($payload)) { + throw new \InvalidArgumentException('non-nullable payload cannot be null'); + } + $this->container['payload'] = $payload; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PaymentVerificationResponse.php b/src/Adyen/Model/Checkout/PaymentVerificationResponse.php new file mode 100644 index 000000000..3cae22709 --- /dev/null +++ b/src/Adyen/Model/Checkout/PaymentVerificationResponse.php @@ -0,0 +1,754 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PaymentVerificationResponse Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PaymentVerificationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentVerificationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'fraud_result' => '\Adyen\Model\Checkout\FraudResult', + 'merchant_reference' => 'string', + 'order' => '\Adyen\Model\Checkout\CheckoutOrderResponse', + 'psp_reference' => 'string', + 'refusal_reason' => 'string', + 'refusal_reason_code' => 'string', + 'result_code' => 'string', + 'service_error' => '\Adyen\Model\Checkout\ServiceError2', + 'shopper_locale' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'fraud_result' => null, + 'merchant_reference' => null, + 'order' => null, + 'psp_reference' => null, + 'refusal_reason' => null, + 'refusal_reason_code' => null, + 'result_code' => null, + 'service_error' => null, + 'shopper_locale' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'fraud_result' => false, + 'merchant_reference' => false, + 'order' => false, + 'psp_reference' => false, + 'refusal_reason' => false, + 'refusal_reason_code' => false, + 'result_code' => false, + 'service_error' => false, + 'shopper_locale' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'fraud_result' => 'fraudResult', + 'merchant_reference' => 'merchantReference', + 'order' => 'order', + 'psp_reference' => 'pspReference', + 'refusal_reason' => 'refusalReason', + 'refusal_reason_code' => 'refusalReasonCode', + 'result_code' => 'resultCode', + 'service_error' => 'serviceError', + 'shopper_locale' => 'shopperLocale' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'fraud_result' => 'setFraudResult', + 'merchant_reference' => 'setMerchantReference', + 'order' => 'setOrder', + 'psp_reference' => 'setPspReference', + 'refusal_reason' => 'setRefusalReason', + 'refusal_reason_code' => 'setRefusalReasonCode', + 'result_code' => 'setResultCode', + 'service_error' => 'setServiceError', + 'shopper_locale' => 'setShopperLocale' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'fraud_result' => 'getFraudResult', + 'merchant_reference' => 'getMerchantReference', + 'order' => 'getOrder', + 'psp_reference' => 'getPspReference', + 'refusal_reason' => 'getRefusalReason', + 'refusal_reason_code' => 'getRefusalReasonCode', + 'result_code' => 'getResultCode', + 'service_error' => 'getServiceError', + 'shopper_locale' => 'getShopperLocale' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_CODE_AUTHENTICATION_FINISHED = 'AuthenticationFinished'; + public const RESULT_CODE_AUTHENTICATION_NOT_REQUIRED = 'AuthenticationNotRequired'; + public const RESULT_CODE_AUTHORISED = 'Authorised'; + public const RESULT_CODE_CANCELLED = 'Cancelled'; + public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; + public const RESULT_CODE_ERROR = 'Error'; + public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PENDING = 'Pending'; + public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; + public const RESULT_CODE_RECEIVED = 'Received'; + public const RESULT_CODE_REDIRECT_SHOPPER = 'RedirectShopper'; + public const RESULT_CODE_REFUSED = 'Refused'; + public const RESULT_CODE_SUCCESS = 'Success'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultCodeAllowableValues() + { + return [ + self::RESULT_CODE_AUTHENTICATION_FINISHED, + self::RESULT_CODE_AUTHENTICATION_NOT_REQUIRED, + self::RESULT_CODE_AUTHORISED, + self::RESULT_CODE_CANCELLED, + self::RESULT_CODE_CHALLENGE_SHOPPER, + self::RESULT_CODE_ERROR, + self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PENDING, + self::RESULT_CODE_PRESENT_TO_SHOPPER, + self::RESULT_CODE_RECEIVED, + self::RESULT_CODE_REDIRECT_SHOPPER, + self::RESULT_CODE_REFUSED, + self::RESULT_CODE_SUCCESS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('fraud_result', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('refusal_reason', $data ?? [], null); + $this->setIfExists('refusal_reason_code', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + $this->setIfExists('service_error', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_reference'] === null) { + $invalidProperties[] = "'merchant_reference' can't be null"; + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!is_null($this->container['result_code']) && !in_array($this->container['result_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result_code', must be one of '%s'", + $this->container['result_code'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['shopper_locale'] === null) { + $invalidProperties[] = "'shopper_locale' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets fraud_result + * + * @return \Adyen\Model\Checkout\FraudResult|null + */ + public function getFraudResult() + { + return $this->container['fraud_result']; + } + + /** + * Sets fraud_result + * + * @param \Adyen\Model\Checkout\FraudResult|null $fraud_result fraud_result + * + * @return self + */ + public function setFraudResult($fraud_result) + { + if (is_null($fraud_result)) { + throw new \InvalidArgumentException('non-nullable fraud_result cannot be null'); + } + $this->container['fraud_result'] = $fraud_result; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string $merchant_reference A unique value that you provided in the initial `/paymentSession` request as a `reference` field. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets order + * + * @return \Adyen\Model\Checkout\CheckoutOrderResponse|null + */ + public function getOrder() + { + return $this->container['order']; + } + + /** + * Sets order + * + * @param \Adyen\Model\Checkout\CheckoutOrderResponse|null $order order + * + * @return self + */ + public function setOrder($order) + { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets refusal_reason + * + * @return string|null + */ + public function getRefusalReason() + { + return $this->container['refusal_reason']; + } + + /** + * Sets refusal_reason + * + * @param string|null $refusal_reason If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReason($refusal_reason) + { + if (is_null($refusal_reason)) { + throw new \InvalidArgumentException('non-nullable refusal_reason cannot be null'); + } + $this->container['refusal_reason'] = $refusal_reason; + + return $this; + } + + /** + * Gets refusal_reason_code + * + * @return string|null + */ + public function getRefusalReasonCode() + { + return $this->container['refusal_reason_code']; + } + + /** + * Sets refusal_reason_code + * + * @param string|null $refusal_reason_code Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReasonCode($refusal_reason_code) + { + if (is_null($refusal_reason_code)) { + throw new \InvalidArgumentException('non-nullable refusal_reason_code cannot be null'); + } + $this->container['refusal_reason_code'] = $refusal_reason_code; + + return $this; + } + + /** + * Gets result_code + * + * @return string|null + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string|null $result_code The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!in_array($result_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result_code', must be one of '%s'", + $result_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result_code'] = $result_code; + + return $this; + } + + /** + * Gets service_error + * + * @return \Adyen\Model\Checkout\ServiceError2|null + */ + public function getServiceError() + { + return $this->container['service_error']; + } + + /** + * Sets service_error + * + * @param \Adyen\Model\Checkout\ServiceError2|null $service_error service_error + * + * @return self + */ + public function setServiceError($service_error) + { + if (is_null($service_error)) { + throw new \InvalidArgumentException('non-nullable service_error cannot be null'); + } + $this->container['service_error'] = $service_error; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string $shopper_locale The shopperLocale value provided in the payment request. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Phone.php b/src/Adyen/Model/Checkout/Phone.php new file mode 100644 index 000000000..d413a765c --- /dev/null +++ b/src/Adyen/Model/Checkout/Phone.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Phone Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Phone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Phone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cc' => 'string', + 'subscriber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cc' => null, + 'subscriber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cc' => false, + 'subscriber' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cc' => 'cc', + 'subscriber' => 'subscriber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cc' => 'setCc', + 'subscriber' => 'setSubscriber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cc' => 'getCc', + 'subscriber' => 'getSubscriber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cc', $data ?? [], null); + $this->setIfExists('subscriber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cc + * + * @return string|null + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param string|null $cc Country code. Length: 1–3 characters. + * + * @return self + */ + public function setCc($cc) + { + if (is_null($cc)) { + throw new \InvalidArgumentException('non-nullable cc cannot be null'); + } + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets subscriber + * + * @return string|null + */ + public function getSubscriber() + { + return $this->container['subscriber']; + } + + /** + * Sets subscriber + * + * @param string|null $subscriber Subscriber number. Maximum length: 15 characters. + * + * @return self + */ + public function setSubscriber($subscriber) + { + if (is_null($subscriber)) { + throw new \InvalidArgumentException('non-nullable subscriber cannot be null'); + } + $this->container['subscriber'] = $subscriber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/PlatformChargebackLogic.php b/src/Adyen/Model/Checkout/PlatformChargebackLogic.php new file mode 100644 index 000000000..febba798e --- /dev/null +++ b/src/Adyen/Model/Checkout/PlatformChargebackLogic.php @@ -0,0 +1,456 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * PlatformChargebackLogic Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PlatformChargebackLogic'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'behavior' => 'string', + 'target_account' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'behavior' => null, + 'target_account' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'behavior' => false, + 'target_account' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'behavior' => 'behavior', + 'target_account' => 'targetAccount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'behavior' => 'setBehavior', + 'target_account' => 'setTargetAccount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'behavior' => 'getBehavior', + 'target_account' => 'getTargetAccount' + ]; + + /** + * 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 BEHAVIOR_DEDUCT_ACCORDING_TO_SPLIT_RATIO = 'deductAccordingToSplitRatio'; + public const BEHAVIOR_DEDUCT_FROM_LIABLE_ACCOUNT = 'deductFromLiableAccount'; + public const BEHAVIOR_DEDUCT_FROM_ONE_BALANCE_ACCOUNT = 'deductFromOneBalanceAccount'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBehaviorAllowableValues() + { + return [ + self::BEHAVIOR_DEDUCT_ACCORDING_TO_SPLIT_RATIO, + self::BEHAVIOR_DEDUCT_FROM_LIABLE_ACCOUNT, + self::BEHAVIOR_DEDUCT_FROM_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('behavior', $data ?? [], null); + $this->setIfExists('target_account', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getBehaviorAllowableValues(); + if (!is_null($this->container['behavior']) && !in_array($this->container['behavior'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'behavior', must be one of '%s'", + $this->container['behavior'], + 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 behavior + * + * @return string|null + */ + public function getBehavior() + { + return $this->container['behavior']; + } + + /** + * Sets behavior + * + * @param string|null $behavior behavior + * + * @return self + */ + public function setBehavior($behavior) + { + if (is_null($behavior)) { + throw new \InvalidArgumentException('non-nullable behavior cannot be null'); + } + $allowedValues = $this->getBehaviorAllowableValues(); + if (!in_array($behavior, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'behavior', must be one of '%s'", + $behavior, + implode("', '", $allowedValues) + ) + ); + } + $this->container['behavior'] = $behavior; + + return $this; + } + + /** + * Gets target_account + * + * @return string|null + */ + public function getTargetAccount() + { + return $this->container['target_account']; + } + + /** + * Sets target_account + * + * @param string|null $target_account target_account + * + * @return self + */ + public function setTargetAccount($target_account) + { + if (is_null($target_account)) { + throw new \InvalidArgumentException('non-nullable target_account cannot be null'); + } + $this->container['target_account'] = $target_account; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/RatepayDetails.php b/src/Adyen/Model/Checkout/RatepayDetails.php new file mode 100644 index 000000000..035de7e40 --- /dev/null +++ b/src/Adyen/Model/Checkout/RatepayDetails.php @@ -0,0 +1,629 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * RatepayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class RatepayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RatepayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address' => 'string', + 'checkout_attempt_id' => 'string', + 'delivery_address' => 'string', + 'personal_details' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address' => null, + 'checkout_attempt_id' => null, + 'delivery_address' => null, + 'personal_details' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address' => false, + 'checkout_attempt_id' => false, + 'delivery_address' => false, + 'personal_details' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'delivery_address' => 'deliveryAddress', + 'personal_details' => 'personalDetails', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'delivery_address' => 'setDeliveryAddress', + 'personal_details' => 'setPersonalDetails', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'delivery_address' => 'getDeliveryAddress', + 'personal_details' => 'getPersonalDetails', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_RATEPAY = 'ratepay'; + public const TYPE_RATEPAY_DIRECTDEBIT = 'ratepay_directdebit'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RATEPAY, + self::TYPE_RATEPAY_DIRECTDEBIT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('personal_details', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'ratepay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_address + * + * @return string|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param string|null $billing_address The address where to send the invoice. + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets delivery_address + * + * @return string|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param string|null $delivery_address The address where the goods should be delivered. + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets personal_details + * + * @return string|null + */ + public function getPersonalDetails() + { + return $this->container['personal_details']; + } + + /** + * Sets personal_details + * + * @param string|null $personal_details Shopper name, date of birth, phone number, and email address. + * + * @return self + */ + public function setPersonalDetails($personal_details) + { + if (is_null($personal_details)) { + throw new \InvalidArgumentException('non-nullable personal_details cannot be null'); + } + $this->container['personal_details'] = $personal_details; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **ratepay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Recurring.php b/src/Adyen/Model/Checkout/Recurring.php new file mode 100644 index 000000000..2fdddb3b8 --- /dev/null +++ b/src/Adyen/Model/Checkout/Recurring.php @@ -0,0 +1,591 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Recurring Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Recurring implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Recurring'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contract' => 'string', + 'recurring_detail_name' => 'string', + 'recurring_expiry' => '\DateTime', + 'recurring_frequency' => 'string', + 'token_service' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contract' => null, + 'recurring_detail_name' => null, + 'recurring_expiry' => 'date-time', + 'recurring_frequency' => null, + 'token_service' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'contract' => false, + 'recurring_detail_name' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'token_service' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract' => 'contract', + 'recurring_detail_name' => 'recurringDetailName', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'token_service' => 'tokenService' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract' => 'setContract', + 'recurring_detail_name' => 'setRecurringDetailName', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'token_service' => 'setTokenService' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract' => 'getContract', + 'recurring_detail_name' => 'getRecurringDetailName', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'token_service' => 'getTokenService' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CONTRACT_ONECLICK = 'ONECLICK'; + public const CONTRACT_RECURRING = 'RECURRING'; + public const CONTRACT_PAYOUT = 'PAYOUT'; + public const TOKEN_SERVICE_VISATOKENSERVICE = 'VISATOKENSERVICE'; + public const TOKEN_SERVICE_MCTOKENSERVICE = 'MCTOKENSERVICE'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContractAllowableValues() + { + return [ + self::CONTRACT_ONECLICK, + self::CONTRACT_RECURRING, + self::CONTRACT_PAYOUT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTokenServiceAllowableValues() + { + return [ + self::TOKEN_SERVICE_VISATOKENSERVICE, + self::TOKEN_SERVICE_MCTOKENSERVICE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('contract', $data ?? [], null); + $this->setIfExists('recurring_detail_name', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('token_service', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getContractAllowableValues(); + if (!is_null($this->container['contract']) && !in_array($this->container['contract'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'contract', must be one of '%s'", + $this->container['contract'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTokenServiceAllowableValues(); + if (!is_null($this->container['token_service']) && !in_array($this->container['token_service'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'token_service', must be one of '%s'", + $this->container['token_service'], + 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 contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). + * + * @return self + */ + public function setContract($contract) + { + if (is_null($contract)) { + throw new \InvalidArgumentException('non-nullable contract cannot be null'); + } + $allowedValues = $this->getContractAllowableValues(); + if (!in_array($contract, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'contract', must be one of '%s'", + $contract, + implode("', '", $allowedValues) + ) + ); + } + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets recurring_detail_name + * + * @return string|null + */ + public function getRecurringDetailName() + { + return $this->container['recurring_detail_name']; + } + + /** + * Sets recurring_detail_name + * + * @param string|null $recurring_detail_name A descriptive name for this detail. + * + * @return self + */ + public function setRecurringDetailName($recurring_detail_name) + { + if (is_null($recurring_detail_name)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_name cannot be null'); + } + $this->container['recurring_detail_name'] = $recurring_detail_name; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return \DateTime|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param \DateTime|null $recurring_expiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Minimum number of days between authorisations. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets token_service + * + * @return string|null + */ + public function getTokenService() + { + return $this->container['token_service']; + } + + /** + * Sets token_service + * + * @param string|null $token_service The name of the token service. + * + * @return self + */ + public function setTokenService($token_service) + { + if (is_null($token_service)) { + throw new \InvalidArgumentException('non-nullable token_service cannot be null'); + } + $allowedValues = $this->getTokenServiceAllowableValues(); + if (!in_array($token_service, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'token_service', must be one of '%s'", + $token_service, + implode("', '", $allowedValues) + ) + ); + } + $this->container['token_service'] = $token_service; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/RecurringDetail.php b/src/Adyen/Model/Checkout/RecurringDetail.php new file mode 100644 index 000000000..1dcc5cae7 --- /dev/null +++ b/src/Adyen/Model/Checkout/RecurringDetail.php @@ -0,0 +1,760 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * RecurringDetail Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class RecurringDetail implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RecurringDetail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brand' => 'string', + 'brands' => 'string[]', + 'configuration' => 'array', + 'funding_source' => 'string', + 'group' => '\Adyen\Model\Checkout\PaymentMethodGroup', + 'input_details' => '\Adyen\Model\Checkout\InputDetail[]', + 'issuers' => '\Adyen\Model\Checkout\PaymentMethodIssuer[]', + 'name' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_details' => '\Adyen\Model\Checkout\StoredDetails', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brand' => null, + 'brands' => null, + 'configuration' => null, + 'funding_source' => null, + 'group' => null, + 'input_details' => null, + 'issuers' => null, + 'name' => null, + 'recurring_detail_reference' => null, + 'stored_details' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brand' => false, + 'brands' => false, + 'configuration' => false, + 'funding_source' => false, + 'group' => false, + 'input_details' => false, + 'issuers' => false, + 'name' => false, + 'recurring_detail_reference' => false, + 'stored_details' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brand' => 'brand', + 'brands' => 'brands', + 'configuration' => 'configuration', + 'funding_source' => 'fundingSource', + 'group' => 'group', + 'input_details' => 'inputDetails', + 'issuers' => 'issuers', + 'name' => 'name', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_details' => 'storedDetails', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brand' => 'setBrand', + 'brands' => 'setBrands', + 'configuration' => 'setConfiguration', + 'funding_source' => 'setFundingSource', + 'group' => 'setGroup', + 'input_details' => 'setInputDetails', + 'issuers' => 'setIssuers', + 'name' => 'setName', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_details' => 'setStoredDetails', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brand' => 'getBrand', + 'brands' => 'getBrands', + 'configuration' => 'getConfiguration', + 'funding_source' => 'getFundingSource', + 'group' => 'getGroup', + 'input_details' => 'getInputDetails', + 'issuers' => 'getIssuers', + 'name' => 'getName', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_details' => 'getStoredDetails', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('brands', $data ?? [], null); + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('group', $data ?? [], null); + $this->setIfExists('input_details', $data ?? [], null); + $this->setIfExists('issuers', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_details', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + 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 brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand Brand for the selected gift card. For example: plastix, hmclub. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets brands + * + * @return string[]|null + */ + public function getBrands() + { + return $this->container['brands']; + } + + /** + * Sets brands + * + * @param string[]|null $brands List of possible brands. For example: visa, mc. + * + * @return self + */ + public function setBrands($brands) + { + if (is_null($brands)) { + throw new \InvalidArgumentException('non-nullable brands cannot be null'); + } + $this->container['brands'] = $brands; + + return $this; + } + + /** + * Gets configuration + * + * @return array|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param array|null $configuration The configuration of the payment method. + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source of the payment method. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets group + * + * @return \Adyen\Model\Checkout\PaymentMethodGroup|null + */ + public function getGroup() + { + return $this->container['group']; + } + + /** + * Sets group + * + * @param \Adyen\Model\Checkout\PaymentMethodGroup|null $group group + * + * @return self + */ + public function setGroup($group) + { + if (is_null($group)) { + throw new \InvalidArgumentException('non-nullable group cannot be null'); + } + $this->container['group'] = $group; + + return $this; + } + + /** + * Gets input_details + * + * @return \Adyen\Model\Checkout\InputDetail[]|null + * @deprecated + */ + public function getInputDetails() + { + return $this->container['input_details']; + } + + /** + * Sets input_details + * + * @param \Adyen\Model\Checkout\InputDetail[]|null $input_details All input details to be provided to complete the payment with this payment method. + * + * @return self + * @deprecated + */ + public function setInputDetails($input_details) + { + if (is_null($input_details)) { + throw new \InvalidArgumentException('non-nullable input_details cannot be null'); + } + $this->container['input_details'] = $input_details; + + return $this; + } + + /** + * Gets issuers + * + * @return \Adyen\Model\Checkout\PaymentMethodIssuer[]|null + */ + public function getIssuers() + { + return $this->container['issuers']; + } + + /** + * Sets issuers + * + * @param \Adyen\Model\Checkout\PaymentMethodIssuer[]|null $issuers A list of issuers for this payment method. + * + * @return self + */ + public function setIssuers($issuers) + { + if (is_null($issuers)) { + throw new \InvalidArgumentException('non-nullable issuers cannot be null'); + } + $this->container['issuers'] = $issuers; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The displayable name of this payment method. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference The reference that uniquely identifies the recurring detail. + * + * @return self + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_details + * + * @return \Adyen\Model\Checkout\StoredDetails|null + */ + public function getStoredDetails() + { + return $this->container['stored_details']; + } + + /** + * Sets stored_details + * + * @param \Adyen\Model\Checkout\StoredDetails|null $stored_details stored_details + * + * @return self + */ + public function setStoredDetails($stored_details) + { + if (is_null($stored_details)) { + throw new \InvalidArgumentException('non-nullable stored_details cannot be null'); + } + $this->container['stored_details'] = $stored_details; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The unique payment method code. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php b/src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php new file mode 100644 index 000000000..0c36b04ce --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.php @@ -0,0 +1,523 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalData3DSecure Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalData3DSecure implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalData3DSecure'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'card_holder_info' => 'string', + 'cavv' => 'string', + 'cavv_algorithm' => 'string', + 'sca_exemption_requested' => 'string', + 'threeds2_card_enrolled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'card_holder_info' => null, + 'cavv' => null, + 'cavv_algorithm' => null, + 'sca_exemption_requested' => null, + 'threeds2_card_enrolled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'card_holder_info' => false, + 'cavv' => false, + 'cavv_algorithm' => false, + 'sca_exemption_requested' => false, + 'threeds2_card_enrolled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_holder_info' => 'cardHolderInfo', + 'cavv' => 'cavv', + 'cavv_algorithm' => 'cavvAlgorithm', + 'sca_exemption_requested' => 'scaExemptionRequested', + 'threeds2_card_enrolled' => 'threeds2.cardEnrolled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_holder_info' => 'setCardHolderInfo', + 'cavv' => 'setCavv', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'sca_exemption_requested' => 'setScaExemptionRequested', + 'threeds2_card_enrolled' => 'setThreeds2CardEnrolled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_holder_info' => 'getCardHolderInfo', + 'cavv' => 'getCavv', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'sca_exemption_requested' => 'getScaExemptionRequested', + 'threeds2_card_enrolled' => 'getThreeds2CardEnrolled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('card_holder_info', $data ?? [], null); + $this->setIfExists('cavv', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('sca_exemption_requested', $data ?? [], null); + $this->setIfExists('threeds2_card_enrolled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets card_holder_info + * + * @return string|null + */ + public function getCardHolderInfo() + { + return $this->container['card_holder_info']; + } + + /** + * Sets card_holder_info + * + * @param string|null $card_holder_info Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + * + * @return self + */ + public function setCardHolderInfo($card_holder_info) + { + if (is_null($card_holder_info)) { + throw new \InvalidArgumentException('non-nullable card_holder_info cannot be null'); + } + $this->container['card_holder_info'] = $card_holder_info; + + return $this; + } + + /** + * Gets cavv + * + * @return string|null + */ + public function getCavv() + { + return $this->container['cavv']; + } + + /** + * Sets cavv + * + * @param string|null $cavv The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. + * + * @return self + */ + public function setCavv($cavv) + { + if (is_null($cavv)) { + throw new \InvalidArgumentException('non-nullable cavv cannot be null'); + } + $this->container['cavv'] = $cavv; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm The CAVV algorithm used. + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets sca_exemption_requested + * + * @return string|null + */ + public function getScaExemptionRequested() + { + return $this->container['sca_exemption_requested']; + } + + /** + * Sets sca_exemption_requested + * + * @param string|null $sca_exemption_requested Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + * + * @return self + */ + public function setScaExemptionRequested($sca_exemption_requested) + { + if (is_null($sca_exemption_requested)) { + throw new \InvalidArgumentException('non-nullable sca_exemption_requested cannot be null'); + } + $this->container['sca_exemption_requested'] = $sca_exemption_requested; + + return $this; + } + + /** + * Gets threeds2_card_enrolled + * + * @return bool|null + */ + public function getThreeds2CardEnrolled() + { + return $this->container['threeds2_card_enrolled']; + } + + /** + * Sets threeds2_card_enrolled + * + * @param bool|null $threeds2_card_enrolled Indicates whether a card is enrolled for 3D Secure 2. + * + * @return self + */ + public function setThreeds2CardEnrolled($threeds2_card_enrolled) + { + if (is_null($threeds2_card_enrolled)) { + throw new \InvalidArgumentException('non-nullable threeds2_card_enrolled cannot be null'); + } + $this->container['threeds2_card_enrolled'] = $threeds2_card_enrolled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php new file mode 100644 index 000000000..146bbf069 --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.php @@ -0,0 +1,557 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalDataBillingAddress Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalDataBillingAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataBillingAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address_city' => 'string', + 'billing_address_country' => 'string', + 'billing_address_house_number_or_name' => 'string', + 'billing_address_postal_code' => 'string', + 'billing_address_state_or_province' => 'string', + 'billing_address_street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address_city' => null, + 'billing_address_country' => null, + 'billing_address_house_number_or_name' => null, + 'billing_address_postal_code' => null, + 'billing_address_state_or_province' => null, + 'billing_address_street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address_city' => false, + 'billing_address_country' => false, + 'billing_address_house_number_or_name' => false, + 'billing_address_postal_code' => false, + 'billing_address_state_or_province' => false, + 'billing_address_street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address_city' => 'billingAddress.city', + 'billing_address_country' => 'billingAddress.country', + 'billing_address_house_number_or_name' => 'billingAddress.houseNumberOrName', + 'billing_address_postal_code' => 'billingAddress.postalCode', + 'billing_address_state_or_province' => 'billingAddress.stateOrProvince', + 'billing_address_street' => 'billingAddress.street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address_city' => 'setBillingAddressCity', + 'billing_address_country' => 'setBillingAddressCountry', + 'billing_address_house_number_or_name' => 'setBillingAddressHouseNumberOrName', + 'billing_address_postal_code' => 'setBillingAddressPostalCode', + 'billing_address_state_or_province' => 'setBillingAddressStateOrProvince', + 'billing_address_street' => 'setBillingAddressStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address_city' => 'getBillingAddressCity', + 'billing_address_country' => 'getBillingAddressCountry', + 'billing_address_house_number_or_name' => 'getBillingAddressHouseNumberOrName', + 'billing_address_postal_code' => 'getBillingAddressPostalCode', + 'billing_address_state_or_province' => 'getBillingAddressStateOrProvince', + 'billing_address_street' => 'getBillingAddressStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address_city', $data ?? [], null); + $this->setIfExists('billing_address_country', $data ?? [], null); + $this->setIfExists('billing_address_house_number_or_name', $data ?? [], null); + $this->setIfExists('billing_address_postal_code', $data ?? [], null); + $this->setIfExists('billing_address_state_or_province', $data ?? [], null); + $this->setIfExists('billing_address_street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 billing_address_city + * + * @return string|null + */ + public function getBillingAddressCity() + { + return $this->container['billing_address_city']; + } + + /** + * Sets billing_address_city + * + * @param string|null $billing_address_city The billing address city passed in the payment request. + * + * @return self + */ + public function setBillingAddressCity($billing_address_city) + { + if (is_null($billing_address_city)) { + throw new \InvalidArgumentException('non-nullable billing_address_city cannot be null'); + } + $this->container['billing_address_city'] = $billing_address_city; + + return $this; + } + + /** + * Gets billing_address_country + * + * @return string|null + */ + public function getBillingAddressCountry() + { + return $this->container['billing_address_country']; + } + + /** + * Sets billing_address_country + * + * @param string|null $billing_address_country The billing address country passed in the payment request. Example: NL + * + * @return self + */ + public function setBillingAddressCountry($billing_address_country) + { + if (is_null($billing_address_country)) { + throw new \InvalidArgumentException('non-nullable billing_address_country cannot be null'); + } + $this->container['billing_address_country'] = $billing_address_country; + + return $this; + } + + /** + * Gets billing_address_house_number_or_name + * + * @return string|null + */ + public function getBillingAddressHouseNumberOrName() + { + return $this->container['billing_address_house_number_or_name']; + } + + /** + * Sets billing_address_house_number_or_name + * + * @param string|null $billing_address_house_number_or_name The billing address house number or name passed in the payment request. + * + * @return self + */ + public function setBillingAddressHouseNumberOrName($billing_address_house_number_or_name) + { + if (is_null($billing_address_house_number_or_name)) { + throw new \InvalidArgumentException('non-nullable billing_address_house_number_or_name cannot be null'); + } + $this->container['billing_address_house_number_or_name'] = $billing_address_house_number_or_name; + + return $this; + } + + /** + * Gets billing_address_postal_code + * + * @return string|null + */ + public function getBillingAddressPostalCode() + { + return $this->container['billing_address_postal_code']; + } + + /** + * Sets billing_address_postal_code + * + * @param string|null $billing_address_postal_code The billing address postal code passed in the payment request. Example: 1011 DJ + * + * @return self + */ + public function setBillingAddressPostalCode($billing_address_postal_code) + { + if (is_null($billing_address_postal_code)) { + throw new \InvalidArgumentException('non-nullable billing_address_postal_code cannot be null'); + } + $this->container['billing_address_postal_code'] = $billing_address_postal_code; + + return $this; + } + + /** + * Gets billing_address_state_or_province + * + * @return string|null + */ + public function getBillingAddressStateOrProvince() + { + return $this->container['billing_address_state_or_province']; + } + + /** + * Sets billing_address_state_or_province + * + * @param string|null $billing_address_state_or_province The billing address state or province passed in the payment request. Example: NH + * + * @return self + */ + public function setBillingAddressStateOrProvince($billing_address_state_or_province) + { + if (is_null($billing_address_state_or_province)) { + throw new \InvalidArgumentException('non-nullable billing_address_state_or_province cannot be null'); + } + $this->container['billing_address_state_or_province'] = $billing_address_state_or_province; + + return $this; + } + + /** + * Gets billing_address_street + * + * @return string|null + */ + public function getBillingAddressStreet() + { + return $this->container['billing_address_street']; + } + + /** + * Sets billing_address_street + * + * @param string|null $billing_address_street The billing address street passed in the payment request. + * + * @return self + */ + public function setBillingAddressStreet($billing_address_street) + { + if (is_null($billing_address_street)) { + throw new \InvalidArgumentException('non-nullable billing_address_street cannot be null'); + } + $this->container['billing_address_street'] = $billing_address_street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php new file mode 100644 index 000000000..e1625885f --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataCard.php @@ -0,0 +1,625 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalDataCard Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataCard'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'card_bin' => 'string', + 'card_holder_name' => 'string', + 'card_issuing_bank' => 'string', + 'card_issuing_country' => 'string', + 'card_issuing_currency' => 'string', + 'card_payment_method' => 'string', + 'card_summary' => 'string', + 'issuer_bin' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'card_bin' => null, + 'card_holder_name' => null, + 'card_issuing_bank' => null, + 'card_issuing_country' => null, + 'card_issuing_currency' => null, + 'card_payment_method' => null, + 'card_summary' => null, + 'issuer_bin' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'card_bin' => false, + 'card_holder_name' => false, + 'card_issuing_bank' => false, + 'card_issuing_country' => false, + 'card_issuing_currency' => false, + 'card_payment_method' => false, + 'card_summary' => false, + 'issuer_bin' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_bin' => 'cardBin', + 'card_holder_name' => 'cardHolderName', + 'card_issuing_bank' => 'cardIssuingBank', + 'card_issuing_country' => 'cardIssuingCountry', + 'card_issuing_currency' => 'cardIssuingCurrency', + 'card_payment_method' => 'cardPaymentMethod', + 'card_summary' => 'cardSummary', + 'issuer_bin' => 'issuerBin' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_bin' => 'setCardBin', + 'card_holder_name' => 'setCardHolderName', + 'card_issuing_bank' => 'setCardIssuingBank', + 'card_issuing_country' => 'setCardIssuingCountry', + 'card_issuing_currency' => 'setCardIssuingCurrency', + 'card_payment_method' => 'setCardPaymentMethod', + 'card_summary' => 'setCardSummary', + 'issuer_bin' => 'setIssuerBin' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_bin' => 'getCardBin', + 'card_holder_name' => 'getCardHolderName', + 'card_issuing_bank' => 'getCardIssuingBank', + 'card_issuing_country' => 'getCardIssuingCountry', + 'card_issuing_currency' => 'getCardIssuingCurrency', + 'card_payment_method' => 'getCardPaymentMethod', + 'card_summary' => 'getCardSummary', + 'issuer_bin' => 'getIssuerBin' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('card_bin', $data ?? [], null); + $this->setIfExists('card_holder_name', $data ?? [], null); + $this->setIfExists('card_issuing_bank', $data ?? [], null); + $this->setIfExists('card_issuing_country', $data ?? [], null); + $this->setIfExists('card_issuing_currency', $data ?? [], null); + $this->setIfExists('card_payment_method', $data ?? [], null); + $this->setIfExists('card_summary', $data ?? [], null); + $this->setIfExists('issuer_bin', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets card_bin + * + * @return string|null + */ + public function getCardBin() + { + return $this->container['card_bin']; + } + + /** + * Sets card_bin + * + * @param string|null $card_bin The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 + * + * @return self + */ + public function setCardBin($card_bin) + { + if (is_null($card_bin)) { + throw new \InvalidArgumentException('non-nullable card_bin cannot be null'); + } + $this->container['card_bin'] = $card_bin; + + return $this; + } + + /** + * Gets card_holder_name + * + * @return string|null + */ + public function getCardHolderName() + { + return $this->container['card_holder_name']; + } + + /** + * Sets card_holder_name + * + * @param string|null $card_holder_name The cardholder name passed in the payment request. + * + * @return self + */ + public function setCardHolderName($card_holder_name) + { + if (is_null($card_holder_name)) { + throw new \InvalidArgumentException('non-nullable card_holder_name cannot be null'); + } + $this->container['card_holder_name'] = $card_holder_name; + + return $this; + } + + /** + * Gets card_issuing_bank + * + * @return string|null + */ + public function getCardIssuingBank() + { + return $this->container['card_issuing_bank']; + } + + /** + * Sets card_issuing_bank + * + * @param string|null $card_issuing_bank The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. + * + * @return self + */ + public function setCardIssuingBank($card_issuing_bank) + { + if (is_null($card_issuing_bank)) { + throw new \InvalidArgumentException('non-nullable card_issuing_bank cannot be null'); + } + $this->container['card_issuing_bank'] = $card_issuing_bank; + + return $this; + } + + /** + * Gets card_issuing_country + * + * @return string|null + */ + public function getCardIssuingCountry() + { + return $this->container['card_issuing_country']; + } + + /** + * Sets card_issuing_country + * + * @param string|null $card_issuing_country The country where the card was issued. Example: US + * + * @return self + */ + public function setCardIssuingCountry($card_issuing_country) + { + if (is_null($card_issuing_country)) { + throw new \InvalidArgumentException('non-nullable card_issuing_country cannot be null'); + } + $this->container['card_issuing_country'] = $card_issuing_country; + + return $this; + } + + /** + * Gets card_issuing_currency + * + * @return string|null + */ + public function getCardIssuingCurrency() + { + return $this->container['card_issuing_currency']; + } + + /** + * Sets card_issuing_currency + * + * @param string|null $card_issuing_currency The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD + * + * @return self + */ + public function setCardIssuingCurrency($card_issuing_currency) + { + if (is_null($card_issuing_currency)) { + throw new \InvalidArgumentException('non-nullable card_issuing_currency cannot be null'); + } + $this->container['card_issuing_currency'] = $card_issuing_currency; + + return $this; + } + + /** + * Gets card_payment_method + * + * @return string|null + */ + public function getCardPaymentMethod() + { + return $this->container['card_payment_method']; + } + + /** + * Sets card_payment_method + * + * @param string|null $card_payment_method The card payment method used for the transaction. Example: amex + * + * @return self + */ + public function setCardPaymentMethod($card_payment_method) + { + if (is_null($card_payment_method)) { + throw new \InvalidArgumentException('non-nullable card_payment_method cannot be null'); + } + $this->container['card_payment_method'] = $card_payment_method; + + return $this; + } + + /** + * Gets card_summary + * + * @return string|null + */ + public function getCardSummary() + { + return $this->container['card_summary']; + } + + /** + * Sets card_summary + * + * @param string|null $card_summary The last four digits of a card number. > Returned only in case of a card payment. + * + * @return self + */ + public function setCardSummary($card_summary) + { + if (is_null($card_summary)) { + throw new \InvalidArgumentException('non-nullable card_summary cannot be null'); + } + $this->container['card_summary'] = $card_summary; + + return $this; + } + + /** + * Gets issuer_bin + * + * @return string|null + */ + public function getIssuerBin() + { + return $this->container['issuer_bin']; + } + + /** + * Sets issuer_bin + * + * @param string|null $issuer_bin The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 + * + * @return self + */ + public function setIssuerBin($issuer_bin) + { + if (is_null($issuer_bin)) { + throw new \InvalidArgumentException('non-nullable issuer_bin cannot be null'); + } + $this->container['issuer_bin'] = $issuer_bin; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php new file mode 100644 index 000000000..dd6ef6b06 --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataCommon.php @@ -0,0 +1,2427 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalDataCommon Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalDataCommon implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataCommon'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acquirer_account_code' => 'string', + 'acquirer_code' => 'string', + 'acquirer_reference' => 'string', + 'alias' => 'string', + 'alias_type' => 'string', + 'auth_code' => 'string', + 'authorisation_mid' => 'string', + 'authorised_amount_currency' => 'string', + 'authorised_amount_value' => 'string', + 'avs_result' => 'string', + 'avs_result_raw' => 'string', + 'bic' => 'string', + 'co_branded_with' => 'string', + 'cvc_result' => 'string', + 'cvc_result_raw' => 'string', + 'ds_trans_id' => 'string', + 'eci' => 'string', + 'expiry_date' => 'string', + 'extra_costs_currency' => 'string', + 'extra_costs_value' => 'string', + 'fraud_check__item_nr__fraud_checkname' => 'string', + 'fraud_manual_review' => 'string', + 'fraud_result_type' => 'string', + 'funding_source' => 'string', + 'funds_availability' => 'string', + 'inferred_refusal_reason' => 'string', + 'is_card_commercial' => 'string', + 'issuer_country' => 'string', + 'liability_shift' => 'string', + 'mc_bank_net_reference_number' => 'string', + 'merchant_advice_code' => 'string', + 'merchant_reference' => 'string', + 'network_tx_reference' => 'string', + 'owner_name' => 'string', + 'payment_account_reference' => 'string', + 'payment_method' => 'string', + 'payment_method_variant' => 'string', + 'payout_eligible' => 'string', + 'realtime_account_updater_status' => 'string', + 'receipt_free_text' => 'string', + 'recurring_contract_types' => 'string', + 'recurring_first_psp_reference' => 'string', + 'recurring_recurring_detail_reference' => 'string', + 'recurring_shopper_reference' => 'string', + 'recurring_processing_model' => 'string', + 'referred' => 'string', + 'refusal_reason_raw' => 'string', + 'request_amount' => 'string', + 'request_currency_code' => 'string', + 'shopper_interaction' => 'string', + 'shopper_reference' => 'string', + 'terminal_id' => 'string', + 'three_d_authenticated' => 'string', + 'three_d_authenticated_response' => 'string', + 'three_d_offered' => 'string', + 'three_d_offered_response' => 'string', + 'three_ds_version' => 'string', + 'visa_transaction_id' => 'string', + 'xid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acquirer_account_code' => null, + 'acquirer_code' => null, + 'acquirer_reference' => null, + 'alias' => null, + 'alias_type' => null, + 'auth_code' => null, + 'authorisation_mid' => null, + 'authorised_amount_currency' => null, + 'authorised_amount_value' => null, + 'avs_result' => null, + 'avs_result_raw' => null, + 'bic' => null, + 'co_branded_with' => null, + 'cvc_result' => null, + 'cvc_result_raw' => null, + 'ds_trans_id' => null, + 'eci' => null, + 'expiry_date' => null, + 'extra_costs_currency' => null, + 'extra_costs_value' => null, + 'fraud_check__item_nr__fraud_checkname' => null, + 'fraud_manual_review' => null, + 'fraud_result_type' => null, + 'funding_source' => null, + 'funds_availability' => null, + 'inferred_refusal_reason' => null, + 'is_card_commercial' => null, + 'issuer_country' => null, + 'liability_shift' => null, + 'mc_bank_net_reference_number' => null, + 'merchant_advice_code' => null, + 'merchant_reference' => null, + 'network_tx_reference' => null, + 'owner_name' => null, + 'payment_account_reference' => null, + 'payment_method' => null, + 'payment_method_variant' => null, + 'payout_eligible' => null, + 'realtime_account_updater_status' => null, + 'receipt_free_text' => null, + 'recurring_contract_types' => null, + 'recurring_first_psp_reference' => null, + 'recurring_recurring_detail_reference' => null, + 'recurring_shopper_reference' => null, + 'recurring_processing_model' => null, + 'referred' => null, + 'refusal_reason_raw' => null, + 'request_amount' => null, + 'request_currency_code' => null, + 'shopper_interaction' => null, + 'shopper_reference' => null, + 'terminal_id' => null, + 'three_d_authenticated' => null, + 'three_d_authenticated_response' => null, + 'three_d_offered' => null, + 'three_d_offered_response' => null, + 'three_ds_version' => null, + 'visa_transaction_id' => null, + 'xid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acquirer_account_code' => false, + 'acquirer_code' => false, + 'acquirer_reference' => false, + 'alias' => false, + 'alias_type' => false, + 'auth_code' => false, + 'authorisation_mid' => false, + 'authorised_amount_currency' => false, + 'authorised_amount_value' => false, + 'avs_result' => false, + 'avs_result_raw' => false, + 'bic' => false, + 'co_branded_with' => false, + 'cvc_result' => false, + 'cvc_result_raw' => false, + 'ds_trans_id' => false, + 'eci' => false, + 'expiry_date' => false, + 'extra_costs_currency' => false, + 'extra_costs_value' => false, + 'fraud_check__item_nr__fraud_checkname' => false, + 'fraud_manual_review' => false, + 'fraud_result_type' => false, + 'funding_source' => false, + 'funds_availability' => false, + 'inferred_refusal_reason' => false, + 'is_card_commercial' => false, + 'issuer_country' => false, + 'liability_shift' => false, + 'mc_bank_net_reference_number' => false, + 'merchant_advice_code' => false, + 'merchant_reference' => false, + 'network_tx_reference' => false, + 'owner_name' => false, + 'payment_account_reference' => false, + 'payment_method' => false, + 'payment_method_variant' => false, + 'payout_eligible' => false, + 'realtime_account_updater_status' => false, + 'receipt_free_text' => false, + 'recurring_contract_types' => false, + 'recurring_first_psp_reference' => false, + 'recurring_recurring_detail_reference' => false, + 'recurring_shopper_reference' => false, + 'recurring_processing_model' => false, + 'referred' => false, + 'refusal_reason_raw' => false, + 'request_amount' => false, + 'request_currency_code' => false, + 'shopper_interaction' => false, + 'shopper_reference' => false, + 'terminal_id' => false, + 'three_d_authenticated' => false, + 'three_d_authenticated_response' => false, + 'three_d_offered' => false, + 'three_d_offered_response' => false, + 'three_ds_version' => false, + 'visa_transaction_id' => false, + 'xid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acquirer_account_code' => 'acquirerAccountCode', + 'acquirer_code' => 'acquirerCode', + 'acquirer_reference' => 'acquirerReference', + 'alias' => 'alias', + 'alias_type' => 'aliasType', + 'auth_code' => 'authCode', + 'authorisation_mid' => 'authorisationMid', + 'authorised_amount_currency' => 'authorisedAmountCurrency', + 'authorised_amount_value' => 'authorisedAmountValue', + 'avs_result' => 'avsResult', + 'avs_result_raw' => 'avsResultRaw', + 'bic' => 'bic', + 'co_branded_with' => 'coBrandedWith', + 'cvc_result' => 'cvcResult', + 'cvc_result_raw' => 'cvcResultRaw', + 'ds_trans_id' => 'dsTransID', + 'eci' => 'eci', + 'expiry_date' => 'expiryDate', + 'extra_costs_currency' => 'extraCostsCurrency', + 'extra_costs_value' => 'extraCostsValue', + 'fraud_check__item_nr__fraud_checkname' => 'fraudCheck-[itemNr]-[FraudCheckname]', + 'fraud_manual_review' => 'fraudManualReview', + 'fraud_result_type' => 'fraudResultType', + 'funding_source' => 'fundingSource', + 'funds_availability' => 'fundsAvailability', + 'inferred_refusal_reason' => 'inferredRefusalReason', + 'is_card_commercial' => 'isCardCommercial', + 'issuer_country' => 'issuerCountry', + 'liability_shift' => 'liabilityShift', + 'mc_bank_net_reference_number' => 'mcBankNetReferenceNumber', + 'merchant_advice_code' => 'merchantAdviceCode', + 'merchant_reference' => 'merchantReference', + 'network_tx_reference' => 'networkTxReference', + 'owner_name' => 'ownerName', + 'payment_account_reference' => 'paymentAccountReference', + 'payment_method' => 'paymentMethod', + 'payment_method_variant' => 'paymentMethodVariant', + 'payout_eligible' => 'payoutEligible', + 'realtime_account_updater_status' => 'realtimeAccountUpdaterStatus', + 'receipt_free_text' => 'receiptFreeText', + 'recurring_contract_types' => 'recurring.contractTypes', + 'recurring_first_psp_reference' => 'recurring.firstPspReference', + 'recurring_recurring_detail_reference' => 'recurring.recurringDetailReference', + 'recurring_shopper_reference' => 'recurring.shopperReference', + 'recurring_processing_model' => 'recurringProcessingModel', + 'referred' => 'referred', + 'refusal_reason_raw' => 'refusalReasonRaw', + 'request_amount' => 'requestAmount', + 'request_currency_code' => 'requestCurrencyCode', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_reference' => 'shopperReference', + 'terminal_id' => 'terminalId', + 'three_d_authenticated' => 'threeDAuthenticated', + 'three_d_authenticated_response' => 'threeDAuthenticatedResponse', + 'three_d_offered' => 'threeDOffered', + 'three_d_offered_response' => 'threeDOfferedResponse', + 'three_ds_version' => 'threeDSVersion', + 'visa_transaction_id' => 'visaTransactionId', + 'xid' => 'xid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acquirer_account_code' => 'setAcquirerAccountCode', + 'acquirer_code' => 'setAcquirerCode', + 'acquirer_reference' => 'setAcquirerReference', + 'alias' => 'setAlias', + 'alias_type' => 'setAliasType', + 'auth_code' => 'setAuthCode', + 'authorisation_mid' => 'setAuthorisationMid', + 'authorised_amount_currency' => 'setAuthorisedAmountCurrency', + 'authorised_amount_value' => 'setAuthorisedAmountValue', + 'avs_result' => 'setAvsResult', + 'avs_result_raw' => 'setAvsResultRaw', + 'bic' => 'setBic', + 'co_branded_with' => 'setCoBrandedWith', + 'cvc_result' => 'setCvcResult', + 'cvc_result_raw' => 'setCvcResultRaw', + 'ds_trans_id' => 'setDsTransId', + 'eci' => 'setEci', + 'expiry_date' => 'setExpiryDate', + 'extra_costs_currency' => 'setExtraCostsCurrency', + 'extra_costs_value' => 'setExtraCostsValue', + 'fraud_check__item_nr__fraud_checkname' => 'setFraudCheckItemNrFraudCheckname', + 'fraud_manual_review' => 'setFraudManualReview', + 'fraud_result_type' => 'setFraudResultType', + 'funding_source' => 'setFundingSource', + 'funds_availability' => 'setFundsAvailability', + 'inferred_refusal_reason' => 'setInferredRefusalReason', + 'is_card_commercial' => 'setIsCardCommercial', + 'issuer_country' => 'setIssuerCountry', + 'liability_shift' => 'setLiabilityShift', + 'mc_bank_net_reference_number' => 'setMcBankNetReferenceNumber', + 'merchant_advice_code' => 'setMerchantAdviceCode', + 'merchant_reference' => 'setMerchantReference', + 'network_tx_reference' => 'setNetworkTxReference', + 'owner_name' => 'setOwnerName', + 'payment_account_reference' => 'setPaymentAccountReference', + 'payment_method' => 'setPaymentMethod', + 'payment_method_variant' => 'setPaymentMethodVariant', + 'payout_eligible' => 'setPayoutEligible', + 'realtime_account_updater_status' => 'setRealtimeAccountUpdaterStatus', + 'receipt_free_text' => 'setReceiptFreeText', + 'recurring_contract_types' => 'setRecurringContractTypes', + 'recurring_first_psp_reference' => 'setRecurringFirstPspReference', + 'recurring_recurring_detail_reference' => 'setRecurringRecurringDetailReference', + 'recurring_shopper_reference' => 'setRecurringShopperReference', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'referred' => 'setReferred', + 'refusal_reason_raw' => 'setRefusalReasonRaw', + 'request_amount' => 'setRequestAmount', + 'request_currency_code' => 'setRequestCurrencyCode', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_reference' => 'setShopperReference', + 'terminal_id' => 'setTerminalId', + 'three_d_authenticated' => 'setThreeDAuthenticated', + 'three_d_authenticated_response' => 'setThreeDAuthenticatedResponse', + 'three_d_offered' => 'setThreeDOffered', + 'three_d_offered_response' => 'setThreeDOfferedResponse', + 'three_ds_version' => 'setThreeDsVersion', + 'visa_transaction_id' => 'setVisaTransactionId', + 'xid' => 'setXid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acquirer_account_code' => 'getAcquirerAccountCode', + 'acquirer_code' => 'getAcquirerCode', + 'acquirer_reference' => 'getAcquirerReference', + 'alias' => 'getAlias', + 'alias_type' => 'getAliasType', + 'auth_code' => 'getAuthCode', + 'authorisation_mid' => 'getAuthorisationMid', + 'authorised_amount_currency' => 'getAuthorisedAmountCurrency', + 'authorised_amount_value' => 'getAuthorisedAmountValue', + 'avs_result' => 'getAvsResult', + 'avs_result_raw' => 'getAvsResultRaw', + 'bic' => 'getBic', + 'co_branded_with' => 'getCoBrandedWith', + 'cvc_result' => 'getCvcResult', + 'cvc_result_raw' => 'getCvcResultRaw', + 'ds_trans_id' => 'getDsTransId', + 'eci' => 'getEci', + 'expiry_date' => 'getExpiryDate', + 'extra_costs_currency' => 'getExtraCostsCurrency', + 'extra_costs_value' => 'getExtraCostsValue', + 'fraud_check__item_nr__fraud_checkname' => 'getFraudCheckItemNrFraudCheckname', + 'fraud_manual_review' => 'getFraudManualReview', + 'fraud_result_type' => 'getFraudResultType', + 'funding_source' => 'getFundingSource', + 'funds_availability' => 'getFundsAvailability', + 'inferred_refusal_reason' => 'getInferredRefusalReason', + 'is_card_commercial' => 'getIsCardCommercial', + 'issuer_country' => 'getIssuerCountry', + 'liability_shift' => 'getLiabilityShift', + 'mc_bank_net_reference_number' => 'getMcBankNetReferenceNumber', + 'merchant_advice_code' => 'getMerchantAdviceCode', + 'merchant_reference' => 'getMerchantReference', + 'network_tx_reference' => 'getNetworkTxReference', + 'owner_name' => 'getOwnerName', + 'payment_account_reference' => 'getPaymentAccountReference', + 'payment_method' => 'getPaymentMethod', + 'payment_method_variant' => 'getPaymentMethodVariant', + 'payout_eligible' => 'getPayoutEligible', + 'realtime_account_updater_status' => 'getRealtimeAccountUpdaterStatus', + 'receipt_free_text' => 'getReceiptFreeText', + 'recurring_contract_types' => 'getRecurringContractTypes', + 'recurring_first_psp_reference' => 'getRecurringFirstPspReference', + 'recurring_recurring_detail_reference' => 'getRecurringRecurringDetailReference', + 'recurring_shopper_reference' => 'getRecurringShopperReference', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'referred' => 'getReferred', + 'refusal_reason_raw' => 'getRefusalReasonRaw', + 'request_amount' => 'getRequestAmount', + 'request_currency_code' => 'getRequestCurrencyCode', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_reference' => 'getShopperReference', + 'terminal_id' => 'getTerminalId', + 'three_d_authenticated' => 'getThreeDAuthenticated', + 'three_d_authenticated_response' => 'getThreeDAuthenticatedResponse', + 'three_d_offered' => 'getThreeDOffered', + 'three_d_offered_response' => 'getThreeDOfferedResponse', + 'three_ds_version' => 'getThreeDsVersion', + 'visa_transaction_id' => 'getVisaTransactionId', + 'xid' => 'getXid' + ]; + + /** + * 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 FRAUD_RESULT_TYPE_GREEN = 'GREEN'; + public const FRAUD_RESULT_TYPE_FRAUD = 'FRAUD'; + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFraudResultTypeAllowableValues() + { + return [ + self::FRAUD_RESULT_TYPE_GREEN, + self::FRAUD_RESULT_TYPE_FRAUD, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('acquirer_account_code', $data ?? [], null); + $this->setIfExists('acquirer_code', $data ?? [], null); + $this->setIfExists('acquirer_reference', $data ?? [], null); + $this->setIfExists('alias', $data ?? [], null); + $this->setIfExists('alias_type', $data ?? [], null); + $this->setIfExists('auth_code', $data ?? [], null); + $this->setIfExists('authorisation_mid', $data ?? [], null); + $this->setIfExists('authorised_amount_currency', $data ?? [], null); + $this->setIfExists('authorised_amount_value', $data ?? [], null); + $this->setIfExists('avs_result', $data ?? [], null); + $this->setIfExists('avs_result_raw', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('co_branded_with', $data ?? [], null); + $this->setIfExists('cvc_result', $data ?? [], null); + $this->setIfExists('cvc_result_raw', $data ?? [], null); + $this->setIfExists('ds_trans_id', $data ?? [], null); + $this->setIfExists('eci', $data ?? [], null); + $this->setIfExists('expiry_date', $data ?? [], null); + $this->setIfExists('extra_costs_currency', $data ?? [], null); + $this->setIfExists('extra_costs_value', $data ?? [], null); + $this->setIfExists('fraud_check__item_nr__fraud_checkname', $data ?? [], null); + $this->setIfExists('fraud_manual_review', $data ?? [], null); + $this->setIfExists('fraud_result_type', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('funds_availability', $data ?? [], null); + $this->setIfExists('inferred_refusal_reason', $data ?? [], null); + $this->setIfExists('is_card_commercial', $data ?? [], null); + $this->setIfExists('issuer_country', $data ?? [], null); + $this->setIfExists('liability_shift', $data ?? [], null); + $this->setIfExists('mc_bank_net_reference_number', $data ?? [], null); + $this->setIfExists('merchant_advice_code', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('network_tx_reference', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('payment_account_reference', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('payment_method_variant', $data ?? [], null); + $this->setIfExists('payout_eligible', $data ?? [], null); + $this->setIfExists('realtime_account_updater_status', $data ?? [], null); + $this->setIfExists('receipt_free_text', $data ?? [], null); + $this->setIfExists('recurring_contract_types', $data ?? [], null); + $this->setIfExists('recurring_first_psp_reference', $data ?? [], null); + $this->setIfExists('recurring_recurring_detail_reference', $data ?? [], null); + $this->setIfExists('recurring_shopper_reference', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('referred', $data ?? [], null); + $this->setIfExists('refusal_reason_raw', $data ?? [], null); + $this->setIfExists('request_amount', $data ?? [], null); + $this->setIfExists('request_currency_code', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('terminal_id', $data ?? [], null); + $this->setIfExists('three_d_authenticated', $data ?? [], null); + $this->setIfExists('three_d_authenticated_response', $data ?? [], null); + $this->setIfExists('three_d_offered', $data ?? [], null); + $this->setIfExists('three_d_offered_response', $data ?? [], null); + $this->setIfExists('three_ds_version', $data ?? [], null); + $this->setIfExists('visa_transaction_id', $data ?? [], null); + $this->setIfExists('xid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFraudResultTypeAllowableValues(); + if (!is_null($this->container['fraud_result_type']) && !in_array($this->container['fraud_result_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'fraud_result_type', must be one of '%s'", + $this->container['fraud_result_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + 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 acquirer_account_code + * + * @return string|null + */ + public function getAcquirerAccountCode() + { + return $this->container['acquirer_account_code']; + } + + /** + * Sets acquirer_account_code + * + * @param string|null $acquirer_account_code The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. + * + * @return self + */ + public function setAcquirerAccountCode($acquirer_account_code) + { + if (is_null($acquirer_account_code)) { + throw new \InvalidArgumentException('non-nullable acquirer_account_code cannot be null'); + } + $this->container['acquirer_account_code'] = $acquirer_account_code; + + return $this; + } + + /** + * Gets acquirer_code + * + * @return string|null + */ + public function getAcquirerCode() + { + return $this->container['acquirer_code']; + } + + /** + * Sets acquirer_code + * + * @param string|null $acquirer_code The name of the acquirer processing the payment request. Example: TestPmmAcquirer + * + * @return self + */ + public function setAcquirerCode($acquirer_code) + { + if (is_null($acquirer_code)) { + throw new \InvalidArgumentException('non-nullable acquirer_code cannot be null'); + } + $this->container['acquirer_code'] = $acquirer_code; + + return $this; + } + + /** + * Gets acquirer_reference + * + * @return string|null + */ + public function getAcquirerReference() + { + return $this->container['acquirer_reference']; + } + + /** + * Sets acquirer_reference + * + * @param string|null $acquirer_reference The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 + * + * @return self + */ + public function setAcquirerReference($acquirer_reference) + { + if (is_null($acquirer_reference)) { + throw new \InvalidArgumentException('non-nullable acquirer_reference cannot be null'); + } + $this->container['acquirer_reference'] = $acquirer_reference; + + return $this; + } + + /** + * Gets alias + * + * @return string|null + */ + public function getAlias() + { + return $this->container['alias']; + } + + /** + * Sets alias + * + * @param string|null $alias The Adyen alias of the card. Example: H167852639363479 + * + * @return self + */ + public function setAlias($alias) + { + if (is_null($alias)) { + throw new \InvalidArgumentException('non-nullable alias cannot be null'); + } + $this->container['alias'] = $alias; + + return $this; + } + + /** + * Gets alias_type + * + * @return string|null + */ + public function getAliasType() + { + return $this->container['alias_type']; + } + + /** + * Sets alias_type + * + * @param string|null $alias_type The type of the card alias. Example: Default + * + * @return self + */ + public function setAliasType($alias_type) + { + if (is_null($alias_type)) { + throw new \InvalidArgumentException('non-nullable alias_type cannot be null'); + } + $this->container['alias_type'] = $alias_type; + + return $this; + } + + /** + * Gets auth_code + * + * @return string|null + */ + public function getAuthCode() + { + return $this->container['auth_code']; + } + + /** + * Sets auth_code + * + * @param string|null $auth_code Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 + * + * @return self + */ + public function setAuthCode($auth_code) + { + if (is_null($auth_code)) { + throw new \InvalidArgumentException('non-nullable auth_code cannot be null'); + } + $this->container['auth_code'] = $auth_code; + + return $this; + } + + /** + * Gets authorisation_mid + * + * @return string|null + */ + public function getAuthorisationMid() + { + return $this->container['authorisation_mid']; + } + + /** + * Sets authorisation_mid + * + * @param string|null $authorisation_mid Merchant ID known by the acquirer. + * + * @return self + */ + public function setAuthorisationMid($authorisation_mid) + { + if (is_null($authorisation_mid)) { + throw new \InvalidArgumentException('non-nullable authorisation_mid cannot be null'); + } + $this->container['authorisation_mid'] = $authorisation_mid; + + return $this; + } + + /** + * Gets authorised_amount_currency + * + * @return string|null + */ + public function getAuthorisedAmountCurrency() + { + return $this->container['authorised_amount_currency']; + } + + /** + * Sets authorised_amount_currency + * + * @param string|null $authorised_amount_currency The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setAuthorisedAmountCurrency($authorised_amount_currency) + { + if (is_null($authorised_amount_currency)) { + throw new \InvalidArgumentException('non-nullable authorised_amount_currency cannot be null'); + } + $this->container['authorised_amount_currency'] = $authorised_amount_currency; + + return $this; + } + + /** + * Gets authorised_amount_value + * + * @return string|null + */ + public function getAuthorisedAmountValue() + { + return $this->container['authorised_amount_value']; + } + + /** + * Sets authorised_amount_value + * + * @param string|null $authorised_amount_value Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setAuthorisedAmountValue($authorised_amount_value) + { + if (is_null($authorised_amount_value)) { + throw new \InvalidArgumentException('non-nullable authorised_amount_value cannot be null'); + } + $this->container['authorised_amount_value'] = $authorised_amount_value; + + return $this; + } + + /** + * Gets avs_result + * + * @return string|null + */ + public function getAvsResult() + { + return $this->container['avs_result']; + } + + /** + * Sets avs_result + * + * @param string|null $avs_result The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). + * + * @return self + */ + public function setAvsResult($avs_result) + { + if (is_null($avs_result)) { + throw new \InvalidArgumentException('non-nullable avs_result cannot be null'); + } + $this->container['avs_result'] = $avs_result; + + return $this; + } + + /** + * Gets avs_result_raw + * + * @return string|null + */ + public function getAvsResultRaw() + { + return $this->container['avs_result_raw']; + } + + /** + * Sets avs_result_raw + * + * @param string|null $avs_result_raw Raw AVS result received from the acquirer, where available. Example: D + * + * @return self + */ + public function setAvsResultRaw($avs_result_raw) + { + if (is_null($avs_result_raw)) { + throw new \InvalidArgumentException('non-nullable avs_result_raw cannot be null'); + } + $this->container['avs_result_raw'] = $avs_result_raw; + + return $this; + } + + /** + * Gets bic + * + * @return string|null + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string|null $bic BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets co_branded_with + * + * @return string|null + */ + public function getCoBrandedWith() + { + return $this->container['co_branded_with']; + } + + /** + * Sets co_branded_with + * + * @param string|null $co_branded_with Includes the co-branded card information. + * + * @return self + */ + public function setCoBrandedWith($co_branded_with) + { + if (is_null($co_branded_with)) { + throw new \InvalidArgumentException('non-nullable co_branded_with cannot be null'); + } + $this->container['co_branded_with'] = $co_branded_with; + + return $this; + } + + /** + * Gets cvc_result + * + * @return string|null + */ + public function getCvcResult() + { + return $this->container['cvc_result']; + } + + /** + * Sets cvc_result + * + * @param string|null $cvc_result The result of CVC verification. + * + * @return self + */ + public function setCvcResult($cvc_result) + { + if (is_null($cvc_result)) { + throw new \InvalidArgumentException('non-nullable cvc_result cannot be null'); + } + $this->container['cvc_result'] = $cvc_result; + + return $this; + } + + /** + * Gets cvc_result_raw + * + * @return string|null + */ + public function getCvcResultRaw() + { + return $this->container['cvc_result_raw']; + } + + /** + * Sets cvc_result_raw + * + * @param string|null $cvc_result_raw The raw result of CVC verification. + * + * @return self + */ + public function setCvcResultRaw($cvc_result_raw) + { + if (is_null($cvc_result_raw)) { + throw new \InvalidArgumentException('non-nullable cvc_result_raw cannot be null'); + } + $this->container['cvc_result_raw'] = $cvc_result_raw; + + return $this; + } + + /** + * Gets ds_trans_id + * + * @return string|null + */ + public function getDsTransId() + { + return $this->container['ds_trans_id']; + } + + /** + * Sets ds_trans_id + * + * @param string|null $ds_trans_id Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. + * + * @return self + */ + public function setDsTransId($ds_trans_id) + { + if (is_null($ds_trans_id)) { + throw new \InvalidArgumentException('non-nullable ds_trans_id cannot be null'); + } + $this->container['ds_trans_id'] = $ds_trans_id; + + return $this; + } + + /** + * Gets eci + * + * @return string|null + */ + public function getEci() + { + return $this->container['eci']; + } + + /** + * Sets eci + * + * @param string|null $eci The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 + * + * @return self + */ + public function setEci($eci) + { + if (is_null($eci)) { + throw new \InvalidArgumentException('non-nullable eci cannot be null'); + } + $this->container['eci'] = $eci; + + return $this; + } + + /** + * Gets expiry_date + * + * @return string|null + */ + public function getExpiryDate() + { + return $this->container['expiry_date']; + } + + /** + * Sets expiry_date + * + * @param string|null $expiry_date The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. + * + * @return self + */ + public function setExpiryDate($expiry_date) + { + if (is_null($expiry_date)) { + throw new \InvalidArgumentException('non-nullable expiry_date cannot be null'); + } + $this->container['expiry_date'] = $expiry_date; + + return $this; + } + + /** + * Gets extra_costs_currency + * + * @return string|null + */ + public function getExtraCostsCurrency() + { + return $this->container['extra_costs_currency']; + } + + /** + * Sets extra_costs_currency + * + * @param string|null $extra_costs_currency The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR + * + * @return self + */ + public function setExtraCostsCurrency($extra_costs_currency) + { + if (is_null($extra_costs_currency)) { + throw new \InvalidArgumentException('non-nullable extra_costs_currency cannot be null'); + } + $this->container['extra_costs_currency'] = $extra_costs_currency; + + return $this; + } + + /** + * Gets extra_costs_value + * + * @return string|null + */ + public function getExtraCostsValue() + { + return $this->container['extra_costs_value']; + } + + /** + * Sets extra_costs_value + * + * @param string|null $extra_costs_value The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. + * + * @return self + */ + public function setExtraCostsValue($extra_costs_value) + { + if (is_null($extra_costs_value)) { + throw new \InvalidArgumentException('non-nullable extra_costs_value cannot be null'); + } + $this->container['extra_costs_value'] = $extra_costs_value; + + return $this; + } + + /** + * Gets fraud_check__item_nr__fraud_checkname + * + * @return string|null + */ + public function getFraudCheckItemNrFraudCheckname() + { + return $this->container['fraud_check__item_nr__fraud_checkname']; + } + + /** + * Sets fraud_check__item_nr__fraud_checkname + * + * @param string|null $fraud_check__item_nr__fraud_checkname The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. + * + * @return self + */ + public function setFraudCheckItemNrFraudCheckname($fraud_check__item_nr__fraud_checkname) + { + if (is_null($fraud_check__item_nr__fraud_checkname)) { + throw new \InvalidArgumentException('non-nullable fraud_check__item_nr__fraud_checkname cannot be null'); + } + $this->container['fraud_check__item_nr__fraud_checkname'] = $fraud_check__item_nr__fraud_checkname; + + return $this; + } + + /** + * Gets fraud_manual_review + * + * @return string|null + */ + public function getFraudManualReview() + { + return $this->container['fraud_manual_review']; + } + + /** + * Sets fraud_manual_review + * + * @param string|null $fraud_manual_review Indicates if the payment is sent to manual review. + * + * @return self + */ + public function setFraudManualReview($fraud_manual_review) + { + if (is_null($fraud_manual_review)) { + throw new \InvalidArgumentException('non-nullable fraud_manual_review cannot be null'); + } + $this->container['fraud_manual_review'] = $fraud_manual_review; + + return $this; + } + + /** + * Gets fraud_result_type + * + * @return string|null + */ + public function getFraudResultType() + { + return $this->container['fraud_result_type']; + } + + /** + * Sets fraud_result_type + * + * @param string|null $fraud_result_type The fraud result properties of the payment. + * + * @return self + */ + public function setFraudResultType($fraud_result_type) + { + if (is_null($fraud_result_type)) { + throw new \InvalidArgumentException('non-nullable fraud_result_type cannot be null'); + } + $allowedValues = $this->getFraudResultTypeAllowableValues(); + if (!in_array($fraud_result_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'fraud_result_type', must be one of '%s'", + $fraud_result_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['fraud_result_type'] = $fraud_result_type; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets funds_availability + * + * @return string|null + */ + public function getFundsAvailability() + { + return $this->container['funds_availability']; + } + + /** + * Sets funds_availability + * + * @param string|null $funds_availability Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". + * + * @return self + */ + public function setFundsAvailability($funds_availability) + { + if (is_null($funds_availability)) { + throw new \InvalidArgumentException('non-nullable funds_availability cannot be null'); + } + $this->container['funds_availability'] = $funds_availability; + + return $this; + } + + /** + * Gets inferred_refusal_reason + * + * @return string|null + */ + public function getInferredRefusalReason() + { + return $this->container['inferred_refusal_reason']; + } + + /** + * Sets inferred_refusal_reason + * + * @param string|null $inferred_refusal_reason Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card + * + * @return self + */ + public function setInferredRefusalReason($inferred_refusal_reason) + { + if (is_null($inferred_refusal_reason)) { + throw new \InvalidArgumentException('non-nullable inferred_refusal_reason cannot be null'); + } + $this->container['inferred_refusal_reason'] = $inferred_refusal_reason; + + return $this; + } + + /** + * Gets is_card_commercial + * + * @return string|null + */ + public function getIsCardCommercial() + { + return $this->container['is_card_commercial']; + } + + /** + * Sets is_card_commercial + * + * @param string|null $is_card_commercial Indicates if the card is used for business purposes only. + * + * @return self + */ + public function setIsCardCommercial($is_card_commercial) + { + if (is_null($is_card_commercial)) { + throw new \InvalidArgumentException('non-nullable is_card_commercial cannot be null'); + } + $this->container['is_card_commercial'] = $is_card_commercial; + + return $this; + } + + /** + * Gets issuer_country + * + * @return string|null + */ + public function getIssuerCountry() + { + return $this->container['issuer_country']; + } + + /** + * Sets issuer_country + * + * @param string|null $issuer_country The issuing country of the card based on the BIN list that Adyen maintains. Example: JP + * + * @return self + */ + public function setIssuerCountry($issuer_country) + { + if (is_null($issuer_country)) { + throw new \InvalidArgumentException('non-nullable issuer_country cannot be null'); + } + $this->container['issuer_country'] = $issuer_country; + + return $this; + } + + /** + * Gets liability_shift + * + * @return string|null + */ + public function getLiabilityShift() + { + return $this->container['liability_shift']; + } + + /** + * Sets liability_shift + * + * @param string|null $liability_shift A Boolean value indicating whether a liability shift was offered for this payment. + * + * @return self + */ + public function setLiabilityShift($liability_shift) + { + if (is_null($liability_shift)) { + throw new \InvalidArgumentException('non-nullable liability_shift cannot be null'); + } + $this->container['liability_shift'] = $liability_shift; + + return $this; + } + + /** + * Gets mc_bank_net_reference_number + * + * @return string|null + */ + public function getMcBankNetReferenceNumber() + { + return $this->container['mc_bank_net_reference_number']; + } + + /** + * Sets mc_bank_net_reference_number + * + * @param string|null $mc_bank_net_reference_number The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. + * + * @return self + */ + public function setMcBankNetReferenceNumber($mc_bank_net_reference_number) + { + if (is_null($mc_bank_net_reference_number)) { + throw new \InvalidArgumentException('non-nullable mc_bank_net_reference_number cannot be null'); + } + $this->container['mc_bank_net_reference_number'] = $mc_bank_net_reference_number; + + return $this; + } + + /** + * Gets merchant_advice_code + * + * @return string|null + */ + public function getMerchantAdviceCode() + { + return $this->container['merchant_advice_code']; + } + + /** + * Sets merchant_advice_code + * + * @param string|null $merchant_advice_code The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). + * + * @return self + */ + public function setMerchantAdviceCode($merchant_advice_code) + { + if (is_null($merchant_advice_code)) { + throw new \InvalidArgumentException('non-nullable merchant_advice_code cannot be null'); + } + $this->container['merchant_advice_code'] = $merchant_advice_code; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string|null + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string|null $merchant_reference The reference provided for the transaction. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets network_tx_reference + * + * @return string|null + */ + public function getNetworkTxReference() + { + return $this->container['network_tx_reference']; + } + + /** + * Sets network_tx_reference + * + * @param string|null $network_tx_reference Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + * + * @return self + */ + public function setNetworkTxReference($network_tx_reference) + { + if (is_null($network_tx_reference)) { + throw new \InvalidArgumentException('non-nullable network_tx_reference cannot be null'); + } + $this->container['network_tx_reference'] = $network_tx_reference; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets payment_account_reference + * + * @return string|null + */ + public function getPaymentAccountReference() + { + return $this->container['payment_account_reference']; + } + + /** + * Sets payment_account_reference + * + * @param string|null $payment_account_reference The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. + * + * @return self + */ + public function setPaymentAccountReference($payment_account_reference) + { + if (is_null($payment_account_reference)) { + throw new \InvalidArgumentException('non-nullable payment_account_reference cannot be null'); + } + $this->container['payment_account_reference'] = $payment_account_reference; + + return $this; + } + + /** + * Gets payment_method + * + * @return string|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param string|null $payment_method The payment method used in the transaction. + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets payment_method_variant + * + * @return string|null + */ + public function getPaymentMethodVariant() + { + return $this->container['payment_method_variant']; + } + + /** + * Sets payment_method_variant + * + * @param string|null $payment_method_variant The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro + * + * @return self + */ + public function setPaymentMethodVariant($payment_method_variant) + { + if (is_null($payment_method_variant)) { + throw new \InvalidArgumentException('non-nullable payment_method_variant cannot be null'); + } + $this->container['payment_method_variant'] = $payment_method_variant; + + return $this; + } + + /** + * Gets payout_eligible + * + * @return string|null + */ + public function getPayoutEligible() + { + return $this->container['payout_eligible']; + } + + /** + * Sets payout_eligible + * + * @param string|null $payout_eligible Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) + * + * @return self + */ + public function setPayoutEligible($payout_eligible) + { + if (is_null($payout_eligible)) { + throw new \InvalidArgumentException('non-nullable payout_eligible cannot be null'); + } + $this->container['payout_eligible'] = $payout_eligible; + + return $this; + } + + /** + * Gets realtime_account_updater_status + * + * @return string|null + */ + public function getRealtimeAccountUpdaterStatus() + { + return $this->container['realtime_account_updater_status']; + } + + /** + * Sets realtime_account_updater_status + * + * @param string|null $realtime_account_updater_status The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder + * + * @return self + */ + public function setRealtimeAccountUpdaterStatus($realtime_account_updater_status) + { + if (is_null($realtime_account_updater_status)) { + throw new \InvalidArgumentException('non-nullable realtime_account_updater_status cannot be null'); + } + $this->container['realtime_account_updater_status'] = $realtime_account_updater_status; + + return $this; + } + + /** + * Gets receipt_free_text + * + * @return string|null + */ + public function getReceiptFreeText() + { + return $this->container['receipt_free_text']; + } + + /** + * Sets receipt_free_text + * + * @param string|null $receipt_free_text Message to be displayed on the terminal. + * + * @return self + */ + public function setReceiptFreeText($receipt_free_text) + { + if (is_null($receipt_free_text)) { + throw new \InvalidArgumentException('non-nullable receipt_free_text cannot be null'); + } + $this->container['receipt_free_text'] = $receipt_free_text; + + return $this; + } + + /** + * Gets recurring_contract_types + * + * @return string|null + */ + public function getRecurringContractTypes() + { + return $this->container['recurring_contract_types']; + } + + /** + * Sets recurring_contract_types + * + * @param string|null $recurring_contract_types The recurring contract types applicable to the transaction. + * + * @return self + */ + public function setRecurringContractTypes($recurring_contract_types) + { + if (is_null($recurring_contract_types)) { + throw new \InvalidArgumentException('non-nullable recurring_contract_types cannot be null'); + } + $this->container['recurring_contract_types'] = $recurring_contract_types; + + return $this; + } + + /** + * Gets recurring_first_psp_reference + * + * @return string|null + */ + public function getRecurringFirstPspReference() + { + return $this->container['recurring_first_psp_reference']; + } + + /** + * Sets recurring_first_psp_reference + * + * @param string|null $recurring_first_psp_reference The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. + * + * @return self + */ + public function setRecurringFirstPspReference($recurring_first_psp_reference) + { + if (is_null($recurring_first_psp_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_first_psp_reference cannot be null'); + } + $this->container['recurring_first_psp_reference'] = $recurring_first_psp_reference; + + return $this; + } + + /** + * Gets recurring_recurring_detail_reference + * + * @return string|null + */ + public function getRecurringRecurringDetailReference() + { + return $this->container['recurring_recurring_detail_reference']; + } + + /** + * Sets recurring_recurring_detail_reference + * + * @param string|null $recurring_recurring_detail_reference The reference that uniquely identifies the recurring transaction. + * + * @return self + */ + public function setRecurringRecurringDetailReference($recurring_recurring_detail_reference) + { + if (is_null($recurring_recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_recurring_detail_reference cannot be null'); + } + $this->container['recurring_recurring_detail_reference'] = $recurring_recurring_detail_reference; + + return $this; + } + + /** + * Gets recurring_shopper_reference + * + * @return string|null + */ + public function getRecurringShopperReference() + { + return $this->container['recurring_shopper_reference']; + } + + /** + * Sets recurring_shopper_reference + * + * @param string|null $recurring_shopper_reference The provided reference of the shopper for a recurring transaction. + * + * @return self + */ + public function setRecurringShopperReference($recurring_shopper_reference) + { + if (is_null($recurring_shopper_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_shopper_reference cannot be null'); + } + $this->container['recurring_shopper_reference'] = $recurring_shopper_reference; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model The processing model used for the recurring transaction. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets referred + * + * @return string|null + */ + public function getReferred() + { + return $this->container['referred']; + } + + /** + * Sets referred + * + * @param string|null $referred If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true + * + * @return self + */ + public function setReferred($referred) + { + if (is_null($referred)) { + throw new \InvalidArgumentException('non-nullable referred cannot be null'); + } + $this->container['referred'] = $referred; + + return $this; + } + + /** + * Gets refusal_reason_raw + * + * @return string|null + */ + public function getRefusalReasonRaw() + { + return $this->container['refusal_reason_raw']; + } + + /** + * Sets refusal_reason_raw + * + * @param string|null $refusal_reason_raw Raw refusal reason received from the acquirer, where available. Example: AUTHORISED + * + * @return self + */ + public function setRefusalReasonRaw($refusal_reason_raw) + { + if (is_null($refusal_reason_raw)) { + throw new \InvalidArgumentException('non-nullable refusal_reason_raw cannot be null'); + } + $this->container['refusal_reason_raw'] = $refusal_reason_raw; + + return $this; + } + + /** + * Gets request_amount + * + * @return string|null + */ + public function getRequestAmount() + { + return $this->container['request_amount']; + } + + /** + * Sets request_amount + * + * @param string|null $request_amount The amount of the payment request. + * + * @return self + */ + public function setRequestAmount($request_amount) + { + if (is_null($request_amount)) { + throw new \InvalidArgumentException('non-nullable request_amount cannot be null'); + } + $this->container['request_amount'] = $request_amount; + + return $this; + } + + /** + * Gets request_currency_code + * + * @return string|null + */ + public function getRequestCurrencyCode() + { + return $this->container['request_currency_code']; + } + + /** + * Sets request_currency_code + * + * @param string|null $request_currency_code The currency of the payment request. + * + * @return self + */ + public function setRequestCurrencyCode($request_currency_code) + { + if (is_null($request_currency_code)) { + throw new \InvalidArgumentException('non-nullable request_currency_code cannot be null'); + } + $this->container['request_currency_code'] = $request_currency_code; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction The shopper interaction type of the payment request. Example: Ecommerce + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference The shopperReference passed in the payment request. Example: AdyenTestShopperXX + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets terminal_id + * + * @return string|null + */ + public function getTerminalId() + { + return $this->container['terminal_id']; + } + + /** + * Sets terminal_id + * + * @param string|null $terminal_id The terminal ID used in a point-of-sale payment. Example: 06022622 + * + * @return self + */ + public function setTerminalId($terminal_id) + { + if (is_null($terminal_id)) { + throw new \InvalidArgumentException('non-nullable terminal_id cannot be null'); + } + $this->container['terminal_id'] = $terminal_id; + + return $this; + } + + /** + * Gets three_d_authenticated + * + * @return string|null + */ + public function getThreeDAuthenticated() + { + return $this->container['three_d_authenticated']; + } + + /** + * Sets three_d_authenticated + * + * @param string|null $three_d_authenticated A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + * + * @return self + */ + public function setThreeDAuthenticated($three_d_authenticated) + { + if (is_null($three_d_authenticated)) { + throw new \InvalidArgumentException('non-nullable three_d_authenticated cannot be null'); + } + $this->container['three_d_authenticated'] = $three_d_authenticated; + + return $this; + } + + /** + * Gets three_d_authenticated_response + * + * @return string|null + */ + public function getThreeDAuthenticatedResponse() + { + return $this->container['three_d_authenticated_response']; + } + + /** + * Sets three_d_authenticated_response + * + * @param string|null $three_d_authenticated_response The raw 3DS authentication result from the card issuer. Example: N + * + * @return self + */ + public function setThreeDAuthenticatedResponse($three_d_authenticated_response) + { + if (is_null($three_d_authenticated_response)) { + throw new \InvalidArgumentException('non-nullable three_d_authenticated_response cannot be null'); + } + $this->container['three_d_authenticated_response'] = $three_d_authenticated_response; + + return $this; + } + + /** + * Gets three_d_offered + * + * @return string|null + */ + public function getThreeDOffered() + { + return $this->container['three_d_offered']; + } + + /** + * Sets three_d_offered + * + * @param string|null $three_d_offered A Boolean value indicating whether 3DS was offered for this payment. Example: true + * + * @return self + */ + public function setThreeDOffered($three_d_offered) + { + if (is_null($three_d_offered)) { + throw new \InvalidArgumentException('non-nullable three_d_offered cannot be null'); + } + $this->container['three_d_offered'] = $three_d_offered; + + return $this; + } + + /** + * Gets three_d_offered_response + * + * @return string|null + */ + public function getThreeDOfferedResponse() + { + return $this->container['three_d_offered_response']; + } + + /** + * Sets three_d_offered_response + * + * @param string|null $three_d_offered_response The raw enrollment result from the 3DS directory services of the card schemes. Example: Y + * + * @return self + */ + public function setThreeDOfferedResponse($three_d_offered_response) + { + if (is_null($three_d_offered_response)) { + throw new \InvalidArgumentException('non-nullable three_d_offered_response cannot be null'); + } + $this->container['three_d_offered_response'] = $three_d_offered_response; + + return $this; + } + + /** + * Gets three_ds_version + * + * @return string|null + */ + public function getThreeDsVersion() + { + return $this->container['three_ds_version']; + } + + /** + * Sets three_ds_version + * + * @param string|null $three_ds_version The 3D Secure 2 version. + * + * @return self + */ + public function setThreeDsVersion($three_ds_version) + { + if (is_null($three_ds_version)) { + throw new \InvalidArgumentException('non-nullable three_ds_version cannot be null'); + } + $this->container['three_ds_version'] = $three_ds_version; + + return $this; + } + + /** + * Gets visa_transaction_id + * + * @return string|null + */ + public function getVisaTransactionId() + { + return $this->container['visa_transaction_id']; + } + + /** + * Sets visa_transaction_id + * + * @param string|null $visa_transaction_id The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. + * + * @return self + */ + public function setVisaTransactionId($visa_transaction_id) + { + if (is_null($visa_transaction_id)) { + throw new \InvalidArgumentException('non-nullable visa_transaction_id cannot be null'); + } + $this->container['visa_transaction_id'] = $visa_transaction_id; + + return $this; + } + + /** + * Gets xid + * + * @return string|null + */ + public function getXid() + { + return $this->container['xid']; + } + + /** + * Sets xid + * + * @param string|null $xid The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. If you want to submit the xid in your 3D Secure 1 request, use the `mpiData.xid`, field. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= + * + * @return self + */ + public function setXid($xid) + { + if (is_null($xid)) { + throw new \InvalidArgumentException('non-nullable xid cannot be null'); + } + $this->container['xid'] = $xid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php new file mode 100644 index 000000000..c49572c0b --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.php @@ -0,0 +1,761 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalDataInstallments Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalDataInstallments implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataInstallments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'installment_payment_data_installment_type' => 'string', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'string', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'string', + 'installment_payment_data_option_item_nr_installment_fee' => 'string', + 'installment_payment_data_option_item_nr_interest_rate' => 'string', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'string', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'string', + 'installment_payment_data_option_item_nr_number_of_installments' => 'string', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'string', + 'installment_payment_data_option_item_nr_total_amount_due' => 'string', + 'installment_payment_data_payment_options' => 'string', + 'installments_value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'installment_payment_data_installment_type' => null, + 'installment_payment_data_option_item_nr_annual_percentage_rate' => null, + 'installment_payment_data_option_item_nr_first_installment_amount' => null, + 'installment_payment_data_option_item_nr_installment_fee' => null, + 'installment_payment_data_option_item_nr_interest_rate' => null, + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => null, + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => null, + 'installment_payment_data_option_item_nr_number_of_installments' => null, + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => null, + 'installment_payment_data_option_item_nr_total_amount_due' => null, + 'installment_payment_data_payment_options' => null, + 'installments_value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'installment_payment_data_installment_type' => false, + 'installment_payment_data_option_item_nr_annual_percentage_rate' => false, + 'installment_payment_data_option_item_nr_first_installment_amount' => false, + 'installment_payment_data_option_item_nr_installment_fee' => false, + 'installment_payment_data_option_item_nr_interest_rate' => false, + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => false, + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => false, + 'installment_payment_data_option_item_nr_number_of_installments' => false, + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => false, + 'installment_payment_data_option_item_nr_total_amount_due' => false, + 'installment_payment_data_payment_options' => false, + 'installments_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'installment_payment_data_installment_type' => 'installmentPaymentData.installmentType', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'installmentPaymentData.option[itemNr].annualPercentageRate', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'installmentPaymentData.option[itemNr].firstInstallmentAmount', + 'installment_payment_data_option_item_nr_installment_fee' => 'installmentPaymentData.option[itemNr].installmentFee', + 'installment_payment_data_option_item_nr_interest_rate' => 'installmentPaymentData.option[itemNr].interestRate', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'installmentPaymentData.option[itemNr].maximumNumberOfInstallments', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'installmentPaymentData.option[itemNr].minimumNumberOfInstallments', + 'installment_payment_data_option_item_nr_number_of_installments' => 'installmentPaymentData.option[itemNr].numberOfInstallments', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'installmentPaymentData.option[itemNr].subsequentInstallmentAmount', + 'installment_payment_data_option_item_nr_total_amount_due' => 'installmentPaymentData.option[itemNr].totalAmountDue', + 'installment_payment_data_payment_options' => 'installmentPaymentData.paymentOptions', + 'installments_value' => 'installments.value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'installment_payment_data_installment_type' => 'setInstallmentPaymentDataInstallmentType', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'setInstallmentPaymentDataOptionItemNrAnnualPercentageRate', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'setInstallmentPaymentDataOptionItemNrFirstInstallmentAmount', + 'installment_payment_data_option_item_nr_installment_fee' => 'setInstallmentPaymentDataOptionItemNrInstallmentFee', + 'installment_payment_data_option_item_nr_interest_rate' => 'setInstallmentPaymentDataOptionItemNrInterestRate', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'setInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments', + 'installment_payment_data_option_item_nr_number_of_installments' => 'setInstallmentPaymentDataOptionItemNrNumberOfInstallments', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'setInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount', + 'installment_payment_data_option_item_nr_total_amount_due' => 'setInstallmentPaymentDataOptionItemNrTotalAmountDue', + 'installment_payment_data_payment_options' => 'setInstallmentPaymentDataPaymentOptions', + 'installments_value' => 'setInstallmentsValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'installment_payment_data_installment_type' => 'getInstallmentPaymentDataInstallmentType', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'getInstallmentPaymentDataOptionItemNrAnnualPercentageRate', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'getInstallmentPaymentDataOptionItemNrFirstInstallmentAmount', + 'installment_payment_data_option_item_nr_installment_fee' => 'getInstallmentPaymentDataOptionItemNrInstallmentFee', + 'installment_payment_data_option_item_nr_interest_rate' => 'getInstallmentPaymentDataOptionItemNrInterestRate', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'getInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'getInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments', + 'installment_payment_data_option_item_nr_number_of_installments' => 'getInstallmentPaymentDataOptionItemNrNumberOfInstallments', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'getInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount', + 'installment_payment_data_option_item_nr_total_amount_due' => 'getInstallmentPaymentDataOptionItemNrTotalAmountDue', + 'installment_payment_data_payment_options' => 'getInstallmentPaymentDataPaymentOptions', + 'installments_value' => 'getInstallmentsValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('installment_payment_data_installment_type', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_annual_percentage_rate', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_first_installment_amount', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_installment_fee', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_interest_rate', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_maximum_number_of_installments', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_minimum_number_of_installments', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_number_of_installments', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_subsequent_installment_amount', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_total_amount_due', $data ?? [], null); + $this->setIfExists('installment_payment_data_payment_options', $data ?? [], null); + $this->setIfExists('installments_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 installment_payment_data_installment_type + * + * @return string|null + */ + public function getInstallmentPaymentDataInstallmentType() + { + return $this->container['installment_payment_data_installment_type']; + } + + /** + * Sets installment_payment_data_installment_type + * + * @param string|null $installment_payment_data_installment_type Type of installment. The value of `installmentType` should be **IssuerFinanced**. + * + * @return self + */ + public function setInstallmentPaymentDataInstallmentType($installment_payment_data_installment_type) + { + if (is_null($installment_payment_data_installment_type)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_installment_type cannot be null'); + } + $this->container['installment_payment_data_installment_type'] = $installment_payment_data_installment_type; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_annual_percentage_rate + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrAnnualPercentageRate() + { + return $this->container['installment_payment_data_option_item_nr_annual_percentage_rate']; + } + + /** + * Sets installment_payment_data_option_item_nr_annual_percentage_rate + * + * @param string|null $installment_payment_data_option_item_nr_annual_percentage_rate Annual interest rate. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrAnnualPercentageRate($installment_payment_data_option_item_nr_annual_percentage_rate) + { + if (is_null($installment_payment_data_option_item_nr_annual_percentage_rate)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_annual_percentage_rate cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_annual_percentage_rate'] = $installment_payment_data_option_item_nr_annual_percentage_rate; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_first_installment_amount + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrFirstInstallmentAmount() + { + return $this->container['installment_payment_data_option_item_nr_first_installment_amount']; + } + + /** + * Sets installment_payment_data_option_item_nr_first_installment_amount + * + * @param string|null $installment_payment_data_option_item_nr_first_installment_amount First Installment Amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrFirstInstallmentAmount($installment_payment_data_option_item_nr_first_installment_amount) + { + if (is_null($installment_payment_data_option_item_nr_first_installment_amount)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_first_installment_amount cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_first_installment_amount'] = $installment_payment_data_option_item_nr_first_installment_amount; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_installment_fee + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrInstallmentFee() + { + return $this->container['installment_payment_data_option_item_nr_installment_fee']; + } + + /** + * Sets installment_payment_data_option_item_nr_installment_fee + * + * @param string|null $installment_payment_data_option_item_nr_installment_fee Installment fee amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrInstallmentFee($installment_payment_data_option_item_nr_installment_fee) + { + if (is_null($installment_payment_data_option_item_nr_installment_fee)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_installment_fee cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_installment_fee'] = $installment_payment_data_option_item_nr_installment_fee; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_interest_rate + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrInterestRate() + { + return $this->container['installment_payment_data_option_item_nr_interest_rate']; + } + + /** + * Sets installment_payment_data_option_item_nr_interest_rate + * + * @param string|null $installment_payment_data_option_item_nr_interest_rate Interest rate for the installment period. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrInterestRate($installment_payment_data_option_item_nr_interest_rate) + { + if (is_null($installment_payment_data_option_item_nr_interest_rate)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_interest_rate cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_interest_rate'] = $installment_payment_data_option_item_nr_interest_rate; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_maximum_number_of_installments + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments() + { + return $this->container['installment_payment_data_option_item_nr_maximum_number_of_installments']; + } + + /** + * Sets installment_payment_data_option_item_nr_maximum_number_of_installments + * + * @param string|null $installment_payment_data_option_item_nr_maximum_number_of_installments Maximum number of installments possible for this payment. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments($installment_payment_data_option_item_nr_maximum_number_of_installments) + { + if (is_null($installment_payment_data_option_item_nr_maximum_number_of_installments)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_maximum_number_of_installments cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_maximum_number_of_installments'] = $installment_payment_data_option_item_nr_maximum_number_of_installments; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_minimum_number_of_installments + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments() + { + return $this->container['installment_payment_data_option_item_nr_minimum_number_of_installments']; + } + + /** + * Sets installment_payment_data_option_item_nr_minimum_number_of_installments + * + * @param string|null $installment_payment_data_option_item_nr_minimum_number_of_installments Minimum number of installments possible for this payment. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments($installment_payment_data_option_item_nr_minimum_number_of_installments) + { + if (is_null($installment_payment_data_option_item_nr_minimum_number_of_installments)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_minimum_number_of_installments cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_minimum_number_of_installments'] = $installment_payment_data_option_item_nr_minimum_number_of_installments; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_number_of_installments + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrNumberOfInstallments() + { + return $this->container['installment_payment_data_option_item_nr_number_of_installments']; + } + + /** + * Sets installment_payment_data_option_item_nr_number_of_installments + * + * @param string|null $installment_payment_data_option_item_nr_number_of_installments Total number of installments possible for this payment. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrNumberOfInstallments($installment_payment_data_option_item_nr_number_of_installments) + { + if (is_null($installment_payment_data_option_item_nr_number_of_installments)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_number_of_installments cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_number_of_installments'] = $installment_payment_data_option_item_nr_number_of_installments; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_subsequent_installment_amount + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount() + { + return $this->container['installment_payment_data_option_item_nr_subsequent_installment_amount']; + } + + /** + * Sets installment_payment_data_option_item_nr_subsequent_installment_amount + * + * @param string|null $installment_payment_data_option_item_nr_subsequent_installment_amount Subsequent Installment Amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount($installment_payment_data_option_item_nr_subsequent_installment_amount) + { + if (is_null($installment_payment_data_option_item_nr_subsequent_installment_amount)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_subsequent_installment_amount cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_subsequent_installment_amount'] = $installment_payment_data_option_item_nr_subsequent_installment_amount; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_total_amount_due + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrTotalAmountDue() + { + return $this->container['installment_payment_data_option_item_nr_total_amount_due']; + } + + /** + * Sets installment_payment_data_option_item_nr_total_amount_due + * + * @param string|null $installment_payment_data_option_item_nr_total_amount_due Total amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrTotalAmountDue($installment_payment_data_option_item_nr_total_amount_due) + { + if (is_null($installment_payment_data_option_item_nr_total_amount_due)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_total_amount_due cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_total_amount_due'] = $installment_payment_data_option_item_nr_total_amount_due; + + return $this; + } + + /** + * Gets installment_payment_data_payment_options + * + * @return string|null + */ + public function getInstallmentPaymentDataPaymentOptions() + { + return $this->container['installment_payment_data_payment_options']; + } + + /** + * Sets installment_payment_data_payment_options + * + * @param string|null $installment_payment_data_payment_options Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments + * + * @return self + */ + public function setInstallmentPaymentDataPaymentOptions($installment_payment_data_payment_options) + { + if (is_null($installment_payment_data_payment_options)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_payment_options cannot be null'); + } + $this->container['installment_payment_data_payment_options'] = $installment_payment_data_payment_options; + + return $this; + } + + /** + * Gets installments_value + * + * @return string|null + */ + public function getInstallmentsValue() + { + return $this->container['installments_value']; + } + + /** + * Sets installments_value + * + * @param string|null $installments_value The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. + * + * @return self + */ + public function setInstallmentsValue($installments_value) + { + if (is_null($installments_value)) { + throw new \InvalidArgumentException('non-nullable installments_value cannot be null'); + } + $this->container['installments_value'] = $installments_value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php new file mode 100644 index 000000000..11dcc5be0 --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalDataNetworkTokens Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalDataNetworkTokens implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataNetworkTokens'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'network_token_available' => 'string', + 'network_token_bin' => 'string', + 'network_token_token_summary' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'network_token_available' => null, + 'network_token_bin' => null, + 'network_token_token_summary' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'network_token_available' => false, + 'network_token_bin' => false, + 'network_token_token_summary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'network_token_available' => 'networkToken.available', + 'network_token_bin' => 'networkToken.bin', + 'network_token_token_summary' => 'networkToken.tokenSummary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'network_token_available' => 'setNetworkTokenAvailable', + 'network_token_bin' => 'setNetworkTokenBin', + 'network_token_token_summary' => 'setNetworkTokenTokenSummary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'network_token_available' => 'getNetworkTokenAvailable', + 'network_token_bin' => 'getNetworkTokenBin', + 'network_token_token_summary' => 'getNetworkTokenTokenSummary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('network_token_available', $data ?? [], null); + $this->setIfExists('network_token_bin', $data ?? [], null); + $this->setIfExists('network_token_token_summary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets network_token_available + * + * @return string|null + */ + public function getNetworkTokenAvailable() + { + return $this->container['network_token_available']; + } + + /** + * Sets network_token_available + * + * @param string|null $network_token_available Indicates whether a network token is available for the specified card. + * + * @return self + */ + public function setNetworkTokenAvailable($network_token_available) + { + if (is_null($network_token_available)) { + throw new \InvalidArgumentException('non-nullable network_token_available cannot be null'); + } + $this->container['network_token_available'] = $network_token_available; + + return $this; + } + + /** + * Gets network_token_bin + * + * @return string|null + */ + public function getNetworkTokenBin() + { + return $this->container['network_token_bin']; + } + + /** + * Sets network_token_bin + * + * @param string|null $network_token_bin The Bank Identification Number of a tokenized card, which is the first six digits of a card number. + * + * @return self + */ + public function setNetworkTokenBin($network_token_bin) + { + if (is_null($network_token_bin)) { + throw new \InvalidArgumentException('non-nullable network_token_bin cannot be null'); + } + $this->container['network_token_bin'] = $network_token_bin; + + return $this; + } + + /** + * Gets network_token_token_summary + * + * @return string|null + */ + public function getNetworkTokenTokenSummary() + { + return $this->container['network_token_token_summary']; + } + + /** + * Sets network_token_token_summary + * + * @param string|null $network_token_token_summary The last four digits of a network token. + * + * @return self + */ + public function setNetworkTokenTokenSummary($network_token_token_summary) + { + if (is_null($network_token_token_summary)) { + throw new \InvalidArgumentException('non-nullable network_token_token_summary cannot be null'); + } + $this->container['network_token_token_summary'] = $network_token_token_summary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php new file mode 100644 index 000000000..72d935704 --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataOpi.php @@ -0,0 +1,387 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalDataOpi Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalDataOpi implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataOpi'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'opi_trans_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'opi_trans_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'opi_trans_token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'opi_trans_token' => 'opi.transToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'opi_trans_token' => 'setOpiTransToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'opi_trans_token' => 'getOpiTransToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('opi_trans_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets opi_trans_token + * + * @return string|null + */ + public function getOpiTransToken() + { + return $this->container['opi_trans_token']; + } + + /** + * Sets opi_trans_token + * + * @param string|null $opi_trans_token Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + * + * @return self + */ + public function setOpiTransToken($opi_trans_token) + { + if (is_null($opi_trans_token)) { + throw new \InvalidArgumentException('non-nullable opi_trans_token cannot be null'); + } + $this->container['opi_trans_token'] = $opi_trans_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php b/src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php new file mode 100644 index 000000000..374d1f363 --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponseAdditionalDataSepa.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponseAdditionalDataSepa Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponseAdditionalDataSepa implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataSepa'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sepadirectdebit_date_of_signature' => 'string', + 'sepadirectdebit_mandate_id' => 'string', + 'sepadirectdebit_sequence_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sepadirectdebit_date_of_signature' => null, + 'sepadirectdebit_mandate_id' => null, + 'sepadirectdebit_sequence_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sepadirectdebit_date_of_signature' => false, + 'sepadirectdebit_mandate_id' => false, + 'sepadirectdebit_sequence_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sepadirectdebit_date_of_signature' => 'sepadirectdebit.dateOfSignature', + 'sepadirectdebit_mandate_id' => 'sepadirectdebit.mandateId', + 'sepadirectdebit_sequence_type' => 'sepadirectdebit.sequenceType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sepadirectdebit_date_of_signature' => 'setSepadirectdebitDateOfSignature', + 'sepadirectdebit_mandate_id' => 'setSepadirectdebitMandateId', + 'sepadirectdebit_sequence_type' => 'setSepadirectdebitSequenceType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sepadirectdebit_date_of_signature' => 'getSepadirectdebitDateOfSignature', + 'sepadirectdebit_mandate_id' => 'getSepadirectdebitMandateId', + 'sepadirectdebit_sequence_type' => 'getSepadirectdebitSequenceType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('sepadirectdebit_date_of_signature', $data ?? [], null); + $this->setIfExists('sepadirectdebit_mandate_id', $data ?? [], null); + $this->setIfExists('sepadirectdebit_sequence_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sepadirectdebit_date_of_signature + * + * @return string|null + */ + public function getSepadirectdebitDateOfSignature() + { + return $this->container['sepadirectdebit_date_of_signature']; + } + + /** + * Sets sepadirectdebit_date_of_signature + * + * @param string|null $sepadirectdebit_date_of_signature The transaction signature date. Format: yyyy-MM-dd + * + * @return self + */ + public function setSepadirectdebitDateOfSignature($sepadirectdebit_date_of_signature) + { + if (is_null($sepadirectdebit_date_of_signature)) { + throw new \InvalidArgumentException('non-nullable sepadirectdebit_date_of_signature cannot be null'); + } + $this->container['sepadirectdebit_date_of_signature'] = $sepadirectdebit_date_of_signature; + + return $this; + } + + /** + * Gets sepadirectdebit_mandate_id + * + * @return string|null + */ + public function getSepadirectdebitMandateId() + { + return $this->container['sepadirectdebit_mandate_id']; + } + + /** + * Sets sepadirectdebit_mandate_id + * + * @param string|null $sepadirectdebit_mandate_id Its value corresponds to the pspReference value of the transaction. + * + * @return self + */ + public function setSepadirectdebitMandateId($sepadirectdebit_mandate_id) + { + if (is_null($sepadirectdebit_mandate_id)) { + throw new \InvalidArgumentException('non-nullable sepadirectdebit_mandate_id cannot be null'); + } + $this->container['sepadirectdebit_mandate_id'] = $sepadirectdebit_mandate_id; + + return $this; + } + + /** + * Gets sepadirectdebit_sequence_type + * + * @return string|null + */ + public function getSepadirectdebitSequenceType() + { + return $this->container['sepadirectdebit_sequence_type']; + } + + /** + * Sets sepadirectdebit_sequence_type + * + * @param string|null $sepadirectdebit_sequence_type This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF + * + * @return self + */ + public function setSepadirectdebitSequenceType($sepadirectdebit_sequence_type) + { + if (is_null($sepadirectdebit_sequence_type)) { + throw new \InvalidArgumentException('non-nullable sepadirectdebit_sequence_type cannot be null'); + } + $this->container['sepadirectdebit_sequence_type'] = $sepadirectdebit_sequence_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ResponsePaymentMethod.php b/src/Adyen/Model/Checkout/ResponsePaymentMethod.php new file mode 100644 index 000000000..616d3ffc5 --- /dev/null +++ b/src/Adyen/Model/Checkout/ResponsePaymentMethod.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ResponsePaymentMethod Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ResponsePaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponsePaymentMethod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brand' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brand' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brand' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brand' => 'brand', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brand' => 'setBrand', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brand' => 'getBrand', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The `paymentMethod.type` value used in the request. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/RiskData.php b/src/Adyen/Model/Checkout/RiskData.php new file mode 100644 index 000000000..e590f464f --- /dev/null +++ b/src/Adyen/Model/Checkout/RiskData.php @@ -0,0 +1,487 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * RiskData Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class RiskData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RiskData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'client_data' => 'string', + 'custom_fields' => 'array', + 'fraud_offset' => 'int', + 'profile_reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'client_data' => null, + 'custom_fields' => null, + 'fraud_offset' => 'int32', + 'profile_reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'client_data' => false, + 'custom_fields' => false, + 'fraud_offset' => true, + 'profile_reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'client_data' => 'clientData', + 'custom_fields' => 'customFields', + 'fraud_offset' => 'fraudOffset', + 'profile_reference' => 'profileReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'client_data' => 'setClientData', + 'custom_fields' => 'setCustomFields', + 'fraud_offset' => 'setFraudOffset', + 'profile_reference' => 'setProfileReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'client_data' => 'getClientData', + 'custom_fields' => 'getCustomFields', + 'fraud_offset' => 'getFraudOffset', + 'profile_reference' => 'getProfileReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('client_data', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('profile_reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets client_data + * + * @return string|null + */ + public function getClientData() + { + return $this->container['client_data']; + } + + /** + * Sets client_data + * + * @param string|null $client_data Contains client-side data, like the device fingerprint, cookies, and specific browser settings. + * + * @return self + */ + public function setClientData($client_data) + { + if (is_null($client_data)) { + throw new \InvalidArgumentException('non-nullable client_data cannot be null'); + } + $this->container['client_data'] = $client_data; + + return $this; + } + + /** + * Gets custom_fields + * + * @return array|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param array|null $custom_fields Any custom fields used as part of the input to configured risk rules. + * + * @return self + */ + public function setCustomFields($custom_fields) + { + if (is_null($custom_fields)) { + throw new \InvalidArgumentException('non-nullable custom_fields cannot be null'); + } + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets profile_reference + * + * @return string|null + */ + public function getProfileReference() + { + return $this->container['profile_reference']; + } + + /** + * Sets profile_reference + * + * @param string|null $profile_reference The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. + * + * @return self + */ + public function setProfileReference($profile_reference) + { + if (is_null($profile_reference)) { + throw new \InvalidArgumentException('non-nullable profile_reference cannot be null'); + } + $this->container['profile_reference'] = $profile_reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/SDKEphemPubKey.php b/src/Adyen/Model/Checkout/SDKEphemPubKey.php new file mode 100644 index 000000000..bab451e14 --- /dev/null +++ b/src/Adyen/Model/Checkout/SDKEphemPubKey.php @@ -0,0 +1,489 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * SDKEphemPubKey Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class SDKEphemPubKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SDKEphemPubKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'crv' => 'string', + 'kty' => 'string', + 'x' => 'string', + 'y' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'crv' => null, + 'kty' => null, + 'x' => null, + 'y' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'crv' => false, + 'kty' => false, + 'x' => false, + 'y' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'crv' => 'crv', + 'kty' => 'kty', + 'x' => 'x', + 'y' => 'y' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'crv' => 'setCrv', + 'kty' => 'setKty', + 'x' => 'setX', + 'y' => 'setY' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'crv' => 'getCrv', + 'kty' => 'getKty', + 'x' => 'getX', + 'y' => 'getY' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('crv', $data ?? [], null); + $this->setIfExists('kty', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets crv + * + * @return string|null + */ + public function getCrv() + { + return $this->container['crv']; + } + + /** + * Sets crv + * + * @param string|null $crv The `crv` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setCrv($crv) + { + if (is_null($crv)) { + throw new \InvalidArgumentException('non-nullable crv cannot be null'); + } + $this->container['crv'] = $crv; + + return $this; + } + + /** + * Gets kty + * + * @return string|null + */ + public function getKty() + { + return $this->container['kty']; + } + + /** + * Sets kty + * + * @param string|null $kty The `kty` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setKty($kty) + { + if (is_null($kty)) { + throw new \InvalidArgumentException('non-nullable kty cannot be null'); + } + $this->container['kty'] = $kty; + + return $this; + } + + /** + * Gets x + * + * @return string|null + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param string|null $x The `x` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets y + * + * @return string|null + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param string|null $y The `y` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/SamsungPayDetails.php b/src/Adyen/Model/Checkout/SamsungPayDetails.php new file mode 100644 index 000000000..ae3416791 --- /dev/null +++ b/src/Adyen/Model/Checkout/SamsungPayDetails.php @@ -0,0 +1,624 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * SamsungPayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class SamsungPayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SamsungPayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'funding_source' => 'string', + 'recurring_detail_reference' => 'string', + 'samsung_pay_token' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'funding_source' => null, + 'recurring_detail_reference' => null, + 'samsung_pay_token' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'funding_source' => false, + 'recurring_detail_reference' => false, + 'samsung_pay_token' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'funding_source' => 'fundingSource', + 'recurring_detail_reference' => 'recurringDetailReference', + 'samsung_pay_token' => 'samsungPayToken', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'funding_source' => 'setFundingSource', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'samsung_pay_token' => 'setSamsungPayToken', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'funding_source' => 'getFundingSource', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'samsung_pay_token' => 'getSamsungPayToken', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_SAMSUNGPAY = 'samsungpay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SAMSUNGPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('samsung_pay_token', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'samsungpay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['samsung_pay_token'] === null) { + $invalidProperties[] = "'samsung_pay_token' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets samsung_pay_token + * + * @return string + */ + public function getSamsungPayToken() + { + return $this->container['samsung_pay_token']; + } + + /** + * Sets samsung_pay_token + * + * @param string $samsung_pay_token The payload you received from the Samsung Pay SDK response. + * + * @return self + */ + public function setSamsungPayToken($samsung_pay_token) + { + if (is_null($samsung_pay_token)) { + throw new \InvalidArgumentException('non-nullable samsung_pay_token cannot be null'); + } + $this->container['samsung_pay_token'] = $samsung_pay_token; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **samsungpay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php b/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php new file mode 100644 index 000000000..da1d611d4 --- /dev/null +++ b/src/Adyen/Model/Checkout/SepaDirectDebitDetails.php @@ -0,0 +1,598 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * SepaDirectDebitDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class SepaDirectDebitDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SepaDirectDebitDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'iban' => 'string', + 'owner_name' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'iban' => null, + 'owner_name' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'iban' => false, + 'owner_name' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'iban' => 'iban', + 'owner_name' => 'ownerName', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'iban' => 'setIban', + 'owner_name' => 'setOwnerName', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'iban' => 'getIban', + 'owner_name' => 'getOwnerName', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SEPADIRECTDEBIT = 'sepadirectdebit'; + public const TYPE_SEPADIRECTDEBIT_AMAZONPAY = 'sepadirectdebit_amazonpay'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SEPADIRECTDEBIT, + self::TYPE_SEPADIRECTDEBIT_AMAZONPAY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'sepadirectdebit'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } + if ($this->container['owner_name'] === null) { + $invalidProperties[] = "'owner_name' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string $iban The International Bank Account Number (IBAN). + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets owner_name + * + * @return string + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string $owner_name The name of the bank account holder. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **sepadirectdebit** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ServiceError.php b/src/Adyen/Model/Checkout/ServiceError.php new file mode 100644 index 000000000..a01ba55ee --- /dev/null +++ b/src/Adyen/Model/Checkout/ServiceError.php @@ -0,0 +1,555 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ServiceError Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ServiceError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ServiceError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'error_code' => 'string', + 'error_type' => 'string', + 'message' => 'string', + 'psp_reference' => 'string', + 'status' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'error_code' => null, + 'error_type' => null, + 'message' => null, + 'psp_reference' => null, + 'status' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'error_code' => false, + 'error_type' => false, + 'message' => false, + 'psp_reference' => false, + 'status' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'error_code' => 'errorCode', + 'error_type' => 'errorType', + 'message' => 'message', + 'psp_reference' => 'pspReference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'error_code' => 'setErrorCode', + 'error_type' => 'setErrorType', + 'message' => 'setMessage', + 'psp_reference' => 'setPspReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'error_code' => 'getErrorCode', + 'error_type' => 'getErrorType', + 'message' => 'getMessage', + 'psp_reference' => 'getPspReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('error_type', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets error_code + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['error_code']; + } + + /** + * Sets error_code + * + * @param string|null $error_code The error code mapped to the error message. + * + * @return self + */ + public function setErrorCode($error_code) + { + if (is_null($error_code)) { + throw new \InvalidArgumentException('non-nullable error_code cannot be null'); + } + $this->container['error_code'] = $error_code; + + return $this; + } + + /** + * Gets error_type + * + * @return string|null + */ + public function getErrorType() + { + return $this->container['error_type']; + } + + /** + * Sets error_type + * + * @param string|null $error_type The category of the error. + * + * @return self + */ + public function setErrorType($error_type) + { + if (is_null($error_type)) { + throw new \InvalidArgumentException('non-nullable error_type cannot be null'); + } + $this->container['error_type'] = $error_type; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A short explanation of the issue. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference The PSP reference of the payment. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP response status. + * + * @return self + */ + public function setStatus($status) + { + // Do nothing for nullable integers + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ServiceError2.php b/src/Adyen/Model/Checkout/ServiceError2.php new file mode 100644 index 000000000..8febf75a3 --- /dev/null +++ b/src/Adyen/Model/Checkout/ServiceError2.php @@ -0,0 +1,489 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ServiceError2 Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ServiceError2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ServiceError-2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error_code' => 'string', + 'error_type' => 'string', + 'message' => 'string', + 'psp_reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error_code' => null, + 'error_type' => null, + 'message' => null, + 'psp_reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'error_code' => false, + 'error_type' => false, + 'message' => false, + 'psp_reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error_code' => 'errorCode', + 'error_type' => 'errorType', + 'message' => 'message', + 'psp_reference' => 'pspReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error_code' => 'setErrorCode', + 'error_type' => 'setErrorType', + 'message' => 'setMessage', + 'psp_reference' => 'setPspReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error_code' => 'getErrorCode', + 'error_type' => 'getErrorType', + 'message' => 'getMessage', + 'psp_reference' => 'getPspReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('error_type', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error_code + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['error_code']; + } + + /** + * Sets error_code + * + * @param string|null $error_code error_code + * + * @return self + */ + public function setErrorCode($error_code) + { + if (is_null($error_code)) { + throw new \InvalidArgumentException('non-nullable error_code cannot be null'); + } + $this->container['error_code'] = $error_code; + + return $this; + } + + /** + * Gets error_type + * + * @return string|null + */ + public function getErrorType() + { + return $this->container['error_type']; + } + + /** + * Sets error_type + * + * @param string|null $error_type error_type + * + * @return self + */ + public function setErrorType($error_type) + { + if (is_null($error_type)) { + throw new \InvalidArgumentException('non-nullable error_type cannot be null'); + } + $this->container['error_type'] = $error_type; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference psp_reference + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ShopperInput.php b/src/Adyen/Model/Checkout/ShopperInput.php new file mode 100644 index 000000000..854148afc --- /dev/null +++ b/src/Adyen/Model/Checkout/ShopperInput.php @@ -0,0 +1,560 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ShopperInput Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ShopperInput implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShopperInput'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address' => 'string', + 'delivery_address' => 'string', + 'personal_details' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address' => null, + 'delivery_address' => null, + 'personal_details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address' => false, + 'delivery_address' => false, + 'personal_details' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address' => 'billingAddress', + 'delivery_address' => 'deliveryAddress', + 'personal_details' => 'personalDetails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address' => 'setBillingAddress', + 'delivery_address' => 'setDeliveryAddress', + 'personal_details' => 'setPersonalDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address' => 'getBillingAddress', + 'delivery_address' => 'getDeliveryAddress', + 'personal_details' => 'getPersonalDetails' + ]; + + /** + * 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 BILLING_ADDRESS_EDITABLE = 'editable'; + public const BILLING_ADDRESS_HIDDEN = 'hidden'; + public const BILLING_ADDRESS_READ_ONLY = 'readOnly'; + public const DELIVERY_ADDRESS_EDITABLE = 'editable'; + public const DELIVERY_ADDRESS_HIDDEN = 'hidden'; + public const DELIVERY_ADDRESS_READ_ONLY = 'readOnly'; + public const PERSONAL_DETAILS_EDITABLE = 'editable'; + public const PERSONAL_DETAILS_HIDDEN = 'hidden'; + public const PERSONAL_DETAILS_READ_ONLY = 'readOnly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBillingAddressAllowableValues() + { + return [ + self::BILLING_ADDRESS_EDITABLE, + self::BILLING_ADDRESS_HIDDEN, + self::BILLING_ADDRESS_READ_ONLY, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeliveryAddressAllowableValues() + { + return [ + self::DELIVERY_ADDRESS_EDITABLE, + self::DELIVERY_ADDRESS_HIDDEN, + self::DELIVERY_ADDRESS_READ_ONLY, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPersonalDetailsAllowableValues() + { + return [ + self::PERSONAL_DETAILS_EDITABLE, + self::PERSONAL_DETAILS_HIDDEN, + self::PERSONAL_DETAILS_READ_ONLY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('personal_details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getBillingAddressAllowableValues(); + if (!is_null($this->container['billing_address']) && !in_array($this->container['billing_address'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'billing_address', must be one of '%s'", + $this->container['billing_address'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDeliveryAddressAllowableValues(); + if (!is_null($this->container['delivery_address']) && !in_array($this->container['delivery_address'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'delivery_address', must be one of '%s'", + $this->container['delivery_address'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPersonalDetailsAllowableValues(); + if (!is_null($this->container['personal_details']) && !in_array($this->container['personal_details'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'personal_details', must be one of '%s'", + $this->container['personal_details'], + 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 billing_address + * + * @return string|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param string|null $billing_address Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $allowedValues = $this->getBillingAddressAllowableValues(); + if (!in_array($billing_address, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'billing_address', must be one of '%s'", + $billing_address, + implode("', '", $allowedValues) + ) + ); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets delivery_address + * + * @return string|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param string|null $delivery_address Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $allowedValues = $this->getDeliveryAddressAllowableValues(); + if (!in_array($delivery_address, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'delivery_address', must be one of '%s'", + $delivery_address, + implode("', '", $allowedValues) + ) + ); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets personal_details + * + * @return string|null + */ + public function getPersonalDetails() + { + return $this->container['personal_details']; + } + + /** + * Sets personal_details + * + * @param string|null $personal_details Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly + * + * @return self + */ + public function setPersonalDetails($personal_details) + { + if (is_null($personal_details)) { + throw new \InvalidArgumentException('non-nullable personal_details cannot be null'); + } + $allowedValues = $this->getPersonalDetailsAllowableValues(); + if (!in_array($personal_details, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'personal_details', must be one of '%s'", + $personal_details, + implode("', '", $allowedValues) + ) + ); + } + $this->container['personal_details'] = $personal_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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/ShopperInteractionDevice.php b/src/Adyen/Model/Checkout/ShopperInteractionDevice.php new file mode 100644 index 000000000..cb1320e9f --- /dev/null +++ b/src/Adyen/Model/Checkout/ShopperInteractionDevice.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ShopperInteractionDevice Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ShopperInteractionDevice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShopperInteractionDevice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'locale' => 'string', + 'os' => 'string', + 'os_version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'locale' => null, + 'os' => null, + 'os_version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'locale' => false, + 'os' => false, + 'os_version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'locale' => 'locale', + 'os' => 'os', + 'os_version' => 'osVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'locale' => 'setLocale', + 'os' => 'setOs', + 'os_version' => 'setOsVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'locale' => 'getLocale', + 'os' => 'getOs', + 'os_version' => 'getOsVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('os', $data ?? [], null); + $this->setIfExists('os_version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale Locale on the shopper interaction device. + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets os + * + * @return string|null + */ + public function getOs() + { + return $this->container['os']; + } + + /** + * Sets os + * + * @param string|null $os Operating system running on the shopper interaction device. + * + * @return self + */ + public function setOs($os) + { + if (is_null($os)) { + throw new \InvalidArgumentException('non-nullable os cannot be null'); + } + $this->container['os'] = $os; + + return $this; + } + + /** + * Gets os_version + * + * @return string|null + */ + public function getOsVersion() + { + return $this->container['os_version']; + } + + /** + * Sets os_version + * + * @param string|null $os_version Version of the operating system on the shopper interaction device. + * + * @return self + */ + public function setOsVersion($os_version) + { + if (is_null($os_version)) { + throw new \InvalidArgumentException('non-nullable os_version cannot be null'); + } + $this->container['os_version'] = $os_version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/Split.php b/src/Adyen/Model/Checkout/Split.php new file mode 100644 index 000000000..23ebc01ad --- /dev/null +++ b/src/Adyen/Model/Checkout/Split.php @@ -0,0 +1,578 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * Split Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class Split implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Split'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account' => 'string', + 'amount' => '\Adyen\Model\Checkout\SplitAmount', + 'description' => 'string', + 'reference' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account' => null, + 'amount' => null, + 'description' => null, + 'reference' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account' => false, + 'amount' => false, + 'description' => false, + 'reference' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'amount' => 'amount', + 'description' => 'description', + 'reference' => 'reference', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'amount' => 'setAmount', + 'description' => 'setDescription', + 'reference' => 'setReference', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'amount' => 'getAmount', + 'description' => 'getDescription', + 'reference' => 'getReference', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BALANCE_ACCOUNT = 'BalanceAccount'; + public const TYPE_COMMISSION = 'Commission'; + public const TYPE__DEFAULT = 'Default'; + public const TYPE_MARKET_PLACE = 'MarketPlace'; + public const TYPE_PAYMENT_FEE = 'PaymentFee'; + public const TYPE_REMAINDER = 'Remainder'; + public const TYPE_SURCHARGE = 'Surcharge'; + public const TYPE_TIP = 'Tip'; + public const TYPE_VAT = 'VAT'; + public const TYPE_VERIFICATION = 'Verification'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_ACCOUNT, + self::TYPE_COMMISSION, + self::TYPE__DEFAULT, + self::TYPE_MARKET_PLACE, + self::TYPE_PAYMENT_FEE, + self::TYPE_REMAINDER, + self::TYPE_SURCHARGE, + self::TYPE_TIP, + self::TYPE_VAT, + self::TYPE_VERIFICATION, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account + * + * @return string|null + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param string|null $account Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. + * + * @return self + */ + public function setAccount($account) + { + if (is_null($account)) { + throw new \InvalidArgumentException('non-nullable account cannot be null'); + } + $this->container['account'] = $account; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Checkout\SplitAmount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Checkout\SplitAmount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of this split. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/SplitAmount.php b/src/Adyen/Model/Checkout/SplitAmount.php new file mode 100644 index 000000000..7a68e136d --- /dev/null +++ b/src/Adyen/Model/Checkout/SplitAmount.php @@ -0,0 +1,424 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * SplitAmount Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class SplitAmount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SplitAmount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/StandalonePaymentCancelResource.php b/src/Adyen/Model/Checkout/StandalonePaymentCancelResource.php new file mode 100644 index 000000000..d573540ed --- /dev/null +++ b/src/Adyen/Model/Checkout/StandalonePaymentCancelResource.php @@ -0,0 +1,566 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * StandalonePaymentCancelResource Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class StandalonePaymentCancelResource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StandalonePaymentCancelResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'payment_reference' => 'string', + 'psp_reference' => 'string', + 'reference' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'payment_reference' => null, + 'psp_reference' => null, + 'reference' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'payment_reference' => false, + 'psp_reference' => false, + 'reference' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'payment_reference' => 'paymentReference', + 'psp_reference' => 'pspReference', + 'reference' => 'reference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'payment_reference' => 'setPaymentReference', + 'psp_reference' => 'setPspReference', + 'reference' => 'setReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'payment_reference' => 'getPaymentReference', + 'psp_reference' => 'getPspReference', + 'reference' => 'getReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_RECEIVED = 'received'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('payment_reference', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['payment_reference'] === null) { + $invalidProperties[] = "'payment_reference' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets payment_reference + * + * @return string + */ + public function getPaymentReference() + { + return $this->container['payment_reference']; + } + + /** + * Sets payment_reference + * + * @param string $payment_reference The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. + * + * @return self + */ + public function setPaymentReference($payment_reference) + { + if (is_null($payment_reference)) { + throw new \InvalidArgumentException('non-nullable payment_reference cannot be null'); + } + $this->container['payment_reference'] = $payment_reference; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference Adyen's 16-character reference associated with the cancel request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the cancel request. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of your request. This will always have the value **received**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/StoredDetails.php b/src/Adyen/Model/Checkout/StoredDetails.php new file mode 100644 index 000000000..f1abf2d75 --- /dev/null +++ b/src/Adyen/Model/Checkout/StoredDetails.php @@ -0,0 +1,455 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * StoredDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class StoredDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoredDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank' => '\Adyen\Model\Checkout\BankAccount', + 'card' => '\Adyen\Model\Checkout\Card', + 'email_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank' => null, + 'card' => null, + 'email_address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank' => false, + 'card' => false, + 'email_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bank' => 'bank', + 'card' => 'card', + 'email_address' => 'emailAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank' => 'setBank', + 'card' => 'setCard', + 'email_address' => 'setEmailAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank' => 'getBank', + 'card' => 'getCard', + 'email_address' => 'getEmailAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bank', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank + * + * @return \Adyen\Model\Checkout\BankAccount|null + */ + public function getBank() + { + return $this->container['bank']; + } + + /** + * Sets bank + * + * @param \Adyen\Model\Checkout\BankAccount|null $bank bank + * + * @return self + */ + public function setBank($bank) + { + if (is_null($bank)) { + throw new \InvalidArgumentException('non-nullable bank cannot be null'); + } + $this->container['bank'] = $bank; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\Checkout\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\Checkout\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + 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 associated with stored payment details. + * + * @return self + */ + public function setEmailAddress($email_address) + { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } + $this->container['email_address'] = $email_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethod.php b/src/Adyen/Model/Checkout/StoredPaymentMethod.php new file mode 100644 index 000000000..d30fee8a6 --- /dev/null +++ b/src/Adyen/Model/Checkout/StoredPaymentMethod.php @@ -0,0 +1,829 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * StoredPaymentMethod Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class StoredPaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoredPaymentMethod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brand' => 'string', + 'expiry_month' => 'string', + 'expiry_year' => 'string', + 'holder_name' => 'string', + 'iban' => 'string', + 'id' => 'string', + 'last_four' => 'string', + 'name' => 'string', + 'network_tx_reference' => 'string', + 'owner_name' => 'string', + 'shopper_email' => 'string', + 'supported_recurring_processing_models' => 'string[]', + 'supported_shopper_interactions' => 'string[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brand' => null, + 'expiry_month' => null, + 'expiry_year' => null, + 'holder_name' => null, + 'iban' => null, + 'id' => null, + 'last_four' => null, + 'name' => null, + 'network_tx_reference' => null, + 'owner_name' => null, + 'shopper_email' => null, + 'supported_recurring_processing_models' => null, + 'supported_shopper_interactions' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brand' => false, + 'expiry_month' => false, + 'expiry_year' => false, + 'holder_name' => false, + 'iban' => false, + 'id' => false, + 'last_four' => false, + 'name' => false, + 'network_tx_reference' => false, + 'owner_name' => false, + 'shopper_email' => false, + 'supported_recurring_processing_models' => false, + 'supported_shopper_interactions' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brand' => 'brand', + 'expiry_month' => 'expiryMonth', + 'expiry_year' => 'expiryYear', + 'holder_name' => 'holderName', + 'iban' => 'iban', + 'id' => 'id', + 'last_four' => 'lastFour', + 'name' => 'name', + 'network_tx_reference' => 'networkTxReference', + 'owner_name' => 'ownerName', + 'shopper_email' => 'shopperEmail', + 'supported_recurring_processing_models' => 'supportedRecurringProcessingModels', + 'supported_shopper_interactions' => 'supportedShopperInteractions', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brand' => 'setBrand', + 'expiry_month' => 'setExpiryMonth', + 'expiry_year' => 'setExpiryYear', + 'holder_name' => 'setHolderName', + 'iban' => 'setIban', + 'id' => 'setId', + 'last_four' => 'setLastFour', + 'name' => 'setName', + 'network_tx_reference' => 'setNetworkTxReference', + 'owner_name' => 'setOwnerName', + 'shopper_email' => 'setShopperEmail', + 'supported_recurring_processing_models' => 'setSupportedRecurringProcessingModels', + 'supported_shopper_interactions' => 'setSupportedShopperInteractions', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brand' => 'getBrand', + 'expiry_month' => 'getExpiryMonth', + 'expiry_year' => 'getExpiryYear', + 'holder_name' => 'getHolderName', + 'iban' => 'getIban', + 'id' => 'getId', + 'last_four' => 'getLastFour', + 'name' => 'getName', + 'network_tx_reference' => 'getNetworkTxReference', + 'owner_name' => 'getOwnerName', + 'shopper_email' => 'getShopperEmail', + 'supported_recurring_processing_models' => 'getSupportedRecurringProcessingModels', + 'supported_shopper_interactions' => 'getSupportedShopperInteractions', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('expiry_month', $data ?? [], null); + $this->setIfExists('expiry_year', $data ?? [], null); + $this->setIfExists('holder_name', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('last_four', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('network_tx_reference', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('supported_recurring_processing_models', $data ?? [], null); + $this->setIfExists('supported_shopper_interactions', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand The brand of the card. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets expiry_month + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiry_month']; + } + + /** + * Sets expiry_month + * + * @param string|null $expiry_month The month the card expires. + * + * @return self + */ + public function setExpiryMonth($expiry_month) + { + if (is_null($expiry_month)) { + throw new \InvalidArgumentException('non-nullable expiry_month cannot be null'); + } + $this->container['expiry_month'] = $expiry_month; + + return $this; + } + + /** + * Gets expiry_year + * + * @return string|null + */ + public function getExpiryYear() + { + return $this->container['expiry_year']; + } + + /** + * Sets expiry_year + * + * @param string|null $expiry_year The last two digits of the year the card expires. For example, **22** for the year 2022. + * + * @return self + */ + public function setExpiryYear($expiry_year) + { + if (is_null($expiry_year)) { + throw new \InvalidArgumentException('non-nullable expiry_year cannot be null'); + } + $this->container['expiry_year'] = $expiry_year; + + return $this; + } + + /** + * Gets holder_name + * + * @return string|null + */ + public function getHolderName() + { + return $this->container['holder_name']; + } + + /** + * Sets holder_name + * + * @param string|null $holder_name The unique payment method code. + * + * @return self + */ + public function setHolderName($holder_name) + { + if (is_null($holder_name)) { + throw new \InvalidArgumentException('non-nullable holder_name cannot be null'); + } + $this->container['holder_name'] = $holder_name; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban The IBAN of the bank account. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id A unique identifier of this stored payment method. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets last_four + * + * @return string|null + */ + public function getLastFour() + { + return $this->container['last_four']; + } + + /** + * Sets last_four + * + * @param string|null $last_four The last four digits of the PAN. + * + * @return self + */ + public function setLastFour($last_four) + { + if (is_null($last_four)) { + throw new \InvalidArgumentException('non-nullable last_four cannot be null'); + } + $this->container['last_four'] = $last_four; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The display name of the stored payment method. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets network_tx_reference + * + * @return string|null + */ + public function getNetworkTxReference() + { + return $this->container['network_tx_reference']; + } + + /** + * Sets network_tx_reference + * + * @param string|null $network_tx_reference Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + * + * @return self + */ + public function setNetworkTxReference($network_tx_reference) + { + if (is_null($network_tx_reference)) { + throw new \InvalidArgumentException('non-nullable network_tx_reference cannot be null'); + } + $this->container['network_tx_reference'] = $network_tx_reference; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the bank account holder. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper’s email address. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets supported_recurring_processing_models + * + * @return string[]|null + */ + public function getSupportedRecurringProcessingModels() + { + return $this->container['supported_recurring_processing_models']; + } + + /** + * Sets supported_recurring_processing_models + * + * @param string[]|null $supported_recurring_processing_models The supported recurring processing models for this stored payment method. + * + * @return self + */ + public function setSupportedRecurringProcessingModels($supported_recurring_processing_models) + { + if (is_null($supported_recurring_processing_models)) { + throw new \InvalidArgumentException('non-nullable supported_recurring_processing_models cannot be null'); + } + $this->container['supported_recurring_processing_models'] = $supported_recurring_processing_models; + + return $this; + } + + /** + * Gets supported_shopper_interactions + * + * @return string[]|null + */ + public function getSupportedShopperInteractions() + { + return $this->container['supported_shopper_interactions']; + } + + /** + * Sets supported_shopper_interactions + * + * @param string[]|null $supported_shopper_interactions The supported shopper interactions for this stored payment method. + * + * @return self + */ + public function setSupportedShopperInteractions($supported_shopper_interactions) + { + if (is_null($supported_shopper_interactions)) { + throw new \InvalidArgumentException('non-nullable supported_shopper_interactions cannot be null'); + } + $this->container['supported_shopper_interactions'] = $supported_shopper_interactions; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of payment method. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php new file mode 100644 index 000000000..9f045d9de --- /dev/null +++ b/src/Adyen/Model/Checkout/StoredPaymentMethodDetails.php @@ -0,0 +1,552 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * StoredPaymentMethodDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class StoredPaymentMethodDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoredPaymentMethodDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BCMC_MOBILE = 'bcmc_mobile'; + public const TYPE_BCMC_MOBILE_QR = 'bcmc_mobile_QR'; + public const TYPE_BCMC_MOBILE_APP = 'bcmc_mobile_app'; + public const TYPE_MOMO_WALLET = 'momo_wallet'; + public const TYPE_MOMO_WALLET_APP = 'momo_wallet_app'; + public const TYPE_PAYMAYA_WALLET = 'paymaya_wallet'; + public const TYPE_GRABPAY_SG = 'grabpay_SG'; + public const TYPE_GRABPAY_MY = 'grabpay_MY'; + public const TYPE_GRABPAY_TH = 'grabpay_TH'; + public const TYPE_GRABPAY_ID = 'grabpay_ID'; + public const TYPE_GRABPAY_VN = 'grabpay_VN'; + public const TYPE_GRABPAY_PH = 'grabpay_PH'; + public const TYPE_OXXO = 'oxxo'; + public const TYPE_GCASH = 'gcash'; + public const TYPE_KAKAOPAY = 'kakaopay'; + public const TYPE_TRUEMONEY = 'truemoney'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BCMC_MOBILE, + self::TYPE_BCMC_MOBILE_QR, + self::TYPE_BCMC_MOBILE_APP, + self::TYPE_MOMO_WALLET, + self::TYPE_MOMO_WALLET_APP, + self::TYPE_PAYMAYA_WALLET, + self::TYPE_GRABPAY_SG, + self::TYPE_GRABPAY_MY, + self::TYPE_GRABPAY_TH, + self::TYPE_GRABPAY_ID, + self::TYPE_GRABPAY_VN, + self::TYPE_GRABPAY_PH, + self::TYPE_OXXO, + self::TYPE_GCASH, + self::TYPE_KAKAOPAY, + self::TYPE_TRUEMONEY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The payment method type. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/StoredPaymentMethodResource.php b/src/Adyen/Model/Checkout/StoredPaymentMethodResource.php new file mode 100644 index 000000000..db9afad0f --- /dev/null +++ b/src/Adyen/Model/Checkout/StoredPaymentMethodResource.php @@ -0,0 +1,931 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * StoredPaymentMethodResource Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class StoredPaymentMethodResource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoredPaymentMethodResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brand' => 'string', + 'expiry_month' => 'string', + 'expiry_year' => 'string', + 'external_response_code' => 'string', + 'external_token_reference' => 'string', + 'holder_name' => 'string', + 'iban' => 'string', + 'id' => 'string', + 'issuer_name' => 'string', + 'last_four' => 'string', + 'name' => 'string', + 'network_tx_reference' => 'string', + 'owner_name' => 'string', + 'shopper_email' => 'string', + 'shopper_reference' => 'string', + 'supported_recurring_processing_models' => 'string[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brand' => null, + 'expiry_month' => null, + 'expiry_year' => null, + 'external_response_code' => null, + 'external_token_reference' => null, + 'holder_name' => null, + 'iban' => null, + 'id' => null, + 'issuer_name' => null, + 'last_four' => null, + 'name' => null, + 'network_tx_reference' => null, + 'owner_name' => null, + 'shopper_email' => null, + 'shopper_reference' => null, + 'supported_recurring_processing_models' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brand' => false, + 'expiry_month' => false, + 'expiry_year' => false, + 'external_response_code' => false, + 'external_token_reference' => false, + 'holder_name' => false, + 'iban' => false, + 'id' => false, + 'issuer_name' => false, + 'last_four' => false, + 'name' => false, + 'network_tx_reference' => false, + 'owner_name' => false, + 'shopper_email' => false, + 'shopper_reference' => false, + 'supported_recurring_processing_models' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brand' => 'brand', + 'expiry_month' => 'expiryMonth', + 'expiry_year' => 'expiryYear', + 'external_response_code' => 'externalResponseCode', + 'external_token_reference' => 'externalTokenReference', + 'holder_name' => 'holderName', + 'iban' => 'iban', + 'id' => 'id', + 'issuer_name' => 'issuerName', + 'last_four' => 'lastFour', + 'name' => 'name', + 'network_tx_reference' => 'networkTxReference', + 'owner_name' => 'ownerName', + 'shopper_email' => 'shopperEmail', + 'shopper_reference' => 'shopperReference', + 'supported_recurring_processing_models' => 'supportedRecurringProcessingModels', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brand' => 'setBrand', + 'expiry_month' => 'setExpiryMonth', + 'expiry_year' => 'setExpiryYear', + 'external_response_code' => 'setExternalResponseCode', + 'external_token_reference' => 'setExternalTokenReference', + 'holder_name' => 'setHolderName', + 'iban' => 'setIban', + 'id' => 'setId', + 'issuer_name' => 'setIssuerName', + 'last_four' => 'setLastFour', + 'name' => 'setName', + 'network_tx_reference' => 'setNetworkTxReference', + 'owner_name' => 'setOwnerName', + 'shopper_email' => 'setShopperEmail', + 'shopper_reference' => 'setShopperReference', + 'supported_recurring_processing_models' => 'setSupportedRecurringProcessingModels', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brand' => 'getBrand', + 'expiry_month' => 'getExpiryMonth', + 'expiry_year' => 'getExpiryYear', + 'external_response_code' => 'getExternalResponseCode', + 'external_token_reference' => 'getExternalTokenReference', + 'holder_name' => 'getHolderName', + 'iban' => 'getIban', + 'id' => 'getId', + 'issuer_name' => 'getIssuerName', + 'last_four' => 'getLastFour', + 'name' => 'getName', + 'network_tx_reference' => 'getNetworkTxReference', + 'owner_name' => 'getOwnerName', + 'shopper_email' => 'getShopperEmail', + 'shopper_reference' => 'getShopperReference', + 'supported_recurring_processing_models' => 'getSupportedRecurringProcessingModels', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('expiry_month', $data ?? [], null); + $this->setIfExists('expiry_year', $data ?? [], null); + $this->setIfExists('external_response_code', $data ?? [], null); + $this->setIfExists('external_token_reference', $data ?? [], null); + $this->setIfExists('holder_name', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('issuer_name', $data ?? [], null); + $this->setIfExists('last_four', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('network_tx_reference', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('supported_recurring_processing_models', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets brand + * + * @return string|null + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string|null $brand The brand of the card. + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets expiry_month + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiry_month']; + } + + /** + * Sets expiry_month + * + * @param string|null $expiry_month The month the card expires. + * + * @return self + */ + public function setExpiryMonth($expiry_month) + { + if (is_null($expiry_month)) { + throw new \InvalidArgumentException('non-nullable expiry_month cannot be null'); + } + $this->container['expiry_month'] = $expiry_month; + + return $this; + } + + /** + * Gets expiry_year + * + * @return string|null + */ + public function getExpiryYear() + { + return $this->container['expiry_year']; + } + + /** + * Sets expiry_year + * + * @param string|null $expiry_year The last two digits of the year the card expires. For example, **22** for the year 2022. + * + * @return self + */ + public function setExpiryYear($expiry_year) + { + if (is_null($expiry_year)) { + throw new \InvalidArgumentException('non-nullable expiry_year cannot be null'); + } + $this->container['expiry_year'] = $expiry_year; + + return $this; + } + + /** + * Gets external_response_code + * + * @return string|null + */ + public function getExternalResponseCode() + { + return $this->container['external_response_code']; + } + + /** + * Sets external_response_code + * + * @param string|null $external_response_code The response code returned by an external system (for example after a provisioning operation). + * + * @return self + */ + public function setExternalResponseCode($external_response_code) + { + if (is_null($external_response_code)) { + throw new \InvalidArgumentException('non-nullable external_response_code cannot be null'); + } + $this->container['external_response_code'] = $external_response_code; + + return $this; + } + + /** + * Gets external_token_reference + * + * @return string|null + */ + public function getExternalTokenReference() + { + return $this->container['external_token_reference']; + } + + /** + * Sets external_token_reference + * + * @param string|null $external_token_reference The token reference of a linked token in an external system (for example a network token reference). + * + * @return self + */ + public function setExternalTokenReference($external_token_reference) + { + if (is_null($external_token_reference)) { + throw new \InvalidArgumentException('non-nullable external_token_reference cannot be null'); + } + $this->container['external_token_reference'] = $external_token_reference; + + return $this; + } + + /** + * Gets holder_name + * + * @return string|null + */ + public function getHolderName() + { + return $this->container['holder_name']; + } + + /** + * Sets holder_name + * + * @param string|null $holder_name The unique payment method code. + * + * @return self + */ + public function setHolderName($holder_name) + { + if (is_null($holder_name)) { + throw new \InvalidArgumentException('non-nullable holder_name cannot be null'); + } + $this->container['holder_name'] = $holder_name; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban The IBAN of the bank account. + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id A unique identifier of this stored payment method. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets issuer_name + * + * @return string|null + */ + public function getIssuerName() + { + return $this->container['issuer_name']; + } + + /** + * Sets issuer_name + * + * @param string|null $issuer_name The name of the issuer of token or card. + * + * @return self + */ + public function setIssuerName($issuer_name) + { + if (is_null($issuer_name)) { + throw new \InvalidArgumentException('non-nullable issuer_name cannot be null'); + } + $this->container['issuer_name'] = $issuer_name; + + return $this; + } + + /** + * Gets last_four + * + * @return string|null + */ + public function getLastFour() + { + return $this->container['last_four']; + } + + /** + * Sets last_four + * + * @param string|null $last_four The last four digits of the PAN. + * + * @return self + */ + public function setLastFour($last_four) + { + if (is_null($last_four)) { + throw new \InvalidArgumentException('non-nullable last_four cannot be null'); + } + $this->container['last_four'] = $last_four; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The display name of the stored payment method. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets network_tx_reference + * + * @return string|null + */ + public function getNetworkTxReference() + { + return $this->container['network_tx_reference']; + } + + /** + * Sets network_tx_reference + * + * @param string|null $network_tx_reference Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + * + * @return self + */ + public function setNetworkTxReference($network_tx_reference) + { + if (is_null($network_tx_reference)) { + throw new \InvalidArgumentException('non-nullable network_tx_reference cannot be null'); + } + $this->container['network_tx_reference'] = $network_tx_reference; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the bank account holder. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper’s email address. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets supported_recurring_processing_models + * + * @return string[]|null + */ + public function getSupportedRecurringProcessingModels() + { + return $this->container['supported_recurring_processing_models']; + } + + /** + * Sets supported_recurring_processing_models + * + * @param string[]|null $supported_recurring_processing_models Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setSupportedRecurringProcessingModels($supported_recurring_processing_models) + { + if (is_null($supported_recurring_processing_models)) { + throw new \InvalidArgumentException('non-nullable supported_recurring_processing_models cannot be null'); + } + $this->container['supported_recurring_processing_models'] = $supported_recurring_processing_models; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of payment method. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/SubInputDetail.php b/src/Adyen/Model/Checkout/SubInputDetail.php new file mode 100644 index 000000000..4e697b495 --- /dev/null +++ b/src/Adyen/Model/Checkout/SubInputDetail.php @@ -0,0 +1,557 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * SubInputDetail Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class SubInputDetail implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubInputDetail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'configuration' => 'array', + 'items' => '\Adyen\Model\Checkout\Item[]', + 'key' => 'string', + 'optional' => 'bool', + 'type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'configuration' => null, + 'items' => null, + 'key' => null, + 'optional' => null, + 'type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'configuration' => false, + 'items' => false, + 'key' => false, + 'optional' => false, + 'type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'configuration' => 'configuration', + 'items' => 'items', + 'key' => 'key', + 'optional' => 'optional', + 'type' => 'type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'configuration' => 'setConfiguration', + 'items' => 'setItems', + 'key' => 'setKey', + 'optional' => 'setOptional', + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'configuration' => 'getConfiguration', + 'items' => 'getItems', + 'key' => 'getKey', + 'optional' => 'getOptional', + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('configuration', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('optional', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 configuration + * + * @return array|null + */ + public function getConfiguration() + { + return $this->container['configuration']; + } + + /** + * Sets configuration + * + * @param array|null $configuration Configuration parameters for the required input. + * + * @return self + */ + public function setConfiguration($configuration) + { + if (is_null($configuration)) { + throw new \InvalidArgumentException('non-nullable configuration cannot be null'); + } + $this->container['configuration'] = $configuration; + + return $this; + } + + /** + * Gets items + * + * @return \Adyen\Model\Checkout\Item[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Adyen\Model\Checkout\Item[]|null $items In case of a select, the items to choose from. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The value to provide in the result. + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets optional + * + * @return bool|null + */ + public function getOptional() + { + return $this->container['optional']; + } + + /** + * Sets optional + * + * @param bool|null $optional True if this input is optional to provide. + * + * @return self + */ + public function setOptional($optional) + { + if (is_null($optional)) { + throw new \InvalidArgumentException('non-nullable optional cannot be null'); + } + $this->container['optional'] = $optional; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the required input. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value can be pre-filled, if available. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/SubMerchant.php b/src/Adyen/Model/Checkout/SubMerchant.php new file mode 100644 index 000000000..3b107db69 --- /dev/null +++ b/src/Adyen/Model/Checkout/SubMerchant.php @@ -0,0 +1,523 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * SubMerchant Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class SubMerchant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubMerchant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'mcc' => 'string', + 'name' => 'string', + 'tax_id' => '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, + 'mcc' => null, + 'name' => null, + 'tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'mcc' => false, + 'name' => false, + 'tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'mcc' => 'mcc', + 'name' => 'name', + 'tax_id' => 'taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'mcc' => 'setMcc', + 'name' => 'setName', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'mcc' => 'getMcc', + 'name' => 'getName', + '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->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tax_id + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param string|null $tax_id The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + * + * @return self + */ + public function setTaxId($tax_id) + { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } + $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 + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDS2RequestData.php b/src/Adyen/Model/Checkout/ThreeDS2RequestData.php new file mode 100644 index 000000000..8256883be --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDS2RequestData.php @@ -0,0 +1,1908 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ThreeDS2RequestData Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ThreeDS2RequestData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2RequestData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acct_info' => '\Adyen\Model\Checkout\AcctInfo', + 'acct_type' => 'string', + 'acquirer_bin' => 'string', + 'acquirer_merchant_id' => 'string', + 'addr_match' => 'string', + 'authentication_only' => 'bool', + 'challenge_indicator' => 'string', + 'device_channel' => 'string', + 'device_render_options' => '\Adyen\Model\Checkout\DeviceRenderOptions', + 'home_phone' => '\Adyen\Model\Checkout\Phone', + 'mcc' => 'string', + 'merchant_name' => 'string', + 'message_version' => 'string', + 'mobile_phone' => '\Adyen\Model\Checkout\Phone', + 'notification_url' => 'string', + 'pay_token_ind' => 'bool', + 'payment_authentication_use_case' => 'string', + 'purchase_instal_data' => 'string', + 'recurring_expiry' => 'string', + 'recurring_frequency' => 'string', + 'sdk_app_id' => 'string', + 'sdk_enc_data' => 'string', + 'sdk_ephem_pub_key' => '\Adyen\Model\Checkout\SDKEphemPubKey', + 'sdk_max_timeout' => 'int', + 'sdk_reference_number' => 'string', + 'sdk_trans_id' => 'string', + 'sdk_version' => 'string', + 'three_ds_comp_ind' => 'string', + 'three_ds_requestor_authentication_ind' => 'string', + 'three_ds_requestor_authentication_info' => '\Adyen\Model\Checkout\ThreeDSRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'string', + 'three_ds_requestor_id' => 'string', + 'three_ds_requestor_name' => 'string', + 'three_ds_requestor_prior_authentication_info' => '\Adyen\Model\Checkout\ThreeDSRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'string', + 'trans_type' => 'string', + 'transaction_type' => 'string', + 'white_list_status' => 'string', + 'work_phone' => '\Adyen\Model\Checkout\Phone' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acct_info' => null, + 'acct_type' => null, + 'acquirer_bin' => null, + 'acquirer_merchant_id' => null, + 'addr_match' => null, + 'authentication_only' => null, + 'challenge_indicator' => null, + 'device_channel' => null, + 'device_render_options' => null, + 'home_phone' => null, + 'mcc' => null, + 'merchant_name' => null, + 'message_version' => null, + 'mobile_phone' => null, + 'notification_url' => null, + 'pay_token_ind' => null, + 'payment_authentication_use_case' => null, + 'purchase_instal_data' => null, + 'recurring_expiry' => null, + 'recurring_frequency' => null, + 'sdk_app_id' => null, + 'sdk_enc_data' => null, + 'sdk_ephem_pub_key' => null, + 'sdk_max_timeout' => 'int32', + 'sdk_reference_number' => null, + 'sdk_trans_id' => null, + 'sdk_version' => null, + 'three_ds_comp_ind' => null, + 'three_ds_requestor_authentication_ind' => null, + 'three_ds_requestor_authentication_info' => null, + 'three_ds_requestor_challenge_ind' => null, + 'three_ds_requestor_id' => null, + 'three_ds_requestor_name' => null, + 'three_ds_requestor_prior_authentication_info' => null, + 'three_ds_requestor_url' => null, + 'trans_type' => null, + 'transaction_type' => null, + 'white_list_status' => null, + 'work_phone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acct_info' => false, + 'acct_type' => false, + 'acquirer_bin' => false, + 'acquirer_merchant_id' => false, + 'addr_match' => false, + 'authentication_only' => false, + 'challenge_indicator' => false, + 'device_channel' => false, + 'device_render_options' => false, + 'home_phone' => false, + 'mcc' => false, + 'merchant_name' => false, + 'message_version' => false, + 'mobile_phone' => false, + 'notification_url' => false, + 'pay_token_ind' => false, + 'payment_authentication_use_case' => false, + 'purchase_instal_data' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'sdk_app_id' => false, + 'sdk_enc_data' => false, + 'sdk_ephem_pub_key' => false, + 'sdk_max_timeout' => true, + 'sdk_reference_number' => false, + 'sdk_trans_id' => false, + 'sdk_version' => false, + 'three_ds_comp_ind' => false, + 'three_ds_requestor_authentication_ind' => false, + 'three_ds_requestor_authentication_info' => false, + 'three_ds_requestor_challenge_ind' => false, + 'three_ds_requestor_id' => false, + 'three_ds_requestor_name' => false, + 'three_ds_requestor_prior_authentication_info' => false, + 'three_ds_requestor_url' => false, + 'trans_type' => false, + 'transaction_type' => false, + 'white_list_status' => false, + 'work_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acct_info' => 'acctInfo', + 'acct_type' => 'acctType', + 'acquirer_bin' => 'acquirerBIN', + 'acquirer_merchant_id' => 'acquirerMerchantID', + 'addr_match' => 'addrMatch', + 'authentication_only' => 'authenticationOnly', + 'challenge_indicator' => 'challengeIndicator', + 'device_channel' => 'deviceChannel', + 'device_render_options' => 'deviceRenderOptions', + 'home_phone' => 'homePhone', + 'mcc' => 'mcc', + 'merchant_name' => 'merchantName', + 'message_version' => 'messageVersion', + 'mobile_phone' => 'mobilePhone', + 'notification_url' => 'notificationURL', + 'pay_token_ind' => 'payTokenInd', + 'payment_authentication_use_case' => 'paymentAuthenticationUseCase', + 'purchase_instal_data' => 'purchaseInstalData', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'sdk_app_id' => 'sdkAppID', + 'sdk_enc_data' => 'sdkEncData', + 'sdk_ephem_pub_key' => 'sdkEphemPubKey', + 'sdk_max_timeout' => 'sdkMaxTimeout', + 'sdk_reference_number' => 'sdkReferenceNumber', + 'sdk_trans_id' => 'sdkTransID', + 'sdk_version' => 'sdkVersion', + 'three_ds_comp_ind' => 'threeDSCompInd', + 'three_ds_requestor_authentication_ind' => 'threeDSRequestorAuthenticationInd', + 'three_ds_requestor_authentication_info' => 'threeDSRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'threeDSRequestorChallengeInd', + 'three_ds_requestor_id' => 'threeDSRequestorID', + 'three_ds_requestor_name' => 'threeDSRequestorName', + 'three_ds_requestor_prior_authentication_info' => 'threeDSRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'threeDSRequestorURL', + 'trans_type' => 'transType', + 'transaction_type' => 'transactionType', + 'white_list_status' => 'whiteListStatus', + 'work_phone' => 'workPhone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acct_info' => 'setAcctInfo', + 'acct_type' => 'setAcctType', + 'acquirer_bin' => 'setAcquirerBin', + 'acquirer_merchant_id' => 'setAcquirerMerchantId', + 'addr_match' => 'setAddrMatch', + 'authentication_only' => 'setAuthenticationOnly', + 'challenge_indicator' => 'setChallengeIndicator', + 'device_channel' => 'setDeviceChannel', + 'device_render_options' => 'setDeviceRenderOptions', + 'home_phone' => 'setHomePhone', + 'mcc' => 'setMcc', + 'merchant_name' => 'setMerchantName', + 'message_version' => 'setMessageVersion', + 'mobile_phone' => 'setMobilePhone', + 'notification_url' => 'setNotificationUrl', + 'pay_token_ind' => 'setPayTokenInd', + 'payment_authentication_use_case' => 'setPaymentAuthenticationUseCase', + 'purchase_instal_data' => 'setPurchaseInstalData', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'sdk_app_id' => 'setSdkAppId', + 'sdk_enc_data' => 'setSdkEncData', + 'sdk_ephem_pub_key' => 'setSdkEphemPubKey', + 'sdk_max_timeout' => 'setSdkMaxTimeout', + 'sdk_reference_number' => 'setSdkReferenceNumber', + 'sdk_trans_id' => 'setSdkTransId', + 'sdk_version' => 'setSdkVersion', + 'three_ds_comp_ind' => 'setThreeDsCompInd', + 'three_ds_requestor_authentication_ind' => 'setThreeDsRequestorAuthenticationInd', + 'three_ds_requestor_authentication_info' => 'setThreeDsRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'setThreeDsRequestorChallengeInd', + 'three_ds_requestor_id' => 'setThreeDsRequestorId', + 'three_ds_requestor_name' => 'setThreeDsRequestorName', + 'three_ds_requestor_prior_authentication_info' => 'setThreeDsRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'setThreeDsRequestorUrl', + 'trans_type' => 'setTransType', + 'transaction_type' => 'setTransactionType', + 'white_list_status' => 'setWhiteListStatus', + 'work_phone' => 'setWorkPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acct_info' => 'getAcctInfo', + 'acct_type' => 'getAcctType', + 'acquirer_bin' => 'getAcquirerBin', + 'acquirer_merchant_id' => 'getAcquirerMerchantId', + 'addr_match' => 'getAddrMatch', + 'authentication_only' => 'getAuthenticationOnly', + 'challenge_indicator' => 'getChallengeIndicator', + 'device_channel' => 'getDeviceChannel', + 'device_render_options' => 'getDeviceRenderOptions', + 'home_phone' => 'getHomePhone', + 'mcc' => 'getMcc', + 'merchant_name' => 'getMerchantName', + 'message_version' => 'getMessageVersion', + 'mobile_phone' => 'getMobilePhone', + 'notification_url' => 'getNotificationUrl', + 'pay_token_ind' => 'getPayTokenInd', + 'payment_authentication_use_case' => 'getPaymentAuthenticationUseCase', + 'purchase_instal_data' => 'getPurchaseInstalData', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'sdk_app_id' => 'getSdkAppId', + 'sdk_enc_data' => 'getSdkEncData', + 'sdk_ephem_pub_key' => 'getSdkEphemPubKey', + 'sdk_max_timeout' => 'getSdkMaxTimeout', + 'sdk_reference_number' => 'getSdkReferenceNumber', + 'sdk_trans_id' => 'getSdkTransId', + 'sdk_version' => 'getSdkVersion', + 'three_ds_comp_ind' => 'getThreeDsCompInd', + 'three_ds_requestor_authentication_ind' => 'getThreeDsRequestorAuthenticationInd', + 'three_ds_requestor_authentication_info' => 'getThreeDsRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'getThreeDsRequestorChallengeInd', + 'three_ds_requestor_id' => 'getThreeDsRequestorId', + 'three_ds_requestor_name' => 'getThreeDsRequestorName', + 'three_ds_requestor_prior_authentication_info' => 'getThreeDsRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'getThreeDsRequestorUrl', + 'trans_type' => 'getTransType', + 'transaction_type' => 'getTransactionType', + 'white_list_status' => 'getWhiteListStatus', + 'work_phone' => 'getWorkPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACCT_TYPE__01 = '01'; + public const ACCT_TYPE__02 = '02'; + public const ACCT_TYPE__03 = '03'; + public const ADDR_MATCH_Y = 'Y'; + public const ADDR_MATCH_N = 'N'; + public const CHALLENGE_INDICATOR_NO_PREFERENCE = 'noPreference'; + public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__04 = '04'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__05 = '05'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__06 = '06'; + public const TRANS_TYPE__01 = '01'; + public const TRANS_TYPE__03 = '03'; + public const TRANS_TYPE__10 = '10'; + public const TRANS_TYPE__11 = '11'; + public const TRANS_TYPE__28 = '28'; + public const TRANSACTION_TYPE_GOODS_OR_SERVICE_PURCHASE = 'goodsOrServicePurchase'; + public const TRANSACTION_TYPE_CHECK_ACCEPTANCE = 'checkAcceptance'; + public const TRANSACTION_TYPE_ACCOUNT_FUNDING = 'accountFunding'; + public const TRANSACTION_TYPE_QUASI_CASH_TRANSACTION = 'quasiCashTransaction'; + public const TRANSACTION_TYPE_PREPAID_ACTIVATION_AND_LOAD = 'prepaidActivationAndLoad'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAcctTypeAllowableValues() + { + return [ + self::ACCT_TYPE__01, + self::ACCT_TYPE__02, + self::ACCT_TYPE__03, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAddrMatchAllowableValues() + { + return [ + self::ADDR_MATCH_Y, + self::ADDR_MATCH_N, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeIndicatorAllowableValues() + { + return [ + self::CHALLENGE_INDICATOR_NO_PREFERENCE, + self::CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDsRequestorChallengeIndAllowableValues() + { + return [ + self::THREE_DS_REQUESTOR_CHALLENGE_IND__01, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__02, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__03, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__04, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__05, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__06, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransTypeAllowableValues() + { + return [ + self::TRANS_TYPE__01, + self::TRANS_TYPE__03, + self::TRANS_TYPE__10, + self::TRANS_TYPE__11, + self::TRANS_TYPE__28, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransactionTypeAllowableValues() + { + return [ + self::TRANSACTION_TYPE_GOODS_OR_SERVICE_PURCHASE, + self::TRANSACTION_TYPE_CHECK_ACCEPTANCE, + self::TRANSACTION_TYPE_ACCOUNT_FUNDING, + self::TRANSACTION_TYPE_QUASI_CASH_TRANSACTION, + self::TRANSACTION_TYPE_PREPAID_ACTIVATION_AND_LOAD, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('acct_info', $data ?? [], null); + $this->setIfExists('acct_type', $data ?? [], null); + $this->setIfExists('acquirer_bin', $data ?? [], null); + $this->setIfExists('acquirer_merchant_id', $data ?? [], null); + $this->setIfExists('addr_match', $data ?? [], null); + $this->setIfExists('authentication_only', $data ?? [], false); + $this->setIfExists('challenge_indicator', $data ?? [], null); + $this->setIfExists('device_channel', $data ?? [], null); + $this->setIfExists('device_render_options', $data ?? [], null); + $this->setIfExists('home_phone', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_name', $data ?? [], null); + $this->setIfExists('message_version', $data ?? [], '2.1.0'); + $this->setIfExists('mobile_phone', $data ?? [], null); + $this->setIfExists('notification_url', $data ?? [], null); + $this->setIfExists('pay_token_ind', $data ?? [], null); + $this->setIfExists('payment_authentication_use_case', $data ?? [], null); + $this->setIfExists('purchase_instal_data', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('sdk_app_id', $data ?? [], null); + $this->setIfExists('sdk_enc_data', $data ?? [], null); + $this->setIfExists('sdk_ephem_pub_key', $data ?? [], null); + $this->setIfExists('sdk_max_timeout', $data ?? [], 60); + $this->setIfExists('sdk_reference_number', $data ?? [], null); + $this->setIfExists('sdk_trans_id', $data ?? [], null); + $this->setIfExists('sdk_version', $data ?? [], null); + $this->setIfExists('three_ds_comp_ind', $data ?? [], null); + $this->setIfExists('three_ds_requestor_authentication_ind', $data ?? [], null); + $this->setIfExists('three_ds_requestor_authentication_info', $data ?? [], null); + $this->setIfExists('three_ds_requestor_challenge_ind', $data ?? [], null); + $this->setIfExists('three_ds_requestor_id', $data ?? [], null); + $this->setIfExists('three_ds_requestor_name', $data ?? [], null); + $this->setIfExists('three_ds_requestor_prior_authentication_info', $data ?? [], null); + $this->setIfExists('three_ds_requestor_url', $data ?? [], null); + $this->setIfExists('trans_type', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('white_list_status', $data ?? [], null); + $this->setIfExists('work_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAcctTypeAllowableValues(); + if (!is_null($this->container['acct_type']) && !in_array($this->container['acct_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'acct_type', must be one of '%s'", + $this->container['acct_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAddrMatchAllowableValues(); + if (!is_null($this->container['addr_match']) && !in_array($this->container['addr_match'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'addr_match', must be one of '%s'", + $this->container['addr_match'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!is_null($this->container['challenge_indicator']) && !in_array($this->container['challenge_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $this->container['challenge_indicator'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['device_channel'] === null) { + $invalidProperties[] = "'device_channel' can't be null"; + } + $allowedValues = $this->getThreeDsRequestorChallengeIndAllowableValues(); + if (!is_null($this->container['three_ds_requestor_challenge_ind']) && !in_array($this->container['three_ds_requestor_challenge_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'three_ds_requestor_challenge_ind', must be one of '%s'", + $this->container['three_ds_requestor_challenge_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTransTypeAllowableValues(); + if (!is_null($this->container['trans_type']) && !in_array($this->container['trans_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'trans_type', must be one of '%s'", + $this->container['trans_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTransactionTypeAllowableValues(); + if (!is_null($this->container['transaction_type']) && !in_array($this->container['transaction_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'transaction_type', must be one of '%s'", + $this->container['transaction_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 acct_info + * + * @return \Adyen\Model\Checkout\AcctInfo|null + */ + public function getAcctInfo() + { + return $this->container['acct_info']; + } + + /** + * Sets acct_info + * + * @param \Adyen\Model\Checkout\AcctInfo|null $acct_info acct_info + * + * @return self + */ + public function setAcctInfo($acct_info) + { + if (is_null($acct_info)) { + throw new \InvalidArgumentException('non-nullable acct_info cannot be null'); + } + $this->container['acct_info'] = $acct_info; + + return $this; + } + + /** + * Gets acct_type + * + * @return string|null + */ + public function getAcctType() + { + return $this->container['acct_type']; + } + + /** + * Sets acct_type + * + * @param string|null $acct_type Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + * + * @return self + */ + public function setAcctType($acct_type) + { + if (is_null($acct_type)) { + throw new \InvalidArgumentException('non-nullable acct_type cannot be null'); + } + $allowedValues = $this->getAcctTypeAllowableValues(); + if (!in_array($acct_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'acct_type', must be one of '%s'", + $acct_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['acct_type'] = $acct_type; + + return $this; + } + + /** + * Gets acquirer_bin + * + * @return string|null + */ + public function getAcquirerBin() + { + return $this->container['acquirer_bin']; + } + + /** + * Sets acquirer_bin + * + * @param string|null $acquirer_bin Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + * + * @return self + */ + public function setAcquirerBin($acquirer_bin) + { + if (is_null($acquirer_bin)) { + throw new \InvalidArgumentException('non-nullable acquirer_bin cannot be null'); + } + $this->container['acquirer_bin'] = $acquirer_bin; + + return $this; + } + + /** + * Gets acquirer_merchant_id + * + * @return string|null + */ + public function getAcquirerMerchantId() + { + return $this->container['acquirer_merchant_id']; + } + + /** + * Sets acquirer_merchant_id + * + * @param string|null $acquirer_merchant_id Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + * + * @return self + */ + public function setAcquirerMerchantId($acquirer_merchant_id) + { + if (is_null($acquirer_merchant_id)) { + throw new \InvalidArgumentException('non-nullable acquirer_merchant_id cannot be null'); + } + $this->container['acquirer_merchant_id'] = $acquirer_merchant_id; + + return $this; + } + + /** + * Gets addr_match + * + * @return string|null + */ + public function getAddrMatch() + { + return $this->container['addr_match']; + } + + /** + * Sets addr_match + * + * @param string|null $addr_match Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + * + * @return self + */ + public function setAddrMatch($addr_match) + { + if (is_null($addr_match)) { + throw new \InvalidArgumentException('non-nullable addr_match cannot be null'); + } + $allowedValues = $this->getAddrMatchAllowableValues(); + if (!in_array($addr_match, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'addr_match', must be one of '%s'", + $addr_match, + implode("', '", $allowedValues) + ) + ); + } + $this->container['addr_match'] = $addr_match; + + return $this; + } + + /** + * Gets authentication_only + * + * @return bool|null + * @deprecated + */ + public function getAuthenticationOnly() + { + return $this->container['authentication_only']; + } + + /** + * Sets authentication_only + * + * @param bool|null $authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + * @deprecated + */ + public function setAuthenticationOnly($authentication_only) + { + if (is_null($authentication_only)) { + throw new \InvalidArgumentException('non-nullable authentication_only cannot be null'); + } + $this->container['authentication_only'] = $authentication_only; + + return $this; + } + + /** + * Gets challenge_indicator + * + * @return string|null + * @deprecated + */ + public function getChallengeIndicator() + { + return $this->container['challenge_indicator']; + } + + /** + * Sets challenge_indicator + * + * @param string|null $challenge_indicator Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + * + * @return self + * @deprecated + */ + public function setChallengeIndicator($challenge_indicator) + { + if (is_null($challenge_indicator)) { + throw new \InvalidArgumentException('non-nullable challenge_indicator cannot be null'); + } + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!in_array($challenge_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $challenge_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_indicator'] = $challenge_indicator; + + return $this; + } + + /** + * Gets device_channel + * + * @return string + */ + public function getDeviceChannel() + { + return $this->container['device_channel']; + } + + /** + * Sets device_channel + * + * @param string $device_channel The environment of the shopper. Allowed values: * `app` * `browser` + * + * @return self + */ + public function setDeviceChannel($device_channel) + { + if (is_null($device_channel)) { + throw new \InvalidArgumentException('non-nullable device_channel cannot be null'); + } + $this->container['device_channel'] = $device_channel; + + return $this; + } + + /** + * Gets device_render_options + * + * @return \Adyen\Model\Checkout\DeviceRenderOptions|null + */ + public function getDeviceRenderOptions() + { + return $this->container['device_render_options']; + } + + /** + * Sets device_render_options + * + * @param \Adyen\Model\Checkout\DeviceRenderOptions|null $device_render_options device_render_options + * + * @return self + */ + public function setDeviceRenderOptions($device_render_options) + { + if (is_null($device_render_options)) { + throw new \InvalidArgumentException('non-nullable device_render_options cannot be null'); + } + $this->container['device_render_options'] = $device_render_options; + + return $this; + } + + /** + * Gets home_phone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getHomePhone() + { + return $this->container['home_phone']; + } + + /** + * Sets home_phone + * + * @param \Adyen\Model\Checkout\Phone|null $home_phone home_phone + * + * @return self + */ + public function setHomePhone($home_phone) + { + if (is_null($home_phone)) { + throw new \InvalidArgumentException('non-nullable home_phone cannot be null'); + } + $this->container['home_phone'] = $home_phone; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_name + * + * @return string|null + */ + public function getMerchantName() + { + return $this->container['merchant_name']; + } + + /** + * Sets merchant_name + * + * @param string|null $merchant_name Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + * + * @return self + */ + public function setMerchantName($merchant_name) + { + if (is_null($merchant_name)) { + throw new \InvalidArgumentException('non-nullable merchant_name cannot be null'); + } + $this->container['merchant_name'] = $merchant_name; + + return $this; + } + + /** + * Gets message_version + * + * @return string|null + */ + public function getMessageVersion() + { + return $this->container['message_version']; + } + + /** + * Sets message_version + * + * @param string|null $message_version The `messageVersion` value indicating the 3D Secure 2 protocol version. + * + * @return self + */ + public function setMessageVersion($message_version) + { + if (is_null($message_version)) { + throw new \InvalidArgumentException('non-nullable message_version cannot be null'); + } + $this->container['message_version'] = $message_version; + + return $this; + } + + /** + * Gets mobile_phone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getMobilePhone() + { + return $this->container['mobile_phone']; + } + + /** + * Sets mobile_phone + * + * @param \Adyen\Model\Checkout\Phone|null $mobile_phone mobile_phone + * + * @return self + */ + public function setMobilePhone($mobile_phone) + { + if (is_null($mobile_phone)) { + throw new \InvalidArgumentException('non-nullable mobile_phone cannot be null'); + } + $this->container['mobile_phone'] = $mobile_phone; + + return $this; + } + + /** + * Gets notification_url + * + * @return string|null + */ + public function getNotificationUrl() + { + return $this->container['notification_url']; + } + + /** + * Sets notification_url + * + * @param string|null $notification_url URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + * + * @return self + */ + public function setNotificationUrl($notification_url) + { + if (is_null($notification_url)) { + throw new \InvalidArgumentException('non-nullable notification_url cannot be null'); + } + $this->container['notification_url'] = $notification_url; + + return $this; + } + + /** + * Gets pay_token_ind + * + * @return bool|null + */ + public function getPayTokenInd() + { + return $this->container['pay_token_ind']; + } + + /** + * Sets pay_token_ind + * + * @param bool|null $pay_token_ind Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. + * + * @return self + */ + public function setPayTokenInd($pay_token_ind) + { + if (is_null($pay_token_ind)) { + throw new \InvalidArgumentException('non-nullable pay_token_ind cannot be null'); + } + $this->container['pay_token_ind'] = $pay_token_ind; + + return $this; + } + + /** + * Gets payment_authentication_use_case + * + * @return string|null + */ + public function getPaymentAuthenticationUseCase() + { + return $this->container['payment_authentication_use_case']; + } + + /** + * Sets payment_authentication_use_case + * + * @param string|null $payment_authentication_use_case Indicates the type of payment for which an authentication is requested (message extension) + * + * @return self + */ + public function setPaymentAuthenticationUseCase($payment_authentication_use_case) + { + if (is_null($payment_authentication_use_case)) { + throw new \InvalidArgumentException('non-nullable payment_authentication_use_case cannot be null'); + } + $this->container['payment_authentication_use_case'] = $payment_authentication_use_case; + + return $this; + } + + /** + * Gets purchase_instal_data + * + * @return string|null + */ + public function getPurchaseInstalData() + { + return $this->container['purchase_instal_data']; + } + + /** + * Sets purchase_instal_data + * + * @param string|null $purchase_instal_data Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + * + * @return self + */ + public function setPurchaseInstalData($purchase_instal_data) + { + if (is_null($purchase_instal_data)) { + throw new \InvalidArgumentException('non-nullable purchase_instal_data cannot be null'); + } + $this->container['purchase_instal_data'] = $purchase_instal_data; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param string|null $recurring_expiry Date after which no further authorisations shall be performed. Format: YYYYMMDD + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Indicates the minimum number of days between authorisations. Maximum length: 4 characters. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets sdk_app_id + * + * @return string|null + */ + public function getSdkAppId() + { + return $this->container['sdk_app_id']; + } + + /** + * Sets sdk_app_id + * + * @param string|null $sdk_app_id The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkAppId($sdk_app_id) + { + if (is_null($sdk_app_id)) { + throw new \InvalidArgumentException('non-nullable sdk_app_id cannot be null'); + } + $this->container['sdk_app_id'] = $sdk_app_id; + + return $this; + } + + /** + * Gets sdk_enc_data + * + * @return string|null + */ + public function getSdkEncData() + { + return $this->container['sdk_enc_data']; + } + + /** + * Sets sdk_enc_data + * + * @param string|null $sdk_enc_data The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkEncData($sdk_enc_data) + { + if (is_null($sdk_enc_data)) { + throw new \InvalidArgumentException('non-nullable sdk_enc_data cannot be null'); + } + $this->container['sdk_enc_data'] = $sdk_enc_data; + + return $this; + } + + /** + * Gets sdk_ephem_pub_key + * + * @return \Adyen\Model\Checkout\SDKEphemPubKey|null + */ + public function getSdkEphemPubKey() + { + return $this->container['sdk_ephem_pub_key']; + } + + /** + * Sets sdk_ephem_pub_key + * + * @param \Adyen\Model\Checkout\SDKEphemPubKey|null $sdk_ephem_pub_key sdk_ephem_pub_key + * + * @return self + */ + public function setSdkEphemPubKey($sdk_ephem_pub_key) + { + if (is_null($sdk_ephem_pub_key)) { + throw new \InvalidArgumentException('non-nullable sdk_ephem_pub_key cannot be null'); + } + $this->container['sdk_ephem_pub_key'] = $sdk_ephem_pub_key; + + return $this; + } + + /** + * Gets sdk_max_timeout + * + * @return int|null + */ + public function getSdkMaxTimeout() + { + return $this->container['sdk_max_timeout']; + } + + /** + * Sets sdk_max_timeout + * + * @param int|null $sdk_max_timeout The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. + * + * @return self + */ + public function setSdkMaxTimeout($sdk_max_timeout) + { + // Do nothing for nullable integers + $this->container['sdk_max_timeout'] = $sdk_max_timeout; + + return $this; + } + + /** + * Gets sdk_reference_number + * + * @return string|null + */ + public function getSdkReferenceNumber() + { + return $this->container['sdk_reference_number']; + } + + /** + * Sets sdk_reference_number + * + * @param string|null $sdk_reference_number The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkReferenceNumber($sdk_reference_number) + { + if (is_null($sdk_reference_number)) { + throw new \InvalidArgumentException('non-nullable sdk_reference_number cannot be null'); + } + $this->container['sdk_reference_number'] = $sdk_reference_number; + + return $this; + } + + /** + * Gets sdk_trans_id + * + * @return string|null + */ + public function getSdkTransId() + { + return $this->container['sdk_trans_id']; + } + + /** + * Sets sdk_trans_id + * + * @param string|null $sdk_trans_id The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkTransId($sdk_trans_id) + { + if (is_null($sdk_trans_id)) { + throw new \InvalidArgumentException('non-nullable sdk_trans_id cannot be null'); + } + $this->container['sdk_trans_id'] = $sdk_trans_id; + + return $this; + } + + /** + * Gets sdk_version + * + * @return string|null + */ + public function getSdkVersion() + { + return $this->container['sdk_version']; + } + + /** + * Sets sdk_version + * + * @param string|null $sdk_version Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkVersion($sdk_version) + { + if (is_null($sdk_version)) { + throw new \InvalidArgumentException('non-nullable sdk_version cannot be null'); + } + $this->container['sdk_version'] = $sdk_version; + + return $this; + } + + /** + * Gets three_ds_comp_ind + * + * @return string|null + */ + public function getThreeDsCompInd() + { + return $this->container['three_ds_comp_ind']; + } + + /** + * Sets three_ds_comp_ind + * + * @param string|null $three_ds_comp_ind Completion indicator for the device fingerprinting. + * + * @return self + */ + public function setThreeDsCompInd($three_ds_comp_ind) + { + if (is_null($three_ds_comp_ind)) { + throw new \InvalidArgumentException('non-nullable three_ds_comp_ind cannot be null'); + } + $this->container['three_ds_comp_ind'] = $three_ds_comp_ind; + + return $this; + } + + /** + * Gets three_ds_requestor_authentication_ind + * + * @return string|null + */ + public function getThreeDsRequestorAuthenticationInd() + { + return $this->container['three_ds_requestor_authentication_ind']; + } + + /** + * Sets three_ds_requestor_authentication_ind + * + * @param string|null $three_ds_requestor_authentication_ind Indicates the type of Authentication request. + * + * @return self + */ + public function setThreeDsRequestorAuthenticationInd($three_ds_requestor_authentication_ind) + { + if (is_null($three_ds_requestor_authentication_ind)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_authentication_ind cannot be null'); + } + $this->container['three_ds_requestor_authentication_ind'] = $three_ds_requestor_authentication_ind; + + return $this; + } + + /** + * Gets three_ds_requestor_authentication_info + * + * @return \Adyen\Model\Checkout\ThreeDSRequestorAuthenticationInfo|null + */ + public function getThreeDsRequestorAuthenticationInfo() + { + return $this->container['three_ds_requestor_authentication_info']; + } + + /** + * Sets three_ds_requestor_authentication_info + * + * @param \Adyen\Model\Checkout\ThreeDSRequestorAuthenticationInfo|null $three_ds_requestor_authentication_info three_ds_requestor_authentication_info + * + * @return self + */ + public function setThreeDsRequestorAuthenticationInfo($three_ds_requestor_authentication_info) + { + if (is_null($three_ds_requestor_authentication_info)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_authentication_info cannot be null'); + } + $this->container['three_ds_requestor_authentication_info'] = $three_ds_requestor_authentication_info; + + return $this; + } + + /** + * Gets three_ds_requestor_challenge_ind + * + * @return string|null + */ + public function getThreeDsRequestorChallengeInd() + { + return $this->container['three_ds_requestor_challenge_ind']; + } + + /** + * Sets three_ds_requestor_challenge_ind + * + * @param string|null $three_ds_requestor_challenge_ind Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + * + * @return self + */ + public function setThreeDsRequestorChallengeInd($three_ds_requestor_challenge_ind) + { + if (is_null($three_ds_requestor_challenge_ind)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_challenge_ind cannot be null'); + } + $allowedValues = $this->getThreeDsRequestorChallengeIndAllowableValues(); + if (!in_array($three_ds_requestor_challenge_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'three_ds_requestor_challenge_ind', must be one of '%s'", + $three_ds_requestor_challenge_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['three_ds_requestor_challenge_ind'] = $three_ds_requestor_challenge_ind; + + return $this; + } + + /** + * Gets three_ds_requestor_id + * + * @return string|null + */ + public function getThreeDsRequestorId() + { + return $this->container['three_ds_requestor_id']; + } + + /** + * Sets three_ds_requestor_id + * + * @param string|null $three_ds_requestor_id Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + * + * @return self + */ + public function setThreeDsRequestorId($three_ds_requestor_id) + { + if (is_null($three_ds_requestor_id)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_id cannot be null'); + } + $this->container['three_ds_requestor_id'] = $three_ds_requestor_id; + + return $this; + } + + /** + * Gets three_ds_requestor_name + * + * @return string|null + */ + public function getThreeDsRequestorName() + { + return $this->container['three_ds_requestor_name']; + } + + /** + * Sets three_ds_requestor_name + * + * @param string|null $three_ds_requestor_name Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + * + * @return self + */ + public function setThreeDsRequestorName($three_ds_requestor_name) + { + if (is_null($three_ds_requestor_name)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_name cannot be null'); + } + $this->container['three_ds_requestor_name'] = $three_ds_requestor_name; + + return $this; + } + + /** + * Gets three_ds_requestor_prior_authentication_info + * + * @return \Adyen\Model\Checkout\ThreeDSRequestorPriorAuthenticationInfo|null + */ + public function getThreeDsRequestorPriorAuthenticationInfo() + { + return $this->container['three_ds_requestor_prior_authentication_info']; + } + + /** + * Sets three_ds_requestor_prior_authentication_info + * + * @param \Adyen\Model\Checkout\ThreeDSRequestorPriorAuthenticationInfo|null $three_ds_requestor_prior_authentication_info three_ds_requestor_prior_authentication_info + * + * @return self + */ + public function setThreeDsRequestorPriorAuthenticationInfo($three_ds_requestor_prior_authentication_info) + { + if (is_null($three_ds_requestor_prior_authentication_info)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_prior_authentication_info cannot be null'); + } + $this->container['three_ds_requestor_prior_authentication_info'] = $three_ds_requestor_prior_authentication_info; + + return $this; + } + + /** + * Gets three_ds_requestor_url + * + * @return string|null + */ + public function getThreeDsRequestorUrl() + { + return $this->container['three_ds_requestor_url']; + } + + /** + * Sets three_ds_requestor_url + * + * @param string|null $three_ds_requestor_url URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + * + * @return self + */ + public function setThreeDsRequestorUrl($three_ds_requestor_url) + { + if (is_null($three_ds_requestor_url)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_url cannot be null'); + } + $this->container['three_ds_requestor_url'] = $three_ds_requestor_url; + + return $this; + } + + /** + * Gets trans_type + * + * @return string|null + */ + public function getTransType() + { + return $this->container['trans_type']; + } + + /** + * Sets trans_type + * + * @param string|null $trans_type Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + * + * @return self + */ + public function setTransType($trans_type) + { + if (is_null($trans_type)) { + throw new \InvalidArgumentException('non-nullable trans_type cannot be null'); + } + $allowedValues = $this->getTransTypeAllowableValues(); + if (!in_array($trans_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'trans_type', must be one of '%s'", + $trans_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['trans_type'] = $trans_type; + + return $this; + } + + /** + * Gets transaction_type + * + * @return string|null + */ + public function getTransactionType() + { + return $this->container['transaction_type']; + } + + /** + * Sets transaction_type + * + * @param string|null $transaction_type Identify the type of the transaction being authenticated. + * + * @return self + */ + public function setTransactionType($transaction_type) + { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } + $allowedValues = $this->getTransactionTypeAllowableValues(); + if (!in_array($transaction_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'transaction_type', must be one of '%s'", + $transaction_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['transaction_type'] = $transaction_type; + + return $this; + } + + /** + * Gets white_list_status + * + * @return string|null + */ + public function getWhiteListStatus() + { + return $this->container['white_list_status']; + } + + /** + * Sets white_list_status + * + * @param string|null $white_list_status The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + * + * @return self + */ + public function setWhiteListStatus($white_list_status) + { + if (is_null($white_list_status)) { + throw new \InvalidArgumentException('non-nullable white_list_status cannot be null'); + } + $this->container['white_list_status'] = $white_list_status; + + return $this; + } + + /** + * Gets work_phone + * + * @return \Adyen\Model\Checkout\Phone|null + */ + public function getWorkPhone() + { + return $this->container['work_phone']; + } + + /** + * Sets work_phone + * + * @param \Adyen\Model\Checkout\Phone|null $work_phone work_phone + * + * @return self + */ + public function setWorkPhone($work_phone) + { + if (is_null($work_phone)) { + throw new \InvalidArgumentException('non-nullable work_phone cannot be null'); + } + $this->container['work_phone'] = $work_phone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDS2ResponseData.php b/src/Adyen/Model/Checkout/ThreeDS2ResponseData.php new file mode 100644 index 000000000..b8398803f --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDS2ResponseData.php @@ -0,0 +1,999 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ThreeDS2ResponseData Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ThreeDS2ResponseData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2ResponseData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acs_challenge_mandated' => 'string', + 'acs_operator_id' => 'string', + 'acs_reference_number' => 'string', + 'acs_signed_content' => 'string', + 'acs_trans_id' => 'string', + 'acs_url' => 'string', + 'authentication_type' => 'string', + 'card_holder_info' => 'string', + 'cavv_algorithm' => 'string', + 'challenge_indicator' => 'string', + 'ds_reference_number' => 'string', + 'ds_trans_id' => 'string', + 'exemption_indicator' => 'string', + 'message_version' => 'string', + 'risk_score' => 'string', + 'sdk_ephem_pub_key' => 'string', + 'three_ds_server_trans_id' => 'string', + 'trans_status' => 'string', + 'trans_status_reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acs_challenge_mandated' => null, + 'acs_operator_id' => null, + 'acs_reference_number' => null, + 'acs_signed_content' => null, + 'acs_trans_id' => null, + 'acs_url' => null, + 'authentication_type' => null, + 'card_holder_info' => null, + 'cavv_algorithm' => null, + 'challenge_indicator' => null, + 'ds_reference_number' => null, + 'ds_trans_id' => null, + 'exemption_indicator' => null, + 'message_version' => null, + 'risk_score' => null, + 'sdk_ephem_pub_key' => null, + 'three_ds_server_trans_id' => null, + 'trans_status' => null, + 'trans_status_reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acs_challenge_mandated' => false, + 'acs_operator_id' => false, + 'acs_reference_number' => false, + 'acs_signed_content' => false, + 'acs_trans_id' => false, + 'acs_url' => false, + 'authentication_type' => false, + 'card_holder_info' => false, + 'cavv_algorithm' => false, + 'challenge_indicator' => false, + 'ds_reference_number' => false, + 'ds_trans_id' => false, + 'exemption_indicator' => false, + 'message_version' => false, + 'risk_score' => false, + 'sdk_ephem_pub_key' => false, + 'three_ds_server_trans_id' => false, + 'trans_status' => false, + 'trans_status_reason' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acs_challenge_mandated' => 'acsChallengeMandated', + 'acs_operator_id' => 'acsOperatorID', + 'acs_reference_number' => 'acsReferenceNumber', + 'acs_signed_content' => 'acsSignedContent', + 'acs_trans_id' => 'acsTransID', + 'acs_url' => 'acsURL', + 'authentication_type' => 'authenticationType', + 'card_holder_info' => 'cardHolderInfo', + 'cavv_algorithm' => 'cavvAlgorithm', + 'challenge_indicator' => 'challengeIndicator', + 'ds_reference_number' => 'dsReferenceNumber', + 'ds_trans_id' => 'dsTransID', + 'exemption_indicator' => 'exemptionIndicator', + 'message_version' => 'messageVersion', + 'risk_score' => 'riskScore', + 'sdk_ephem_pub_key' => 'sdkEphemPubKey', + 'three_ds_server_trans_id' => 'threeDSServerTransID', + 'trans_status' => 'transStatus', + 'trans_status_reason' => 'transStatusReason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acs_challenge_mandated' => 'setAcsChallengeMandated', + 'acs_operator_id' => 'setAcsOperatorId', + 'acs_reference_number' => 'setAcsReferenceNumber', + 'acs_signed_content' => 'setAcsSignedContent', + 'acs_trans_id' => 'setAcsTransId', + 'acs_url' => 'setAcsUrl', + 'authentication_type' => 'setAuthenticationType', + 'card_holder_info' => 'setCardHolderInfo', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'challenge_indicator' => 'setChallengeIndicator', + 'ds_reference_number' => 'setDsReferenceNumber', + 'ds_trans_id' => 'setDsTransId', + 'exemption_indicator' => 'setExemptionIndicator', + 'message_version' => 'setMessageVersion', + 'risk_score' => 'setRiskScore', + 'sdk_ephem_pub_key' => 'setSdkEphemPubKey', + 'three_ds_server_trans_id' => 'setThreeDsServerTransId', + 'trans_status' => 'setTransStatus', + 'trans_status_reason' => 'setTransStatusReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acs_challenge_mandated' => 'getAcsChallengeMandated', + 'acs_operator_id' => 'getAcsOperatorId', + 'acs_reference_number' => 'getAcsReferenceNumber', + 'acs_signed_content' => 'getAcsSignedContent', + 'acs_trans_id' => 'getAcsTransId', + 'acs_url' => 'getAcsUrl', + 'authentication_type' => 'getAuthenticationType', + 'card_holder_info' => 'getCardHolderInfo', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'challenge_indicator' => 'getChallengeIndicator', + 'ds_reference_number' => 'getDsReferenceNumber', + 'ds_trans_id' => 'getDsTransId', + 'exemption_indicator' => 'getExemptionIndicator', + 'message_version' => 'getMessageVersion', + 'risk_score' => 'getRiskScore', + 'sdk_ephem_pub_key' => 'getSdkEphemPubKey', + 'three_ds_server_trans_id' => 'getThreeDsServerTransId', + 'trans_status' => 'getTransStatus', + 'trans_status_reason' => 'getTransStatusReason' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('acs_challenge_mandated', $data ?? [], null); + $this->setIfExists('acs_operator_id', $data ?? [], null); + $this->setIfExists('acs_reference_number', $data ?? [], null); + $this->setIfExists('acs_signed_content', $data ?? [], null); + $this->setIfExists('acs_trans_id', $data ?? [], null); + $this->setIfExists('acs_url', $data ?? [], null); + $this->setIfExists('authentication_type', $data ?? [], null); + $this->setIfExists('card_holder_info', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('challenge_indicator', $data ?? [], null); + $this->setIfExists('ds_reference_number', $data ?? [], null); + $this->setIfExists('ds_trans_id', $data ?? [], null); + $this->setIfExists('exemption_indicator', $data ?? [], null); + $this->setIfExists('message_version', $data ?? [], null); + $this->setIfExists('risk_score', $data ?? [], null); + $this->setIfExists('sdk_ephem_pub_key', $data ?? [], null); + $this->setIfExists('three_ds_server_trans_id', $data ?? [], null); + $this->setIfExists('trans_status', $data ?? [], null); + $this->setIfExists('trans_status_reason', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets acs_challenge_mandated + * + * @return string|null + */ + public function getAcsChallengeMandated() + { + return $this->container['acs_challenge_mandated']; + } + + /** + * Sets acs_challenge_mandated + * + * @param string|null $acs_challenge_mandated acs_challenge_mandated + * + * @return self + */ + public function setAcsChallengeMandated($acs_challenge_mandated) + { + if (is_null($acs_challenge_mandated)) { + throw new \InvalidArgumentException('non-nullable acs_challenge_mandated cannot be null'); + } + $this->container['acs_challenge_mandated'] = $acs_challenge_mandated; + + return $this; + } + + /** + * Gets acs_operator_id + * + * @return string|null + */ + public function getAcsOperatorId() + { + return $this->container['acs_operator_id']; + } + + /** + * Sets acs_operator_id + * + * @param string|null $acs_operator_id acs_operator_id + * + * @return self + */ + public function setAcsOperatorId($acs_operator_id) + { + if (is_null($acs_operator_id)) { + throw new \InvalidArgumentException('non-nullable acs_operator_id cannot be null'); + } + $this->container['acs_operator_id'] = $acs_operator_id; + + return $this; + } + + /** + * Gets acs_reference_number + * + * @return string|null + */ + public function getAcsReferenceNumber() + { + return $this->container['acs_reference_number']; + } + + /** + * Sets acs_reference_number + * + * @param string|null $acs_reference_number acs_reference_number + * + * @return self + */ + public function setAcsReferenceNumber($acs_reference_number) + { + if (is_null($acs_reference_number)) { + throw new \InvalidArgumentException('non-nullable acs_reference_number cannot be null'); + } + $this->container['acs_reference_number'] = $acs_reference_number; + + return $this; + } + + /** + * Gets acs_signed_content + * + * @return string|null + */ + public function getAcsSignedContent() + { + return $this->container['acs_signed_content']; + } + + /** + * Sets acs_signed_content + * + * @param string|null $acs_signed_content acs_signed_content + * + * @return self + */ + public function setAcsSignedContent($acs_signed_content) + { + if (is_null($acs_signed_content)) { + throw new \InvalidArgumentException('non-nullable acs_signed_content cannot be null'); + } + $this->container['acs_signed_content'] = $acs_signed_content; + + return $this; + } + + /** + * Gets acs_trans_id + * + * @return string|null + */ + public function getAcsTransId() + { + return $this->container['acs_trans_id']; + } + + /** + * Sets acs_trans_id + * + * @param string|null $acs_trans_id acs_trans_id + * + * @return self + */ + public function setAcsTransId($acs_trans_id) + { + if (is_null($acs_trans_id)) { + throw new \InvalidArgumentException('non-nullable acs_trans_id cannot be null'); + } + $this->container['acs_trans_id'] = $acs_trans_id; + + return $this; + } + + /** + * Gets acs_url + * + * @return string|null + */ + public function getAcsUrl() + { + return $this->container['acs_url']; + } + + /** + * Sets acs_url + * + * @param string|null $acs_url acs_url + * + * @return self + */ + public function setAcsUrl($acs_url) + { + if (is_null($acs_url)) { + throw new \InvalidArgumentException('non-nullable acs_url cannot be null'); + } + $this->container['acs_url'] = $acs_url; + + return $this; + } + + /** + * Gets authentication_type + * + * @return string|null + */ + public function getAuthenticationType() + { + return $this->container['authentication_type']; + } + + /** + * Sets authentication_type + * + * @param string|null $authentication_type authentication_type + * + * @return self + */ + public function setAuthenticationType($authentication_type) + { + if (is_null($authentication_type)) { + throw new \InvalidArgumentException('non-nullable authentication_type cannot be null'); + } + $this->container['authentication_type'] = $authentication_type; + + return $this; + } + + /** + * Gets card_holder_info + * + * @return string|null + */ + public function getCardHolderInfo() + { + return $this->container['card_holder_info']; + } + + /** + * Sets card_holder_info + * + * @param string|null $card_holder_info card_holder_info + * + * @return self + */ + public function setCardHolderInfo($card_holder_info) + { + if (is_null($card_holder_info)) { + throw new \InvalidArgumentException('non-nullable card_holder_info cannot be null'); + } + $this->container['card_holder_info'] = $card_holder_info; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm cavv_algorithm + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets challenge_indicator + * + * @return string|null + */ + public function getChallengeIndicator() + { + return $this->container['challenge_indicator']; + } + + /** + * Sets challenge_indicator + * + * @param string|null $challenge_indicator challenge_indicator + * + * @return self + */ + public function setChallengeIndicator($challenge_indicator) + { + if (is_null($challenge_indicator)) { + throw new \InvalidArgumentException('non-nullable challenge_indicator cannot be null'); + } + $this->container['challenge_indicator'] = $challenge_indicator; + + return $this; + } + + /** + * Gets ds_reference_number + * + * @return string|null + */ + public function getDsReferenceNumber() + { + return $this->container['ds_reference_number']; + } + + /** + * Sets ds_reference_number + * + * @param string|null $ds_reference_number ds_reference_number + * + * @return self + */ + public function setDsReferenceNumber($ds_reference_number) + { + if (is_null($ds_reference_number)) { + throw new \InvalidArgumentException('non-nullable ds_reference_number cannot be null'); + } + $this->container['ds_reference_number'] = $ds_reference_number; + + return $this; + } + + /** + * Gets ds_trans_id + * + * @return string|null + */ + public function getDsTransId() + { + return $this->container['ds_trans_id']; + } + + /** + * Sets ds_trans_id + * + * @param string|null $ds_trans_id ds_trans_id + * + * @return self + */ + public function setDsTransId($ds_trans_id) + { + if (is_null($ds_trans_id)) { + throw new \InvalidArgumentException('non-nullable ds_trans_id cannot be null'); + } + $this->container['ds_trans_id'] = $ds_trans_id; + + return $this; + } + + /** + * Gets exemption_indicator + * + * @return string|null + */ + public function getExemptionIndicator() + { + return $this->container['exemption_indicator']; + } + + /** + * Sets exemption_indicator + * + * @param string|null $exemption_indicator exemption_indicator + * + * @return self + */ + public function setExemptionIndicator($exemption_indicator) + { + if (is_null($exemption_indicator)) { + throw new \InvalidArgumentException('non-nullable exemption_indicator cannot be null'); + } + $this->container['exemption_indicator'] = $exemption_indicator; + + return $this; + } + + /** + * Gets message_version + * + * @return string|null + */ + public function getMessageVersion() + { + return $this->container['message_version']; + } + + /** + * Sets message_version + * + * @param string|null $message_version message_version + * + * @return self + */ + public function setMessageVersion($message_version) + { + if (is_null($message_version)) { + throw new \InvalidArgumentException('non-nullable message_version cannot be null'); + } + $this->container['message_version'] = $message_version; + + return $this; + } + + /** + * Gets risk_score + * + * @return string|null + */ + public function getRiskScore() + { + return $this->container['risk_score']; + } + + /** + * Sets risk_score + * + * @param string|null $risk_score risk_score + * + * @return self + */ + public function setRiskScore($risk_score) + { + if (is_null($risk_score)) { + throw new \InvalidArgumentException('non-nullable risk_score cannot be null'); + } + $this->container['risk_score'] = $risk_score; + + return $this; + } + + /** + * Gets sdk_ephem_pub_key + * + * @return string|null + */ + public function getSdkEphemPubKey() + { + return $this->container['sdk_ephem_pub_key']; + } + + /** + * Sets sdk_ephem_pub_key + * + * @param string|null $sdk_ephem_pub_key sdk_ephem_pub_key + * + * @return self + */ + public function setSdkEphemPubKey($sdk_ephem_pub_key) + { + if (is_null($sdk_ephem_pub_key)) { + throw new \InvalidArgumentException('non-nullable sdk_ephem_pub_key cannot be null'); + } + $this->container['sdk_ephem_pub_key'] = $sdk_ephem_pub_key; + + return $this; + } + + /** + * Gets three_ds_server_trans_id + * + * @return string|null + */ + public function getThreeDsServerTransId() + { + return $this->container['three_ds_server_trans_id']; + } + + /** + * Sets three_ds_server_trans_id + * + * @param string|null $three_ds_server_trans_id three_ds_server_trans_id + * + * @return self + */ + public function setThreeDsServerTransId($three_ds_server_trans_id) + { + if (is_null($three_ds_server_trans_id)) { + throw new \InvalidArgumentException('non-nullable three_ds_server_trans_id cannot be null'); + } + $this->container['three_ds_server_trans_id'] = $three_ds_server_trans_id; + + return $this; + } + + /** + * Gets trans_status + * + * @return string|null + */ + public function getTransStatus() + { + return $this->container['trans_status']; + } + + /** + * Sets trans_status + * + * @param string|null $trans_status trans_status + * + * @return self + */ + public function setTransStatus($trans_status) + { + if (is_null($trans_status)) { + throw new \InvalidArgumentException('non-nullable trans_status cannot be null'); + } + $this->container['trans_status'] = $trans_status; + + return $this; + } + + /** + * Gets trans_status_reason + * + * @return string|null + */ + public function getTransStatusReason() + { + return $this->container['trans_status_reason']; + } + + /** + * Sets trans_status_reason + * + * @param string|null $trans_status_reason trans_status_reason + * + * @return self + */ + public function setTransStatusReason($trans_status_reason) + { + if (is_null($trans_status_reason)) { + throw new \InvalidArgumentException('non-nullable trans_status_reason cannot be null'); + } + $this->container['trans_status_reason'] = $trans_status_reason; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDS2Result.php b/src/Adyen/Model/Checkout/ThreeDS2Result.php new file mode 100644 index 000000000..6447cbe45 --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDS2Result.php @@ -0,0 +1,946 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ThreeDS2Result Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2Result'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication_value' => 'string', + 'cavv_algorithm' => 'string', + 'challenge_cancel' => 'string', + 'challenge_indicator' => 'string', + 'ds_trans_id' => 'string', + 'eci' => 'string', + 'exemption_indicator' => 'string', + 'message_version' => 'string', + 'risk_score' => 'string', + 'three_ds_server_trans_id' => 'string', + 'timestamp' => 'string', + 'trans_status' => 'string', + 'trans_status_reason' => 'string', + 'white_list_status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication_value' => null, + 'cavv_algorithm' => null, + 'challenge_cancel' => null, + 'challenge_indicator' => null, + 'ds_trans_id' => null, + 'eci' => null, + 'exemption_indicator' => null, + 'message_version' => null, + 'risk_score' => null, + 'three_ds_server_trans_id' => null, + 'timestamp' => null, + 'trans_status' => null, + 'trans_status_reason' => null, + 'white_list_status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication_value' => false, + 'cavv_algorithm' => false, + 'challenge_cancel' => false, + 'challenge_indicator' => false, + 'ds_trans_id' => false, + 'eci' => false, + 'exemption_indicator' => false, + 'message_version' => false, + 'risk_score' => false, + 'three_ds_server_trans_id' => false, + 'timestamp' => false, + 'trans_status' => false, + 'trans_status_reason' => false, + 'white_list_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication_value' => 'authenticationValue', + 'cavv_algorithm' => 'cavvAlgorithm', + 'challenge_cancel' => 'challengeCancel', + 'challenge_indicator' => 'challengeIndicator', + 'ds_trans_id' => 'dsTransID', + 'eci' => 'eci', + 'exemption_indicator' => 'exemptionIndicator', + 'message_version' => 'messageVersion', + 'risk_score' => 'riskScore', + 'three_ds_server_trans_id' => 'threeDSServerTransID', + 'timestamp' => 'timestamp', + 'trans_status' => 'transStatus', + 'trans_status_reason' => 'transStatusReason', + 'white_list_status' => 'whiteListStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication_value' => 'setAuthenticationValue', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'challenge_cancel' => 'setChallengeCancel', + 'challenge_indicator' => 'setChallengeIndicator', + 'ds_trans_id' => 'setDsTransId', + 'eci' => 'setEci', + 'exemption_indicator' => 'setExemptionIndicator', + 'message_version' => 'setMessageVersion', + 'risk_score' => 'setRiskScore', + 'three_ds_server_trans_id' => 'setThreeDsServerTransId', + 'timestamp' => 'setTimestamp', + 'trans_status' => 'setTransStatus', + 'trans_status_reason' => 'setTransStatusReason', + 'white_list_status' => 'setWhiteListStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication_value' => 'getAuthenticationValue', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'challenge_cancel' => 'getChallengeCancel', + 'challenge_indicator' => 'getChallengeIndicator', + 'ds_trans_id' => 'getDsTransId', + 'eci' => 'getEci', + 'exemption_indicator' => 'getExemptionIndicator', + 'message_version' => 'getMessageVersion', + 'risk_score' => 'getRiskScore', + 'three_ds_server_trans_id' => 'getThreeDsServerTransId', + 'timestamp' => 'getTimestamp', + 'trans_status' => 'getTransStatus', + 'trans_status_reason' => 'getTransStatusReason', + 'white_list_status' => 'getWhiteListStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHALLENGE_CANCEL__01 = '01'; + public const CHALLENGE_CANCEL__02 = '02'; + public const CHALLENGE_CANCEL__03 = '03'; + public const CHALLENGE_CANCEL__04 = '04'; + public const CHALLENGE_CANCEL__05 = '05'; + public const CHALLENGE_CANCEL__06 = '06'; + public const CHALLENGE_CANCEL__07 = '07'; + public const CHALLENGE_INDICATOR_NO_PREFERENCE = 'noPreference'; + public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; + public const EXEMPTION_INDICATOR_LOW_VALUE = 'lowValue'; + public const EXEMPTION_INDICATOR_SECURE_CORPORATE = 'secureCorporate'; + public const EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY = 'trustedBeneficiary'; + public const EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS = 'transactionRiskAnalysis'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeCancelAllowableValues() + { + return [ + self::CHALLENGE_CANCEL__01, + self::CHALLENGE_CANCEL__02, + self::CHALLENGE_CANCEL__03, + self::CHALLENGE_CANCEL__04, + self::CHALLENGE_CANCEL__05, + self::CHALLENGE_CANCEL__06, + self::CHALLENGE_CANCEL__07, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeIndicatorAllowableValues() + { + return [ + self::CHALLENGE_INDICATOR_NO_PREFERENCE, + self::CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExemptionIndicatorAllowableValues() + { + return [ + self::EXEMPTION_INDICATOR_LOW_VALUE, + self::EXEMPTION_INDICATOR_SECURE_CORPORATE, + self::EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY, + self::EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication_value', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('challenge_cancel', $data ?? [], null); + $this->setIfExists('challenge_indicator', $data ?? [], null); + $this->setIfExists('ds_trans_id', $data ?? [], null); + $this->setIfExists('eci', $data ?? [], null); + $this->setIfExists('exemption_indicator', $data ?? [], null); + $this->setIfExists('message_version', $data ?? [], null); + $this->setIfExists('risk_score', $data ?? [], null); + $this->setIfExists('three_ds_server_trans_id', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('trans_status', $data ?? [], null); + $this->setIfExists('trans_status_reason', $data ?? [], null); + $this->setIfExists('white_list_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!is_null($this->container['challenge_cancel']) && !in_array($this->container['challenge_cancel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $this->container['challenge_cancel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!is_null($this->container['challenge_indicator']) && !in_array($this->container['challenge_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $this->container['challenge_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!is_null($this->container['exemption_indicator']) && !in_array($this->container['exemption_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exemption_indicator', must be one of '%s'", + $this->container['exemption_indicator'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication_value + * + * @return string|null + */ + public function getAuthenticationValue() + { + return $this->container['authentication_value']; + } + + /** + * Sets authentication_value + * + * @param string|null $authentication_value The `authenticationValue` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setAuthenticationValue($authentication_value) + { + if (is_null($authentication_value)) { + throw new \InvalidArgumentException('non-nullable authentication_value cannot be null'); + } + $this->container['authentication_value'] = $authentication_value; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets challenge_cancel + * + * @return string|null + */ + public function getChallengeCancel() + { + return $this->container['challenge_cancel']; + } + + /** + * Sets challenge_cancel + * + * @param string|null $challenge_cancel Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + * + * @return self + */ + public function setChallengeCancel($challenge_cancel) + { + if (is_null($challenge_cancel)) { + throw new \InvalidArgumentException('non-nullable challenge_cancel cannot be null'); + } + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!in_array($challenge_cancel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $challenge_cancel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_cancel'] = $challenge_cancel; + + return $this; + } + + /** + * Gets challenge_indicator + * + * @return string|null + */ + public function getChallengeIndicator() + { + return $this->container['challenge_indicator']; + } + + /** + * Sets challenge_indicator + * + * @param string|null $challenge_indicator Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + * + * @return self + */ + public function setChallengeIndicator($challenge_indicator) + { + if (is_null($challenge_indicator)) { + throw new \InvalidArgumentException('non-nullable challenge_indicator cannot be null'); + } + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!in_array($challenge_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $challenge_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_indicator'] = $challenge_indicator; + + return $this; + } + + /** + * Gets ds_trans_id + * + * @return string|null + */ + public function getDsTransId() + { + return $this->container['ds_trans_id']; + } + + /** + * Sets ds_trans_id + * + * @param string|null $ds_trans_id The `dsTransID` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setDsTransId($ds_trans_id) + { + if (is_null($ds_trans_id)) { + throw new \InvalidArgumentException('non-nullable ds_trans_id cannot be null'); + } + $this->container['ds_trans_id'] = $ds_trans_id; + + return $this; + } + + /** + * Gets eci + * + * @return string|null + */ + public function getEci() + { + return $this->container['eci']; + } + + /** + * Sets eci + * + * @param string|null $eci The `eci` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setEci($eci) + { + if (is_null($eci)) { + throw new \InvalidArgumentException('non-nullable eci cannot be null'); + } + $this->container['eci'] = $eci; + + return $this; + } + + /** + * Gets exemption_indicator + * + * @return string|null + */ + public function getExemptionIndicator() + { + return $this->container['exemption_indicator']; + } + + /** + * Sets exemption_indicator + * + * @param string|null $exemption_indicator Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + * + * @return self + */ + public function setExemptionIndicator($exemption_indicator) + { + if (is_null($exemption_indicator)) { + throw new \InvalidArgumentException('non-nullable exemption_indicator cannot be null'); + } + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!in_array($exemption_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exemption_indicator', must be one of '%s'", + $exemption_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exemption_indicator'] = $exemption_indicator; + + return $this; + } + + /** + * Gets message_version + * + * @return string|null + */ + public function getMessageVersion() + { + return $this->container['message_version']; + } + + /** + * Sets message_version + * + * @param string|null $message_version The `messageVersion` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setMessageVersion($message_version) + { + if (is_null($message_version)) { + throw new \InvalidArgumentException('non-nullable message_version cannot be null'); + } + $this->container['message_version'] = $message_version; + + return $this; + } + + /** + * Gets risk_score + * + * @return string|null + */ + public function getRiskScore() + { + return $this->container['risk_score']; + } + + /** + * Sets risk_score + * + * @param string|null $risk_score Risk score calculated by Cartes Bancaires Directory Server (DS). + * + * @return self + */ + public function setRiskScore($risk_score) + { + if (is_null($risk_score)) { + throw new \InvalidArgumentException('non-nullable risk_score cannot be null'); + } + $this->container['risk_score'] = $risk_score; + + return $this; + } + + /** + * Gets three_ds_server_trans_id + * + * @return string|null + */ + public function getThreeDsServerTransId() + { + return $this->container['three_ds_server_trans_id']; + } + + /** + * Sets three_ds_server_trans_id + * + * @param string|null $three_ds_server_trans_id The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setThreeDsServerTransId($three_ds_server_trans_id) + { + if (is_null($three_ds_server_trans_id)) { + throw new \InvalidArgumentException('non-nullable three_ds_server_trans_id cannot be null'); + } + $this->container['three_ds_server_trans_id'] = $three_ds_server_trans_id; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The `timestamp` value of the 3D Secure 2 authentication. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets trans_status + * + * @return string|null + */ + public function getTransStatus() + { + return $this->container['trans_status']; + } + + /** + * Sets trans_status + * + * @param string|null $trans_status The `transStatus` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setTransStatus($trans_status) + { + if (is_null($trans_status)) { + throw new \InvalidArgumentException('non-nullable trans_status cannot be null'); + } + $this->container['trans_status'] = $trans_status; + + return $this; + } + + /** + * Gets trans_status_reason + * + * @return string|null + */ + public function getTransStatusReason() + { + return $this->container['trans_status_reason']; + } + + /** + * Sets trans_status_reason + * + * @param string|null $trans_status_reason Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + * + * @return self + */ + public function setTransStatusReason($trans_status_reason) + { + if (is_null($trans_status_reason)) { + throw new \InvalidArgumentException('non-nullable trans_status_reason cannot be null'); + } + $this->container['trans_status_reason'] = $trans_status_reason; + + return $this; + } + + /** + * Gets white_list_status + * + * @return string|null + */ + public function getWhiteListStatus() + { + return $this->container['white_list_status']; + } + + /** + * Sets white_list_status + * + * @param string|null $white_list_status The `whiteListStatus` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setWhiteListStatus($white_list_status) + { + if (is_null($white_list_status)) { + throw new \InvalidArgumentException('non-nullable white_list_status cannot be null'); + } + $this->container['white_list_status'] = $white_list_status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestData.php b/src/Adyen/Model/Checkout/ThreeDSRequestData.php new file mode 100644 index 000000000..fb9ca12b5 --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDSRequestData.php @@ -0,0 +1,625 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ThreeDSRequestData Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ThreeDSRequestData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDSRequestData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'challenge_window_size' => 'string', + 'data_only' => 'string', + 'native_three_ds' => 'string', + 'three_ds_version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'challenge_window_size' => null, + 'data_only' => null, + 'native_three_ds' => null, + 'three_ds_version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'challenge_window_size' => false, + 'data_only' => false, + 'native_three_ds' => false, + 'three_ds_version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'challenge_window_size' => 'challengeWindowSize', + 'data_only' => 'dataOnly', + 'native_three_ds' => 'nativeThreeDS', + 'three_ds_version' => 'threeDSVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'challenge_window_size' => 'setChallengeWindowSize', + 'data_only' => 'setDataOnly', + 'native_three_ds' => 'setNativeThreeDs', + 'three_ds_version' => 'setThreeDsVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'challenge_window_size' => 'getChallengeWindowSize', + 'data_only' => 'getDataOnly', + 'native_three_ds' => 'getNativeThreeDs', + 'three_ds_version' => 'getThreeDsVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHALLENGE_WINDOW_SIZE__01 = '01'; + public const CHALLENGE_WINDOW_SIZE__02 = '02'; + public const CHALLENGE_WINDOW_SIZE__03 = '03'; + public const CHALLENGE_WINDOW_SIZE__04 = '04'; + public const CHALLENGE_WINDOW_SIZE__05 = '05'; + public const DATA_ONLY_FALSE = 'false'; + public const DATA_ONLY_TRUE = 'true'; + public const NATIVE_THREE_DS_PREFERRED = 'preferred'; + public const THREE_DS_VERSION__1_0 = '2.1.0'; + public const THREE_DS_VERSION__2_0 = '2.2.0'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeWindowSizeAllowableValues() + { + return [ + self::CHALLENGE_WINDOW_SIZE__01, + self::CHALLENGE_WINDOW_SIZE__02, + self::CHALLENGE_WINDOW_SIZE__03, + self::CHALLENGE_WINDOW_SIZE__04, + self::CHALLENGE_WINDOW_SIZE__05, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDataOnlyAllowableValues() + { + return [ + self::DATA_ONLY_FALSE, + self::DATA_ONLY_TRUE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNativeThreeDsAllowableValues() + { + return [ + self::NATIVE_THREE_DS_PREFERRED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDsVersionAllowableValues() + { + return [ + self::THREE_DS_VERSION__1_0, + self::THREE_DS_VERSION__2_0, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('challenge_window_size', $data ?? [], null); + $this->setIfExists('data_only', $data ?? [], null); + $this->setIfExists('native_three_ds', $data ?? [], null); + $this->setIfExists('three_ds_version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChallengeWindowSizeAllowableValues(); + if (!is_null($this->container['challenge_window_size']) && !in_array($this->container['challenge_window_size'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_window_size', must be one of '%s'", + $this->container['challenge_window_size'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDataOnlyAllowableValues(); + if (!is_null($this->container['data_only']) && !in_array($this->container['data_only'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'data_only', must be one of '%s'", + $this->container['data_only'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getNativeThreeDsAllowableValues(); + if (!is_null($this->container['native_three_ds']) && !in_array($this->container['native_three_ds'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'native_three_ds', must be one of '%s'", + $this->container['native_three_ds'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getThreeDsVersionAllowableValues(); + if (!is_null($this->container['three_ds_version']) && !in_array($this->container['three_ds_version'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'three_ds_version', must be one of '%s'", + $this->container['three_ds_version'], + 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 challenge_window_size + * + * @return string|null + */ + public function getChallengeWindowSize() + { + return $this->container['challenge_window_size']; + } + + /** + * Sets challenge_window_size + * + * @param string|null $challenge_window_size Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen + * + * @return self + */ + public function setChallengeWindowSize($challenge_window_size) + { + if (is_null($challenge_window_size)) { + throw new \InvalidArgumentException('non-nullable challenge_window_size cannot be null'); + } + $allowedValues = $this->getChallengeWindowSizeAllowableValues(); + if (!in_array($challenge_window_size, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_window_size', must be one of '%s'", + $challenge_window_size, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_window_size'] = $challenge_window_size; + + return $this; + } + + /** + * Gets data_only + * + * @return string|null + */ + public function getDataOnly() + { + return $this->container['data_only']; + } + + /** + * Sets data_only + * + * @param string|null $data_only Flag for data only flow. + * + * @return self + */ + public function setDataOnly($data_only) + { + if (is_null($data_only)) { + throw new \InvalidArgumentException('non-nullable data_only cannot be null'); + } + $allowedValues = $this->getDataOnlyAllowableValues(); + if (!in_array($data_only, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'data_only', must be one of '%s'", + $data_only, + implode("', '", $allowedValues) + ) + ); + } + $this->container['data_only'] = $data_only; + + return $this; + } + + /** + * Gets native_three_ds + * + * @return string|null + */ + public function getNativeThreeDs() + { + return $this->container['native_three_ds']; + } + + /** + * Sets native_three_ds + * + * @param string|null $native_three_ds Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. + * + * @return self + */ + public function setNativeThreeDs($native_three_ds) + { + if (is_null($native_three_ds)) { + throw new \InvalidArgumentException('non-nullable native_three_ds cannot be null'); + } + $allowedValues = $this->getNativeThreeDsAllowableValues(); + if (!in_array($native_three_ds, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'native_three_ds', must be one of '%s'", + $native_three_ds, + implode("', '", $allowedValues) + ) + ); + } + $this->container['native_three_ds'] = $native_three_ds; + + return $this; + } + + /** + * Gets three_ds_version + * + * @return string|null + */ + public function getThreeDsVersion() + { + return $this->container['three_ds_version']; + } + + /** + * Sets three_ds_version + * + * @param string|null $three_ds_version The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** + * + * @return self + */ + public function setThreeDsVersion($three_ds_version) + { + if (is_null($three_ds_version)) { + throw new \InvalidArgumentException('non-nullable three_ds_version cannot be null'); + } + $allowedValues = $this->getThreeDsVersionAllowableValues(); + if (!in_array($three_ds_version, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'three_ds_version', must be one of '%s'", + $three_ds_version, + implode("', '", $allowedValues) + ) + ); + } + $this->container['three_ds_version'] = $three_ds_version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php b/src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php new file mode 100644 index 000000000..074bbe5dd --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.php @@ -0,0 +1,496 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ThreeDSRequestorAuthenticationInfo Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ThreeDSRequestorAuthenticationInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDSRequestorAuthenticationInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'three_ds_req_auth_data' => 'string', + 'three_ds_req_auth_method' => 'string', + 'three_ds_req_auth_timestamp' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'three_ds_req_auth_data' => null, + 'three_ds_req_auth_method' => null, + 'three_ds_req_auth_timestamp' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'three_ds_req_auth_data' => false, + 'three_ds_req_auth_method' => false, + 'three_ds_req_auth_timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'three_ds_req_auth_data' => 'threeDSReqAuthData', + 'three_ds_req_auth_method' => 'threeDSReqAuthMethod', + 'three_ds_req_auth_timestamp' => 'threeDSReqAuthTimestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'three_ds_req_auth_data' => 'setThreeDsReqAuthData', + 'three_ds_req_auth_method' => 'setThreeDsReqAuthMethod', + 'three_ds_req_auth_timestamp' => 'setThreeDsReqAuthTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'three_ds_req_auth_data' => 'getThreeDsReqAuthData', + 'three_ds_req_auth_method' => 'getThreeDsReqAuthMethod', + 'three_ds_req_auth_timestamp' => 'getThreeDsReqAuthTimestamp' + ]; + + /** + * 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 THREE_DS_REQ_AUTH_METHOD__01 = '01'; + public const THREE_DS_REQ_AUTH_METHOD__02 = '02'; + public const THREE_DS_REQ_AUTH_METHOD__03 = '03'; + public const THREE_DS_REQ_AUTH_METHOD__04 = '04'; + public const THREE_DS_REQ_AUTH_METHOD__05 = '05'; + public const THREE_DS_REQ_AUTH_METHOD__06 = '06'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDsReqAuthMethodAllowableValues() + { + return [ + self::THREE_DS_REQ_AUTH_METHOD__01, + self::THREE_DS_REQ_AUTH_METHOD__02, + self::THREE_DS_REQ_AUTH_METHOD__03, + self::THREE_DS_REQ_AUTH_METHOD__04, + self::THREE_DS_REQ_AUTH_METHOD__05, + self::THREE_DS_REQ_AUTH_METHOD__06, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('three_ds_req_auth_data', $data ?? [], null); + $this->setIfExists('three_ds_req_auth_method', $data ?? [], null); + $this->setIfExists('three_ds_req_auth_timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getThreeDsReqAuthMethodAllowableValues(); + if (!is_null($this->container['three_ds_req_auth_method']) && !in_array($this->container['three_ds_req_auth_method'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'three_ds_req_auth_method', must be one of '%s'", + $this->container['three_ds_req_auth_method'], + 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 three_ds_req_auth_data + * + * @return string|null + */ + public function getThreeDsReqAuthData() + { + return $this->container['three_ds_req_auth_data']; + } + + /** + * Sets three_ds_req_auth_data + * + * @param string|null $three_ds_req_auth_data Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + * + * @return self + */ + public function setThreeDsReqAuthData($three_ds_req_auth_data) + { + if (is_null($three_ds_req_auth_data)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_auth_data cannot be null'); + } + $this->container['three_ds_req_auth_data'] = $three_ds_req_auth_data; + + return $this; + } + + /** + * Gets three_ds_req_auth_method + * + * @return string|null + */ + public function getThreeDsReqAuthMethod() + { + return $this->container['three_ds_req_auth_method']; + } + + /** + * Sets three_ds_req_auth_method + * + * @param string|null $three_ds_req_auth_method Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. + * + * @return self + */ + public function setThreeDsReqAuthMethod($three_ds_req_auth_method) + { + if (is_null($three_ds_req_auth_method)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_auth_method cannot be null'); + } + $allowedValues = $this->getThreeDsReqAuthMethodAllowableValues(); + if (!in_array($three_ds_req_auth_method, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'three_ds_req_auth_method', must be one of '%s'", + $three_ds_req_auth_method, + implode("', '", $allowedValues) + ) + ); + } + $this->container['three_ds_req_auth_method'] = $three_ds_req_auth_method; + + return $this; + } + + /** + * Gets three_ds_req_auth_timestamp + * + * @return string|null + */ + public function getThreeDsReqAuthTimestamp() + { + return $this->container['three_ds_req_auth_timestamp']; + } + + /** + * Sets three_ds_req_auth_timestamp + * + * @param string|null $three_ds_req_auth_timestamp Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM + * + * @return self + */ + public function setThreeDsReqAuthTimestamp($three_ds_req_auth_timestamp) + { + if (is_null($three_ds_req_auth_timestamp)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_auth_timestamp cannot be null'); + } + $this->container['three_ds_req_auth_timestamp'] = $three_ds_req_auth_timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php b/src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php new file mode 100644 index 000000000..a12465862 --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.php @@ -0,0 +1,526 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ThreeDSRequestorPriorAuthenticationInfo Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ThreeDSRequestorPriorAuthenticationInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDSRequestorPriorAuthenticationInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'three_ds_req_prior_auth_data' => 'string', + 'three_ds_req_prior_auth_method' => 'string', + 'three_ds_req_prior_auth_timestamp' => 'string', + 'three_ds_req_prior_ref' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'three_ds_req_prior_auth_data' => null, + 'three_ds_req_prior_auth_method' => null, + 'three_ds_req_prior_auth_timestamp' => null, + 'three_ds_req_prior_ref' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'three_ds_req_prior_auth_data' => false, + 'three_ds_req_prior_auth_method' => false, + 'three_ds_req_prior_auth_timestamp' => false, + 'three_ds_req_prior_ref' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'three_ds_req_prior_auth_data' => 'threeDSReqPriorAuthData', + 'three_ds_req_prior_auth_method' => 'threeDSReqPriorAuthMethod', + 'three_ds_req_prior_auth_timestamp' => 'threeDSReqPriorAuthTimestamp', + 'three_ds_req_prior_ref' => 'threeDSReqPriorRef' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'three_ds_req_prior_auth_data' => 'setThreeDsReqPriorAuthData', + 'three_ds_req_prior_auth_method' => 'setThreeDsReqPriorAuthMethod', + 'three_ds_req_prior_auth_timestamp' => 'setThreeDsReqPriorAuthTimestamp', + 'three_ds_req_prior_ref' => 'setThreeDsReqPriorRef' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'three_ds_req_prior_auth_data' => 'getThreeDsReqPriorAuthData', + 'three_ds_req_prior_auth_method' => 'getThreeDsReqPriorAuthMethod', + 'three_ds_req_prior_auth_timestamp' => 'getThreeDsReqPriorAuthTimestamp', + 'three_ds_req_prior_ref' => 'getThreeDsReqPriorRef' + ]; + + /** + * 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 THREE_DS_REQ_PRIOR_AUTH_METHOD__01 = '01'; + public const THREE_DS_REQ_PRIOR_AUTH_METHOD__02 = '02'; + public const THREE_DS_REQ_PRIOR_AUTH_METHOD__03 = '03'; + public const THREE_DS_REQ_PRIOR_AUTH_METHOD__04 = '04'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDsReqPriorAuthMethodAllowableValues() + { + return [ + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__01, + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__02, + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__03, + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__04, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('three_ds_req_prior_auth_data', $data ?? [], null); + $this->setIfExists('three_ds_req_prior_auth_method', $data ?? [], null); + $this->setIfExists('three_ds_req_prior_auth_timestamp', $data ?? [], null); + $this->setIfExists('three_ds_req_prior_ref', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getThreeDsReqPriorAuthMethodAllowableValues(); + if (!is_null($this->container['three_ds_req_prior_auth_method']) && !in_array($this->container['three_ds_req_prior_auth_method'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'three_ds_req_prior_auth_method', must be one of '%s'", + $this->container['three_ds_req_prior_auth_method'], + 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 three_ds_req_prior_auth_data + * + * @return string|null + */ + public function getThreeDsReqPriorAuthData() + { + return $this->container['three_ds_req_prior_auth_data']; + } + + /** + * Sets three_ds_req_prior_auth_data + * + * @param string|null $three_ds_req_prior_auth_data Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + * + * @return self + */ + public function setThreeDsReqPriorAuthData($three_ds_req_prior_auth_data) + { + if (is_null($three_ds_req_prior_auth_data)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_auth_data cannot be null'); + } + $this->container['three_ds_req_prior_auth_data'] = $three_ds_req_prior_auth_data; + + return $this; + } + + /** + * Gets three_ds_req_prior_auth_method + * + * @return string|null + */ + public function getThreeDsReqPriorAuthMethod() + { + return $this->container['three_ds_req_prior_auth_method']; + } + + /** + * Sets three_ds_req_prior_auth_method + * + * @param string|null $three_ds_req_prior_auth_method Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. + * + * @return self + */ + public function setThreeDsReqPriorAuthMethod($three_ds_req_prior_auth_method) + { + if (is_null($three_ds_req_prior_auth_method)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_auth_method cannot be null'); + } + $allowedValues = $this->getThreeDsReqPriorAuthMethodAllowableValues(); + if (!in_array($three_ds_req_prior_auth_method, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'three_ds_req_prior_auth_method', must be one of '%s'", + $three_ds_req_prior_auth_method, + implode("', '", $allowedValues) + ) + ); + } + $this->container['three_ds_req_prior_auth_method'] = $three_ds_req_prior_auth_method; + + return $this; + } + + /** + * Gets three_ds_req_prior_auth_timestamp + * + * @return string|null + */ + public function getThreeDsReqPriorAuthTimestamp() + { + return $this->container['three_ds_req_prior_auth_timestamp']; + } + + /** + * Sets three_ds_req_prior_auth_timestamp + * + * @param string|null $three_ds_req_prior_auth_timestamp Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM + * + * @return self + */ + public function setThreeDsReqPriorAuthTimestamp($three_ds_req_prior_auth_timestamp) + { + if (is_null($three_ds_req_prior_auth_timestamp)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_auth_timestamp cannot be null'); + } + $this->container['three_ds_req_prior_auth_timestamp'] = $three_ds_req_prior_auth_timestamp; + + return $this; + } + + /** + * Gets three_ds_req_prior_ref + * + * @return string|null + */ + public function getThreeDsReqPriorRef() + { + return $this->container['three_ds_req_prior_ref']; + } + + /** + * Sets three_ds_req_prior_ref + * + * @param string|null $three_ds_req_prior_ref This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. + * + * @return self + */ + public function setThreeDsReqPriorRef($three_ds_req_prior_ref) + { + if (is_null($three_ds_req_prior_ref)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_ref cannot be null'); + } + $this->container['three_ds_req_prior_ref'] = $three_ds_req_prior_ref; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ThreeDSecureData.php b/src/Adyen/Model/Checkout/ThreeDSecureData.php new file mode 100644 index 000000000..76fdd98ec --- /dev/null +++ b/src/Adyen/Model/Checkout/ThreeDSecureData.php @@ -0,0 +1,886 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ThreeDSecureData Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ThreeDSecureData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDSecureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication_response' => 'string', + 'cavv' => 'string', + 'cavv_algorithm' => 'string', + 'challenge_cancel' => 'string', + 'directory_response' => 'string', + 'ds_trans_id' => 'string', + 'eci' => 'string', + 'risk_score' => 'string', + 'three_ds_version' => 'string', + 'token_authentication_verification_value' => 'string', + 'trans_status_reason' => 'string', + 'xid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication_response' => null, + 'cavv' => 'byte', + 'cavv_algorithm' => null, + 'challenge_cancel' => null, + 'directory_response' => null, + 'ds_trans_id' => null, + 'eci' => null, + 'risk_score' => null, + 'three_ds_version' => null, + 'token_authentication_verification_value' => 'byte', + 'trans_status_reason' => null, + 'xid' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication_response' => false, + 'cavv' => false, + 'cavv_algorithm' => false, + 'challenge_cancel' => false, + 'directory_response' => false, + 'ds_trans_id' => false, + 'eci' => false, + 'risk_score' => false, + 'three_ds_version' => false, + 'token_authentication_verification_value' => false, + 'trans_status_reason' => false, + 'xid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication_response' => 'authenticationResponse', + 'cavv' => 'cavv', + 'cavv_algorithm' => 'cavvAlgorithm', + 'challenge_cancel' => 'challengeCancel', + 'directory_response' => 'directoryResponse', + 'ds_trans_id' => 'dsTransID', + 'eci' => 'eci', + 'risk_score' => 'riskScore', + 'three_ds_version' => 'threeDSVersion', + 'token_authentication_verification_value' => 'tokenAuthenticationVerificationValue', + 'trans_status_reason' => 'transStatusReason', + 'xid' => 'xid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication_response' => 'setAuthenticationResponse', + 'cavv' => 'setCavv', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'challenge_cancel' => 'setChallengeCancel', + 'directory_response' => 'setDirectoryResponse', + 'ds_trans_id' => 'setDsTransId', + 'eci' => 'setEci', + 'risk_score' => 'setRiskScore', + 'three_ds_version' => 'setThreeDsVersion', + 'token_authentication_verification_value' => 'setTokenAuthenticationVerificationValue', + 'trans_status_reason' => 'setTransStatusReason', + 'xid' => 'setXid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication_response' => 'getAuthenticationResponse', + 'cavv' => 'getCavv', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'challenge_cancel' => 'getChallengeCancel', + 'directory_response' => 'getDirectoryResponse', + 'ds_trans_id' => 'getDsTransId', + 'eci' => 'getEci', + 'risk_score' => 'getRiskScore', + 'three_ds_version' => 'getThreeDsVersion', + 'token_authentication_verification_value' => 'getTokenAuthenticationVerificationValue', + 'trans_status_reason' => 'getTransStatusReason', + 'xid' => 'getXid' + ]; + + /** + * 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 AUTHENTICATION_RESPONSE_Y = 'Y'; + public const AUTHENTICATION_RESPONSE_N = 'N'; + public const AUTHENTICATION_RESPONSE_U = 'U'; + public const AUTHENTICATION_RESPONSE_A = 'A'; + public const CHALLENGE_CANCEL__01 = '01'; + public const CHALLENGE_CANCEL__02 = '02'; + public const CHALLENGE_CANCEL__03 = '03'; + public const CHALLENGE_CANCEL__04 = '04'; + public const CHALLENGE_CANCEL__05 = '05'; + public const CHALLENGE_CANCEL__06 = '06'; + public const CHALLENGE_CANCEL__07 = '07'; + public const DIRECTORY_RESPONSE_A = 'A'; + public const DIRECTORY_RESPONSE_C = 'C'; + public const DIRECTORY_RESPONSE_D = 'D'; + public const DIRECTORY_RESPONSE_I = 'I'; + public const DIRECTORY_RESPONSE_N = 'N'; + public const DIRECTORY_RESPONSE_R = 'R'; + public const DIRECTORY_RESPONSE_U = 'U'; + public const DIRECTORY_RESPONSE_Y = 'Y'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAuthenticationResponseAllowableValues() + { + return [ + self::AUTHENTICATION_RESPONSE_Y, + self::AUTHENTICATION_RESPONSE_N, + self::AUTHENTICATION_RESPONSE_U, + self::AUTHENTICATION_RESPONSE_A, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeCancelAllowableValues() + { + return [ + self::CHALLENGE_CANCEL__01, + self::CHALLENGE_CANCEL__02, + self::CHALLENGE_CANCEL__03, + self::CHALLENGE_CANCEL__04, + self::CHALLENGE_CANCEL__05, + self::CHALLENGE_CANCEL__06, + self::CHALLENGE_CANCEL__07, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDirectoryResponseAllowableValues() + { + return [ + self::DIRECTORY_RESPONSE_A, + self::DIRECTORY_RESPONSE_C, + self::DIRECTORY_RESPONSE_D, + self::DIRECTORY_RESPONSE_I, + self::DIRECTORY_RESPONSE_N, + self::DIRECTORY_RESPONSE_R, + self::DIRECTORY_RESPONSE_U, + self::DIRECTORY_RESPONSE_Y, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication_response', $data ?? [], null); + $this->setIfExists('cavv', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('challenge_cancel', $data ?? [], null); + $this->setIfExists('directory_response', $data ?? [], null); + $this->setIfExists('ds_trans_id', $data ?? [], null); + $this->setIfExists('eci', $data ?? [], null); + $this->setIfExists('risk_score', $data ?? [], null); + $this->setIfExists('three_ds_version', $data ?? [], null); + $this->setIfExists('token_authentication_verification_value', $data ?? [], null); + $this->setIfExists('trans_status_reason', $data ?? [], null); + $this->setIfExists('xid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAuthenticationResponseAllowableValues(); + if (!is_null($this->container['authentication_response']) && !in_array($this->container['authentication_response'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'authentication_response', must be one of '%s'", + $this->container['authentication_response'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!is_null($this->container['challenge_cancel']) && !in_array($this->container['challenge_cancel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $this->container['challenge_cancel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDirectoryResponseAllowableValues(); + if (!is_null($this->container['directory_response']) && !in_array($this->container['directory_response'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'directory_response', must be one of '%s'", + $this->container['directory_response'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication_response + * + * @return string|null + */ + public function getAuthenticationResponse() + { + return $this->container['authentication_response']; + } + + /** + * Sets authentication_response + * + * @param string|null $authentication_response In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. + * + * @return self + */ + public function setAuthenticationResponse($authentication_response) + { + if (is_null($authentication_response)) { + throw new \InvalidArgumentException('non-nullable authentication_response cannot be null'); + } + $allowedValues = $this->getAuthenticationResponseAllowableValues(); + if (!in_array($authentication_response, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'authentication_response', must be one of '%s'", + $authentication_response, + implode("', '", $allowedValues) + ) + ); + } + $this->container['authentication_response'] = $authentication_response; + + return $this; + } + + /** + * Gets cavv + * + * @return string|null + */ + public function getCavv() + { + return $this->container['cavv']; + } + + /** + * Sets cavv + * + * @param string|null $cavv The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). + * + * @return self + */ + public function setCavv($cavv) + { + if (is_null($cavv)) { + throw new \InvalidArgumentException('non-nullable cavv cannot be null'); + } + $this->container['cavv'] = $cavv; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm The CAVV algorithm used. Include this only for 3D Secure 1. + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets challenge_cancel + * + * @return string|null + */ + public function getChallengeCancel() + { + return $this->container['challenge_cancel']; + } + + /** + * Sets challenge_cancel + * + * @param string|null $challenge_cancel Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + * + * @return self + */ + public function setChallengeCancel($challenge_cancel) + { + if (is_null($challenge_cancel)) { + throw new \InvalidArgumentException('non-nullable challenge_cancel cannot be null'); + } + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!in_array($challenge_cancel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $challenge_cancel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_cancel'] = $challenge_cancel; + + return $this; + } + + /** + * Gets directory_response + * + * @return string|null + */ + public function getDirectoryResponse() + { + return $this->container['directory_response']; + } + + /** + * Sets directory_response + * + * @param string|null $directory_response In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`. + * + * @return self + */ + public function setDirectoryResponse($directory_response) + { + if (is_null($directory_response)) { + throw new \InvalidArgumentException('non-nullable directory_response cannot be null'); + } + $allowedValues = $this->getDirectoryResponseAllowableValues(); + if (!in_array($directory_response, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'directory_response', must be one of '%s'", + $directory_response, + implode("', '", $allowedValues) + ) + ); + } + $this->container['directory_response'] = $directory_response; + + return $this; + } + + /** + * Gets ds_trans_id + * + * @return string|null + */ + public function getDsTransId() + { + return $this->container['ds_trans_id']; + } + + /** + * Sets ds_trans_id + * + * @param string|null $ds_trans_id Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. + * + * @return self + */ + public function setDsTransId($ds_trans_id) + { + if (is_null($ds_trans_id)) { + throw new \InvalidArgumentException('non-nullable ds_trans_id cannot be null'); + } + $this->container['ds_trans_id'] = $ds_trans_id; + + return $this; + } + + /** + * Gets eci + * + * @return string|null + */ + public function getEci() + { + return $this->container['eci']; + } + + /** + * Sets eci + * + * @param string|null $eci The electronic commerce indicator. + * + * @return self + */ + public function setEci($eci) + { + if (is_null($eci)) { + throw new \InvalidArgumentException('non-nullable eci cannot be null'); + } + $this->container['eci'] = $eci; + + return $this; + } + + /** + * Gets risk_score + * + * @return string|null + */ + public function getRiskScore() + { + return $this->container['risk_score']; + } + + /** + * Sets risk_score + * + * @param string|null $risk_score Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. + * + * @return self + */ + public function setRiskScore($risk_score) + { + if (is_null($risk_score)) { + throw new \InvalidArgumentException('non-nullable risk_score cannot be null'); + } + $this->container['risk_score'] = $risk_score; + + return $this; + } + + /** + * Gets three_ds_version + * + * @return string|null + */ + public function getThreeDsVersion() + { + return $this->container['three_ds_version']; + } + + /** + * Sets three_ds_version + * + * @param string|null $three_ds_version The version of the 3D Secure protocol. + * + * @return self + */ + public function setThreeDsVersion($three_ds_version) + { + if (is_null($three_ds_version)) { + throw new \InvalidArgumentException('non-nullable three_ds_version cannot be null'); + } + $this->container['three_ds_version'] = $three_ds_version; + + return $this; + } + + /** + * Gets token_authentication_verification_value + * + * @return string|null + */ + public function getTokenAuthenticationVerificationValue() + { + return $this->container['token_authentication_verification_value']; + } + + /** + * Sets token_authentication_verification_value + * + * @param string|null $token_authentication_verification_value Network token authentication verification value (TAVV). The network token cryptogram. + * + * @return self + */ + public function setTokenAuthenticationVerificationValue($token_authentication_verification_value) + { + if (is_null($token_authentication_verification_value)) { + throw new \InvalidArgumentException('non-nullable token_authentication_verification_value cannot be null'); + } + $this->container['token_authentication_verification_value'] = $token_authentication_verification_value; + + return $this; + } + + /** + * Gets trans_status_reason + * + * @return string|null + */ + public function getTransStatusReason() + { + return $this->container['trans_status_reason']; + } + + /** + * Sets trans_status_reason + * + * @param string|null $trans_status_reason Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + * + * @return self + */ + public function setTransStatusReason($trans_status_reason) + { + if (is_null($trans_status_reason)) { + throw new \InvalidArgumentException('non-nullable trans_status_reason cannot be null'); + } + $this->container['trans_status_reason'] = $trans_status_reason; + + return $this; + } + + /** + * Gets xid + * + * @return string|null + */ + public function getXid() + { + return $this->container['xid']; + } + + /** + * Sets xid + * + * @param string|null $xid Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). + * + * @return self + */ + public function setXid($xid) + { + if (is_null($xid)) { + throw new \InvalidArgumentException('non-nullable xid cannot be null'); + } + $this->container['xid'] = $xid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php b/src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php new file mode 100644 index 000000000..21a4053a6 --- /dev/null +++ b/src/Adyen/Model/Checkout/UpdatePaymentLinkRequest.php @@ -0,0 +1,421 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * UpdatePaymentLinkRequest Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class UpdatePaymentLinkRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdatePaymentLinkRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_EXPIRED = 'expired'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_EXPIRED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the payment link. Possible values: * **expired** + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/UpiCollectDetails.php b/src/Adyen/Model/Checkout/UpiCollectDetails.php new file mode 100644 index 000000000..ef7ba14c3 --- /dev/null +++ b/src/Adyen/Model/Checkout/UpiCollectDetails.php @@ -0,0 +1,630 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * UpiCollectDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class UpiCollectDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpiCollectDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_sequence_number' => 'string', + 'checkout_attempt_id' => 'string', + 'recurring_detail_reference' => 'string', + 'shopper_notification_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string', + 'virtual_payment_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_sequence_number' => null, + 'checkout_attempt_id' => null, + 'recurring_detail_reference' => null, + 'shopper_notification_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null, + 'virtual_payment_address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_sequence_number' => false, + 'checkout_attempt_id' => false, + 'recurring_detail_reference' => false, + 'shopper_notification_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false, + 'virtual_payment_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_sequence_number' => 'billingSequenceNumber', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'recurring_detail_reference' => 'recurringDetailReference', + 'shopper_notification_reference' => 'shopperNotificationReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type', + 'virtual_payment_address' => 'virtualPaymentAddress' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_sequence_number' => 'setBillingSequenceNumber', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'shopper_notification_reference' => 'setShopperNotificationReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType', + 'virtual_payment_address' => 'setVirtualPaymentAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_sequence_number' => 'getBillingSequenceNumber', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'shopper_notification_reference' => 'getShopperNotificationReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType', + 'virtual_payment_address' => 'getVirtualPaymentAddress' + ]; + + /** + * 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_UPI_COLLECT = 'upi_collect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UPI_COLLECT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_sequence_number', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('shopper_notification_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'upi_collect'); + $this->setIfExists('virtual_payment_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['billing_sequence_number'] === null) { + $invalidProperties[] = "'billing_sequence_number' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_sequence_number + * + * @return string + */ + public function getBillingSequenceNumber() + { + return $this->container['billing_sequence_number']; + } + + /** + * Sets billing_sequence_number + * + * @param string $billing_sequence_number The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. + * + * @return self + */ + public function setBillingSequenceNumber($billing_sequence_number) + { + if (is_null($billing_sequence_number)) { + throw new \InvalidArgumentException('non-nullable billing_sequence_number cannot be null'); + } + $this->container['billing_sequence_number'] = $billing_sequence_number; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets shopper_notification_reference + * + * @return string|null + */ + public function getShopperNotificationReference() + { + return $this->container['shopper_notification_reference']; + } + + /** + * Sets shopper_notification_reference + * + * @param string|null $shopper_notification_reference The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. + * + * @return self + */ + public function setShopperNotificationReference($shopper_notification_reference) + { + if (is_null($shopper_notification_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_notification_reference cannot be null'); + } + $this->container['shopper_notification_reference'] = $shopper_notification_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **upi_collect** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets virtual_payment_address + * + * @return string|null + */ + public function getVirtualPaymentAddress() + { + return $this->container['virtual_payment_address']; + } + + /** + * Sets virtual_payment_address + * + * @param string|null $virtual_payment_address The virtual payment address for UPI. + * + * @return self + */ + public function setVirtualPaymentAddress($virtual_payment_address) + { + if (is_null($virtual_payment_address)) { + throw new \InvalidArgumentException('non-nullable virtual_payment_address cannot be null'); + } + $this->container['virtual_payment_address'] = $virtual_payment_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/UpiIntentDetails.php b/src/Adyen/Model/Checkout/UpiIntentDetails.php new file mode 100644 index 000000000..b1c2765dc --- /dev/null +++ b/src/Adyen/Model/Checkout/UpiIntentDetails.php @@ -0,0 +1,559 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * UpiIntentDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class UpiIntentDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpiIntentDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'recurring_detail_reference' => 'string', + 'shopper_notification_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'recurring_detail_reference' => null, + 'shopper_notification_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'recurring_detail_reference' => false, + 'shopper_notification_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'recurring_detail_reference' => 'recurringDetailReference', + 'shopper_notification_reference' => 'shopperNotificationReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'shopper_notification_reference' => 'setShopperNotificationReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'shopper_notification_reference' => 'getShopperNotificationReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_UPI_INTENT = 'upi_intent'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UPI_INTENT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('shopper_notification_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'upi_intent'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets shopper_notification_reference + * + * @return string|null + */ + public function getShopperNotificationReference() + { + return $this->container['shopper_notification_reference']; + } + + /** + * Sets shopper_notification_reference + * + * @param string|null $shopper_notification_reference The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. + * + * @return self + */ + public function setShopperNotificationReference($shopper_notification_reference) + { + if (is_null($shopper_notification_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_notification_reference cannot be null'); + } + $this->container['shopper_notification_reference'] = $shopper_notification_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **upi_intent** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/VippsDetails.php b/src/Adyen/Model/Checkout/VippsDetails.php new file mode 100644 index 000000000..8f5bdae5a --- /dev/null +++ b/src/Adyen/Model/Checkout/VippsDetails.php @@ -0,0 +1,559 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * VippsDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class VippsDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VippsDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'telephone_number' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'telephone_number' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'telephone_number' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'telephone_number' => 'telephoneNumber', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'telephone_number' => 'setTelephoneNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'telephone_number' => 'getTelephoneNumber', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_VIPPS = 'vipps'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_VIPPS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'vipps'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['telephone_number'] === null) { + $invalidProperties[] = "'telephone_number' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string $telephone_number + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **vipps** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/VisaCheckoutDetails.php b/src/Adyen/Model/Checkout/VisaCheckoutDetails.php new file mode 100644 index 000000000..7096718ea --- /dev/null +++ b/src/Adyen/Model/Checkout/VisaCheckoutDetails.php @@ -0,0 +1,554 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * VisaCheckoutDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class VisaCheckoutDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VisaCheckoutDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'funding_source' => 'string', + 'type' => 'string', + 'visa_checkout_call_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'funding_source' => null, + 'type' => null, + 'visa_checkout_call_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'funding_source' => false, + 'type' => false, + 'visa_checkout_call_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'funding_source' => 'fundingSource', + 'type' => 'type', + 'visa_checkout_call_id' => 'visaCheckoutCallId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'funding_source' => 'setFundingSource', + 'type' => 'setType', + 'visa_checkout_call_id' => 'setVisaCheckoutCallId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'funding_source' => 'getFundingSource', + 'type' => 'getType', + 'visa_checkout_call_id' => 'getVisaCheckoutCallId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const TYPE_VISACHECKOUT = 'visacheckout'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_VISACHECKOUT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'visacheckout'); + $this->setIfExists('visa_checkout_call_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['visa_checkout_call_id'] === null) { + $invalidProperties[] = "'visa_checkout_call_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **visacheckout** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets visa_checkout_call_id + * + * @return string + */ + public function getVisaCheckoutCallId() + { + return $this->container['visa_checkout_call_id']; + } + + /** + * Sets visa_checkout_call_id + * + * @param string $visa_checkout_call_id The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. + * + * @return self + */ + public function setVisaCheckoutCallId($visa_checkout_call_id) + { + if (is_null($visa_checkout_call_id)) { + throw new \InvalidArgumentException('non-nullable visa_checkout_call_id cannot be null'); + } + $this->container['visa_checkout_call_id'] = $visa_checkout_call_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/WeChatPayDetails.php b/src/Adyen/Model/Checkout/WeChatPayDetails.php new file mode 100644 index 000000000..58f0b28ea --- /dev/null +++ b/src/Adyen/Model/Checkout/WeChatPayDetails.php @@ -0,0 +1,454 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * WeChatPayDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class WeChatPayDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WeChatPayDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_WECHATPAY = 'wechatpay'; + public const TYPE_WECHATPAY_POS = 'wechatpay_pos'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_WECHATPAY, + self::TYPE_WECHATPAY_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'wechatpay'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **wechatpay** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php b/src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php new file mode 100644 index 000000000..7f01e1fbe --- /dev/null +++ b/src/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.php @@ -0,0 +1,520 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * WeChatPayMiniProgramDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class WeChatPayMiniProgramDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WeChatPayMiniProgramDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'app_id' => 'string', + 'checkout_attempt_id' => 'string', + 'openid' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'app_id' => null, + 'checkout_attempt_id' => null, + 'openid' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'app_id' => false, + 'checkout_attempt_id' => false, + 'openid' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'app_id' => 'appId', + 'checkout_attempt_id' => 'checkoutAttemptId', + 'openid' => 'openid', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'app_id' => 'setAppId', + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'openid' => 'setOpenid', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'app_id' => 'getAppId', + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'openid' => 'getOpenid', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_WECHATPAY_MINI_PROGRAM = 'wechatpayMiniProgram'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_WECHATPAY_MINI_PROGRAM, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('app_id', $data ?? [], null); + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('openid', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'wechatpayMiniProgram'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets app_id + * + * @return string|null + */ + public function getAppId() + { + return $this->container['app_id']; + } + + /** + * Sets app_id + * + * @param string|null $app_id app_id + * + * @return self + */ + public function setAppId($app_id) + { + if (is_null($app_id)) { + throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + } + $this->container['app_id'] = $app_id; + + return $this; + } + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets openid + * + * @return string|null + */ + public function getOpenid() + { + return $this->container['openid']; + } + + /** + * Sets openid + * + * @param string|null $openid openid + * + * @return self + */ + public function setOpenid($openid) + { + if (is_null($openid)) { + throw new \InvalidArgumentException('non-nullable openid cannot be null'); + } + $this->container['openid'] = $openid; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **wechatpayMiniProgram** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Checkout/ZipDetails.php b/src/Adyen/Model/Checkout/ZipDetails.php new file mode 100644 index 000000000..53a9f071f --- /dev/null +++ b/src/Adyen/Model/Checkout/ZipDetails.php @@ -0,0 +1,558 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +namespace Adyen\Model\Checkout; + +use \ArrayAccess; +use Adyen\Model\Checkout\ObjectSerializer; + +/** + * ZipDetails Class Doc Comment + * + * @category Class + * @package Adyen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ZipDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ZipDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'checkout_attempt_id' => 'string', + 'click_and_collect' => 'string', + 'recurring_detail_reference' => 'string', + 'stored_payment_method_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'checkout_attempt_id' => null, + 'click_and_collect' => null, + 'recurring_detail_reference' => null, + 'stored_payment_method_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'checkout_attempt_id' => false, + 'click_and_collect' => false, + 'recurring_detail_reference' => false, + 'stored_payment_method_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'checkout_attempt_id' => 'checkoutAttemptId', + 'click_and_collect' => 'clickAndCollect', + 'recurring_detail_reference' => 'recurringDetailReference', + 'stored_payment_method_id' => 'storedPaymentMethodId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'checkout_attempt_id' => 'setCheckoutAttemptId', + 'click_and_collect' => 'setClickAndCollect', + 'recurring_detail_reference' => 'setRecurringDetailReference', + 'stored_payment_method_id' => 'setStoredPaymentMethodId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'checkout_attempt_id' => 'getCheckoutAttemptId', + 'click_and_collect' => 'getClickAndCollect', + 'recurring_detail_reference' => 'getRecurringDetailReference', + 'stored_payment_method_id' => 'getStoredPaymentMethodId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_ZIP = 'zip'; + public const TYPE_ZIP_POS = 'zip_pos'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ZIP, + self::TYPE_ZIP_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('checkout_attempt_id', $data ?? [], null); + $this->setIfExists('click_and_collect', $data ?? [], null); + $this->setIfExists('recurring_detail_reference', $data ?? [], null); + $this->setIfExists('stored_payment_method_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'zip'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets checkout_attempt_id + * + * @return string|null + */ + public function getCheckoutAttemptId() + { + return $this->container['checkout_attempt_id']; + } + + /** + * Sets checkout_attempt_id + * + * @param string|null $checkout_attempt_id The checkout attempt identifier. + * + * @return self + */ + public function setCheckoutAttemptId($checkout_attempt_id) + { + if (is_null($checkout_attempt_id)) { + throw new \InvalidArgumentException('non-nullable checkout_attempt_id cannot be null'); + } + $this->container['checkout_attempt_id'] = $checkout_attempt_id; + + return $this; + } + + /** + * Gets click_and_collect + * + * @return string|null + */ + public function getClickAndCollect() + { + return $this->container['click_and_collect']; + } + + /** + * Sets click_and_collect + * + * @param string|null $click_and_collect Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. + * + * @return self + */ + public function setClickAndCollect($click_and_collect) + { + if (is_null($click_and_collect)) { + throw new \InvalidArgumentException('non-nullable click_and_collect cannot be null'); + } + $this->container['click_and_collect'] = $click_and_collect; + + return $this; + } + + /** + * Gets recurring_detail_reference + * + * @return string|null + * @deprecated + */ + public function getRecurringDetailReference() + { + return $this->container['recurring_detail_reference']; + } + + /** + * Sets recurring_detail_reference + * + * @param string|null $recurring_detail_reference This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + * @deprecated + */ + public function setRecurringDetailReference($recurring_detail_reference) + { + if (is_null($recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_reference cannot be null'); + } + $this->container['recurring_detail_reference'] = $recurring_detail_reference; + + return $this; + } + + /** + * Gets stored_payment_method_id + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['stored_payment_method_id']; + } + + /** + * Sets stored_payment_method_id + * + * @param string|null $stored_payment_method_id This is the `recurringDetailReference` returned in the response when you created the token. + * + * @return self + */ + public function setStoredPaymentMethodId($stored_payment_method_id) + { + if (is_null($stored_payment_method_id)) { + throw new \InvalidArgumentException('non-nullable stored_payment_method_id cannot be null'); + } + $this->container['stored_payment_method_id'] = $stored_payment_method_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **zip** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php b/src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php new file mode 100644 index 000000000..c951cfbd1 --- /dev/null +++ b/src/Adyen/Service/Checkout/ClassicCheckoutSDKApi.php @@ -0,0 +1,76 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Adyen\Service\Checkout; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use Adyen\Model\Checkout\ObjectSerializer; + +class ClassicCheckoutSDKApi extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * ClassicCheckoutSDKApi constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); + } + + /** + * Create a payment session + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\PaymentSetupRequest $paymentSetupRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentSetupResponse + * @throws AdyenException + */ + public function paymentSession(\Adyen\Model\Checkout\PaymentSetupRequest $paymentSetupRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentSetupResponse + { + $endpoint = $this->baseURL . "/paymentSession"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentSetupRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentSetupResponse::class); + } + + /** + * Verify a payment result + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\PaymentVerificationRequest $paymentVerificationRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentVerificationResponse + * @throws AdyenException + */ + public function verifyPaymentResult(\Adyen\Model\Checkout\PaymentVerificationRequest $paymentVerificationRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentVerificationResponse + { + $endpoint = $this->baseURL . "/payments/result"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentVerificationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentVerificationResponse::class); + } +} diff --git a/src/Adyen/Service/Checkout/ModificationsApi.php b/src/Adyen/Service/Checkout/ModificationsApi.php new file mode 100644 index 000000000..98402197b --- /dev/null +++ b/src/Adyen/Service/Checkout/ModificationsApi.php @@ -0,0 +1,145 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Adyen\Service\Checkout; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use Adyen\Model\Checkout\ObjectSerializer; + +class ModificationsApi extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * ModificationsApi constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); + } + + /** + * Cancel an authorised payment + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreateStandalonePaymentCancelRequest $createStandalonePaymentCancelRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\StandalonePaymentCancelResource + * @throws AdyenException + */ + public function cancelAuthorisedPayment(\Adyen\Model\Checkout\CreateStandalonePaymentCancelRequest $createStandalonePaymentCancelRequest, array $requestOptions = null): \Adyen\Model\Checkout\StandalonePaymentCancelResource + { + $endpoint = $this->baseURL . "/cancels"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createStandalonePaymentCancelRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\StandalonePaymentCancelResource::class); + } + + /** + * Update an authorised amount + * + * @param string $paymentPspReference + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreatePaymentAmountUpdateRequest $createPaymentAmountUpdateRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentAmountUpdateResource + * @throws AdyenException + */ + public function updateAuthorisedAmount(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentAmountUpdateRequest $createPaymentAmountUpdateRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentAmountUpdateResource + { + $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/amountUpdates"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentAmountUpdateRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentAmountUpdateResource::class); + } + + /** + * Cancel an authorised payment + * + * @param string $paymentPspReference + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreatePaymentCancelRequest $createPaymentCancelRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentCancelResource + * @throws AdyenException + */ + public function cancelAuthorisedPaymentByPspReference(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentCancelRequest $createPaymentCancelRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentCancelResource + { + $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/cancels"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentCancelRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentCancelResource::class); + } + + /** + * Capture an authorised payment + * + * @param string $paymentPspReference + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreatePaymentCaptureRequest $createPaymentCaptureRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentCaptureResource + * @throws AdyenException + */ + public function captureAuthorisedPayment(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentCaptureRequest $createPaymentCaptureRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentCaptureResource + { + $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/captures"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentCaptureRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentCaptureResource::class); + } + + /** + * Refund a captured payment + * + * @param string $paymentPspReference + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreatePaymentRefundRequest $createPaymentRefundRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentRefundResource + * @throws AdyenException + */ + public function refundCapturedPayment(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentRefundRequest $createPaymentRefundRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentRefundResource + { + $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/refunds"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentRefundRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentRefundResource::class); + } + + /** + * Refund or cancel a payment + * + * @param string $paymentPspReference + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreatePaymentReversalRequest $createPaymentReversalRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentReversalResource + * @throws AdyenException + */ + public function refundOrCancelPayment(string $paymentPspReference, \Adyen\Model\Checkout\CreatePaymentReversalRequest $createPaymentReversalRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentReversalResource + { + $endpoint = $this->baseURL . str_replace(['{paymentPspReference}'], [$paymentPspReference], "/payments/{paymentPspReference}/reversals"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentReversalRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentReversalResource::class); + } +} diff --git a/src/Adyen/Service/Checkout/OrdersApi.php b/src/Adyen/Service/Checkout/OrdersApi.php new file mode 100644 index 000000000..f2e86255e --- /dev/null +++ b/src/Adyen/Service/Checkout/OrdersApi.php @@ -0,0 +1,92 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Adyen\Service\Checkout; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use Adyen\Model\Checkout\ObjectSerializer; + +class OrdersApi extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * OrdersApi constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); + } + + /** + * Create an order + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CheckoutCreateOrderRequest $checkoutCreateOrderRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\CheckoutCreateOrderResponse + * @throws AdyenException + */ + public function orders(\Adyen\Model\Checkout\CheckoutCreateOrderRequest $checkoutCreateOrderRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutCreateOrderResponse + { + $endpoint = $this->baseURL . "/orders"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutCreateOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutCreateOrderResponse::class); + } + + /** + * Cancel an order + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CheckoutCancelOrderRequest $checkoutCancelOrderRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\CheckoutCancelOrderResponse + * @throws AdyenException + */ + public function cancelOrder(\Adyen\Model\Checkout\CheckoutCancelOrderRequest $checkoutCancelOrderRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutCancelOrderResponse + { + $endpoint = $this->baseURL . "/orders/cancel"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutCancelOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutCancelOrderResponse::class); + } + + /** + * Get the balance of a gift card + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CheckoutBalanceCheckRequest $checkoutBalanceCheckRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\CheckoutBalanceCheckResponse + * @throws AdyenException + */ + public function getBalanceOfGiftCard(\Adyen\Model\Checkout\CheckoutBalanceCheckRequest $checkoutBalanceCheckRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutBalanceCheckResponse + { + $endpoint = $this->baseURL . "/paymentMethods/balance"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutBalanceCheckRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutBalanceCheckResponse::class); + } +} diff --git a/src/Adyen/Service/Checkout/PaymentLinksApi.php b/src/Adyen/Service/Checkout/PaymentLinksApi.php new file mode 100644 index 000000000..1b2ad7dc4 --- /dev/null +++ b/src/Adyen/Service/Checkout/PaymentLinksApi.php @@ -0,0 +1,91 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Adyen\Service\Checkout; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use Adyen\Model\Checkout\ObjectSerializer; + +class PaymentLinksApi extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * PaymentLinksApi constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); + } + + /** + * Get a payment link + * + * @param string $linkId + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentLinkResponse + * @throws AdyenException + */ + public function getPaymentLink(string $linkId, array $requestOptions = null): \Adyen\Model\Checkout\PaymentLinkResponse + { + $endpoint = $this->baseURL . str_replace(['{linkId}'], [$linkId], "/paymentLinks/{linkId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentLinkResponse::class); + } + + /** + * Update the status of a payment link + * + * @param string $linkId + * @param \Adyen\Model\Checkout\UpdatePaymentLinkRequest $updatePaymentLinkRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentLinkResponse + * @throws AdyenException + */ + public function updatePaymentLink(string $linkId, \Adyen\Model\Checkout\UpdatePaymentLinkRequest $updatePaymentLinkRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentLinkResponse + { + $endpoint = $this->baseURL . str_replace(['{linkId}'], [$linkId], "/paymentLinks/{linkId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updatePaymentLinkRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentLinkResponse::class); + } + + /** + * Create a payment link + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreatePaymentLinkRequest $createPaymentLinkRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentLinkResponse + * @throws AdyenException + */ + public function paymentLinks(\Adyen\Model\Checkout\CreatePaymentLinkRequest $createPaymentLinkRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentLinkResponse + { + $endpoint = $this->baseURL . "/paymentLinks"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createPaymentLinkRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentLinkResponse::class); + } +} diff --git a/src/Adyen/Service/Checkout/PaymentsApi.php b/src/Adyen/Service/Checkout/PaymentsApi.php new file mode 100644 index 000000000..eabb7bc5d --- /dev/null +++ b/src/Adyen/Service/Checkout/PaymentsApi.php @@ -0,0 +1,140 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Adyen\Service\Checkout; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use Adyen\Model\Checkout\ObjectSerializer; + +class PaymentsApi extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * PaymentsApi constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); + } + + /** + * Get the list of brands on the card + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CardDetailsRequest $cardDetailsRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\CardDetailsResponse + * @throws AdyenException + */ + public function cardDetails(\Adyen\Model\Checkout\CardDetailsRequest $cardDetailsRequest, array $requestOptions = null): \Adyen\Model\Checkout\CardDetailsResponse + { + $endpoint = $this->baseURL . "/cardDetails"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $cardDetailsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CardDetailsResponse::class); + } + + /** + * Start a transaction for donations + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\PaymentDonationRequest $paymentDonationRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\DonationResponse + * @throws AdyenException + */ + public function donations(\Adyen\Model\Checkout\PaymentDonationRequest $paymentDonationRequest, array $requestOptions = null): \Adyen\Model\Checkout\DonationResponse + { + $endpoint = $this->baseURL . "/donations"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentDonationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\DonationResponse::class); + } + + /** + * Get a list of available payment methods + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\PaymentMethodsRequest $paymentMethodsRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentMethodsResponse + * @throws AdyenException + */ + public function paymentMethods(\Adyen\Model\Checkout\PaymentMethodsRequest $paymentMethodsRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentMethodsResponse + { + $endpoint = $this->baseURL . "/paymentMethods"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentMethodsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentMethodsResponse::class); + } + + /** + * Start a transaction + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\PaymentRequest $paymentRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentResponse + * @throws AdyenException + */ + public function payments(\Adyen\Model\Checkout\PaymentRequest $paymentRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentResponse + { + $endpoint = $this->baseURL . "/payments"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentResponse::class); + } + + /** + * Submit details for a payment + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\DetailsRequest $detailsRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\PaymentDetailsResponse + * @throws AdyenException + */ + public function paymentsDetails(\Adyen\Model\Checkout\DetailsRequest $detailsRequest, array $requestOptions = null): \Adyen\Model\Checkout\PaymentDetailsResponse + { + $endpoint = $this->baseURL . "/payments/details"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $detailsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\PaymentDetailsResponse::class); + } + + /** + * Create a payment session + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreateCheckoutSessionRequest $createCheckoutSessionRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\CreateCheckoutSessionResponse + * @throws AdyenException + */ + public function sessions(\Adyen\Model\Checkout\CreateCheckoutSessionRequest $createCheckoutSessionRequest, array $requestOptions = null): \Adyen\Model\Checkout\CreateCheckoutSessionResponse + { + $endpoint = $this->baseURL . "/sessions"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createCheckoutSessionRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CreateCheckoutSessionResponse::class); + } +} diff --git a/src/Adyen/Service/Checkout/RecurringApi.php b/src/Adyen/Service/Checkout/RecurringApi.php new file mode 100644 index 000000000..dce871cb4 --- /dev/null +++ b/src/Adyen/Service/Checkout/RecurringApi.php @@ -0,0 +1,77 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Adyen\Service\Checkout; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use Adyen\Model\Checkout\ObjectSerializer; + +class RecurringApi extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * RecurringApi constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); + } + + /** + * Delete a token for stored payment details + * + * @param string $recurringId + * @param string $shopperReference + * @param string $merchantAccount + * @param array $requestOptions + * @return \Adyen\Model\Checkout\StoredPaymentMethodResource + * @throws AdyenException + */ + public function deleteTokenForStoredPaymentDetails(string $recurringId, array $requestOptions = null): \Adyen\Model\Checkout\StoredPaymentMethodResource + { + $endpoint = $this->baseURL . str_replace(['{recurringId}'], [$recurringId], "/storedPaymentMethods/{recurringId}"); + $response = $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\StoredPaymentMethodResource::class); + } + + /** + * Get tokens for stored payment details + * + * @param string $shopperReference + * @param string $merchantAccount + * @param array $requestOptions + * @return \Adyen\Model\Checkout\ListStoredPaymentMethodsResponse + * @throws AdyenException + */ + public function getTokensForStoredPaymentDetails(array $requestOptions = null): \Adyen\Model\Checkout\ListStoredPaymentMethodsResponse + { + $endpoint = $this->baseURL . "/storedPaymentMethods"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\ListStoredPaymentMethodsResponse::class); + } +} diff --git a/src/Adyen/Service/Checkout/UtilityApi.php b/src/Adyen/Service/Checkout/UtilityApi.php new file mode 100644 index 000000000..143252a9f --- /dev/null +++ b/src/Adyen/Service/Checkout/UtilityApi.php @@ -0,0 +1,76 @@ + **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version! + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Adyen\Service\Checkout; + +use Adyen\AdyenException; +use Adyen\Client; +use Adyen\Service; +use Adyen\Model\Checkout\ObjectSerializer; + +class UtilityApi extends Service +{ + /** + * @var array|string|string[] + */ + private $baseURL; + + /** + * UtilityApi constructor. + * + * @param \Adyen\Client $client + * @throws AdyenException + */ + public function __construct(Client $client) + { + parent::__construct($client); + + // Create the baseUrl based on live/test and optional live-url-prefix + $this->baseURL = $this->createBaseUrl("https://checkout-test.adyen.com/v70"); + } + + /** + * Get an Apple Pay session + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CreateApplePaySessionRequest $createApplePaySessionRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\ApplePaySessionResponse + * @throws AdyenException + */ + public function getApplePaySession(\Adyen\Model\Checkout\CreateApplePaySessionRequest $createApplePaySessionRequest, array $requestOptions = null): \Adyen\Model\Checkout\ApplePaySessionResponse + { + $endpoint = $this->baseURL . "/applePay/sessions"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createApplePaySessionRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\ApplePaySessionResponse::class); + } + + /** + * Create originKey values for domains + * + * @param string $idempotencyKey + * @param \Adyen\Model\Checkout\CheckoutUtilityRequest $checkoutUtilityRequest + * @param array $requestOptions + * @return \Adyen\Model\Checkout\CheckoutUtilityResponse + * @throws AdyenException + */ + public function originKeys(\Adyen\Model\Checkout\CheckoutUtilityRequest $checkoutUtilityRequest, array $requestOptions = null): \Adyen\Model\Checkout\CheckoutUtilityResponse + { + $endpoint = $this->baseURL . "/originKeys"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $checkoutUtilityRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\CheckoutUtilityResponse::class); + } +} diff --git a/templates/model.mustache b/templates/model.mustache index b13e596b0..f8f989b11 100644 --- a/templates/model.mustache +++ b/templates/model.mustache @@ -28,4 +28,4 @@ use {{modelPackage}}\ObjectSerializer; {{/isEnum}} */ {{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model_generic}}{{/isEnum}} -{{/model}}{{/models}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/templates/model_generic.mustache b/templates/model_generic.mustache index 51ea05b80..c7d73c0b1 100644 --- a/templates/model_generic.mustache +++ b/templates/model_generic.mustache @@ -192,6 +192,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par return self::$openAPIModelName; } + {{^oneOf}} {{#vars}} {{#isEnum}} {{#allowableValues}} @@ -216,9 +217,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par {{/-last}}{{/enumVars}}{{/allowableValues}} ]; } - {{/isEnum}} {{/vars}} + {{/oneOf}} {{^parentSchema}} /** * Associative array for storing property values @@ -290,6 +291,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par {{/required}} {{#isEnum}} {{^isContainer}} + {{^oneOf}} $allowedValues = $this->{{getter}}AllowableValues(); if (!is_null($this->container['{{name}}']) && !in_array($this->container['{{name}}'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -298,6 +300,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par implode("', '", $allowedValues) ); } + {{/oneOf}} {{/isContainer}} {{/isEnum}} @@ -367,6 +370,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par } {{/isInteger}} {{/isNullable}} + {{^oneOf}} {{#isEnum}} $allowedValues = $this->{{getter}}AllowableValues(); {{^isContainer}} @@ -391,6 +395,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par } {{/isContainer}} {{/isEnum}} + {{/oneOf}} $this->container['{{name}}'] = ${{name}}; return $this; @@ -475,4 +480,4 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par JSON_PRETTY_PRINT ); } -} +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/cardDetails-success.json b/tests/Resources/ModelBasedCheckout/cardDetails-success.json new file mode 100644 index 000000000..4695393b4 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/cardDetails-success.json @@ -0,0 +1,12 @@ +{ + "brands" : [ + { + "type" : "visa", + "supported" : true + }, + { + "type" : "cartebancaire", + "supported" : true + } + ] +} diff --git a/tests/Resources/ModelBasedCheckout/deleteStoredPaymentMethods-success.json b/tests/Resources/ModelBasedCheckout/deleteStoredPaymentMethods-success.json new file mode 100644 index 000000000..06140bd85 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/deleteStoredPaymentMethods-success.json @@ -0,0 +1,21 @@ +{ + "brand": "string", + "expiryMonth": "string", + "expiryYear": "string", + "externalResponseCode": "string", + "externalTokenReference": "string", + "holderName": "string", + "iban": "string", + "id": "CS16116100127511AF", + "issuerName": "string", + "lastFour": "string", + "name": "string", + "networkTxReference": "networkRef", + "ownerName": "string", + "shopperEmail": "string", + "shopperReference": "string", + "supportedRecurringProcessingModels": [ + "string" + ], + "type": "string" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/donations-success.json b/tests/Resources/ModelBasedCheckout/donations-success.json new file mode 100644 index 000000000..63d43f7a4 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/donations-success.json @@ -0,0 +1,20 @@ +{ + "id": "UNIQUE_RESOURCE_ID", + "status": "completed", + "donationAccount": "CHARITY_ACCOUNT", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "amount": { + "currency": "EUR", + "value": 1000 + }, + "reference": "YOUR_DONATION_REFERENCE", + "payment": { + "pspReference": "8535762347980628", + "resultCode": "Authorised", + "amount": { + "currency": "EUR", + "value": 1000 + }, + "merchantReference": "YOUR_DONATION_REFERENCE" + } +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/getStoredPaymentMethods-success.json b/tests/Resources/ModelBasedCheckout/getStoredPaymentMethods-success.json new file mode 100644 index 000000000..28f831bbc --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/getStoredPaymentMethods-success.json @@ -0,0 +1,27 @@ +{ + "merchantAccount": "merchantAccount", + "shopperReference": "string", + "storedPaymentMethods": [ + { + "brand": "string", + "expiryMonth": "string", + "expiryYear": "string", + "externalResponseCode": "string", + "externalTokenReference": "string", + "holderName": "string", + "iban": "string", + "id": "string", + "issuerName": "string", + "lastFour": "string", + "name": "string", + "networkTxReference": "string", + "ownerName": "string", + "shopperEmail": "string", + "shopperReference": "string", + "supportedRecurringProcessingModels": [ + "string" + ], + "type": "string" + } + ] +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/invalid-merchant-account.json b/tests/Resources/ModelBasedCheckout/invalid-merchant-account.json new file mode 100644 index 000000000..28afc9887 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/invalid-merchant-account.json @@ -0,0 +1,6 @@ +{ + "status": 403, + "errorCode": "901", + "message": "Invalid Merchant Account", + "errorType": "security" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payment-links-expired.json b/tests/Resources/ModelBasedCheckout/payment-links-expired.json new file mode 100644 index 000000000..ed91120ea --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payment-links-expired.json @@ -0,0 +1,10 @@ +{ + "amount": { + "currency": "BRL", + "value": 1250 + }, + "status": "expired", + "expiresAt": "2020-06-30T08:23:18Z", + "reference": "YOUR_ORDER_NUMBER", + "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59" +} diff --git a/tests/Resources/ModelBasedCheckout/payment-links-invalid.json b/tests/Resources/ModelBasedCheckout/payment-links-invalid.json new file mode 100644 index 000000000..d6a9efa4e --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payment-links-invalid.json @@ -0,0 +1,6 @@ +{ + "status": 422, + "errorCode": "130", + "message": "Reference Missing", + "errorType": "validation" +} diff --git a/tests/Resources/ModelBasedCheckout/payment-links-success.json b/tests/Resources/ModelBasedCheckout/payment-links-success.json new file mode 100644 index 000000000..969c5ad00 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payment-links-success.json @@ -0,0 +1,9 @@ +{ + "amount": { + "currency": "BRL", + "value": 1250 + }, + "expiresAt": "2020-06-30T08:23:18Z", + "reference": "YOUR_ORDER_NUMBER", + "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59" +} diff --git a/tests/Resources/ModelBasedCheckout/payment-methods-forbidden.json b/tests/Resources/ModelBasedCheckout/payment-methods-forbidden.json new file mode 100644 index 000000000..e80d3334e --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payment-methods-forbidden.json @@ -0,0 +1,7 @@ +{ + "error": { + "code": 403, + "message": "Forbidden", + "requested URI": "\/checkout\/\/v32\/paymentMethods" + } +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payment-methods-success.json b/tests/Resources/ModelBasedCheckout/payment-methods-success.json new file mode 100644 index 000000000..4159b2a78 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payment-methods-success.json @@ -0,0 +1,278 @@ +{ + "paymentMethods": [{ + "name": "AliPay", + "type": "alipay" + }, { + "details": [{ + "key": "additionalData.card.encrypted.json", + "type": "cardToken" + }], + "name": "Credit Card", + "type": "scheme" + }, { + "name": "Bank Transfer (DE)", + "type": "bankTransfer_DE" + }, { + "name": "Bank Transfer (GB)", + "type": "bankTransfer_GB" + }, { + "name": "SEPA Bank Transfer", + "type": "bankTransfer_IBAN" + }, { + "name": "Bank Transfer (NL)", + "type": "bankTransfer_NL" + }, { + "name": "Bank Transfer (PL)", + "type": "bankTransfer_PL" + }, { + "name": "Bank Transfer (SE)", + "type": "bankTransfer_SE" + }, { + "details": [{ + "key": "additionalData.card.encrypted.json", + "type": "cardToken" + }], + "name": "Bancontact card", + "type": "bcmc" + }, { + "name": "Cash-Ticket", + "type": "cashticket" + }, { + "name": "DineroMail", + "type": "dineromail" + }, { + "name": "Online bank transfer.", + "type": "directEbanking" + }, { + "name": "Eenmalige machtiging", + "type": "directdebit_NL" + }, { + "details": [{ + "items": [{ + "id": "11", + "name": "Bank transfer \/ postal" + }, { + "id": "74", + "name": "Banki Sp\u00f3\u0142dzielcze" + }, { + "id": "73", + "name": "BLIK" + }, { + "id": "32", + "name": "BNP Paribas" + }, { + "id": "16", + "name": "Credit Agricole" + }, { + "id": "83", + "name": "EnveloBank" + }, { + "id": "55", + "name": "erata - dotpay installment" + }, { + "id": "93", + "name": "eSKOK" + }, { + "id": "56", + "name": "eurobank p\u0142atno\u015bci online" + }, { + "id": "76", + "name": "Getin Bank PBL" + }, { + "id": "81", + "name": "Idea Cloud" + }, { + "id": "7", + "name": "ING Corporate customers" + }, { + "id": "35", + "name": "Kantor Polski" + }, { + "id": "44", + "name": "Millennium - P\u0142atno\u015bci Internetowe" + }, { + "id": "10", + "name": "Millennium Corporate customers" + }, { + "id": "68", + "name": "mRaty" + }, { + "id": "1", + "name": "mTransfer" + }, { + "id": "80", + "name": "Noble Pay" + }, { + "id": "50", + "name": "Pay Way Toyota Bank" + }, { + "id": "45", + "name": "Pay with Alior Bank" + }, { + "id": "65", + "name": "Paylink Idea Bank" + }, { + "id": "36", + "name": "Pekao24Przelew" + }, { + "id": "70", + "name": "Pocztowy24" + }, { + "id": "6", + "name": "Przelew24" + }, { + "id": "46", + "name": "P\u0142ac\u0119 z Citi Handlowy" + }, { + "id": "38", + "name": "P\u0142ac\u0119 z ING" + }, { + "id": "2", + "name": "P\u0142ac\u0119 z Inteligo" + }, { + "id": "4", + "name": "P\u0142ac\u0119 z iPKO" + }, { + "id": "72", + "name": "P\u0142ac\u0119 z Orange" + }, { + "id": "66", + "name": "P\u0142ac\u0119 z PBS" + }, { + "id": "75", + "name": "P\u0142ac\u0119 z Plus Bank" + }, { + "id": "51", + "name": "P\u0142a\u0107 z BO\u015a" + }, { + "id": "48", + "name": "R-Przelew" + }, { + "id": "88", + "name": "Raiffeisen" + }, { + "id": "52", + "name": "SkyCash" + }, { + "id": "58", + "name": "Szybkie Platnosci Internetowe z Deutsche Bank PBC" + }, { + "id": "60", + "name": "T-Mobile us\u0142ugi bankowe" + }, { + "id": "21", + "name": "VIA - Moje Rachunki" + }, { + "id": "84", + "name": "Volkswagen Bank direct" + }, { + "id": "31", + "name": "Zaplac w Zabce i we Freshmarket" + }, { + "id": "24", + "name": "mPay" + }], + "key": "issuer", + "type": "select" + }], + "name": "Local Polish Payment Methods", + "type": "dotpay" + }, { + "name": "Finnish E-Banking", + "type": "ebanking_FI" + }, { + "name": "Lastschrift (ELV)", + "type": "elv" + }, { + "name": "Nationale Entertainment Card", + "type": "entertainmentcard" + }, { + "details": [{ + "key": "bic", + "type": "text" + }], + "name": "GiroPay", + "type": "giropay" + }, { + "details": [{ + "items": [{ + "id": "1121", + "name": "Test Issuer" + }, { + "id": "1154", + "name": "Test Issuer 5" + }, { + "id": "1153", + "name": "Test Issuer 4" + }, { + "id": "1152", + "name": "Test Issuer 3" + }, { + "id": "1151", + "name": "Test Issuer 2" + }, { + "id": "1162", + "name": "Test Issuer Cancelled" + }, { + "id": "1161", + "name": "Test Issuer Pending" + }, { + "id": "1160", + "name": "Test Issuer Refused" + }, { + "id": "1159", + "name": "Test Issuer 10" + }, { + "id": "1158", + "name": "Test Issuer 9" + }, { + "id": "1157", + "name": "Test Issuer 8" + }, { + "id": "1156", + "name": "Test Issuer 7" + }, { + "id": "1155", + "name": "Test Issuer 6" + }], + "key": "idealIssuer", + "type": "select" + }], + "name": "iDEAL", + "type": "ideal" + }, { + "name": "Phone Payment", + "type": "ivr" + }, { + "name": "Landline phone", + "type": "ivrLandline" + }, { + "name": "Mobile phone", + "type": "ivrMobile" + }, { + "name": "Moneybookers", + "type": "moneybookers" + }, { + "name": "Invoice", + "type": "openinvoice" + }, { + "name": "Paysafecard", + "type": "paysafecard" + }, { + "details": [{ + "key": "sepa.ownerName", + "type": "text" + }, { + "key": "sepa.ibanNumber", + "type": "text" + }], + "name": "SEPA Direct Debit", + "type": "sepadirectdebit" + }, { + "name": "Premium SMS", + "type": "sms" + }, { + "name": "Your Gift", + "type": "yourgift" + }] +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payment-session-success.json b/tests/Resources/ModelBasedCheckout/payment-session-success.json new file mode 100644 index 000000000..42446ad47 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payment-session-success.json @@ -0,0 +1,3 @@ +{ + "paymentSession": "eyJjaGVja291dHNob3BwZXJCYXNlVXJsIjoiaHR0cHM6XC9cL2NoZWNrb3V0c2asdHBlci10ZXN0LmFkeWVuLmNvbVwvY2hlY2tvdXRzaG9wcGVyXC8iLCJkaXNhYmxlUmVjdXJyaW5nRGV0YWlsVXJsIjoiaHR0cHM6XC9cL2NoZWNrb3V0c2hvcHBlci10ZXN0LmFkeWVuLmNvbVwvY2hlY2tvdXRzaG9wcGVyXC9zZXJ2aWNlc1wvUGF5bWVudEluaXRpYXRpb25cL3YxXC9kaXNhYmxlUmVjdXJyaW5nRGV0YWlsIiwiZ2VuZXJhdGlvbnRpbWUiOiIyMDE4LTA2LTIyVDE0OjMxOjI1WiIsImluaXRpYXRpb25VcmwiOiJodHRwczpcL1wvY2hlY2tvdXRzaG9wcGVyLXRlc3QuYWR5ZW4uY29tXC9jaGVja291dHNob3BwZXJcL3NlcnZpY2VzXC9QYXltZW50SW5pdGlhdGlvblwvdjFcL2luaXRpYXRlIiwib3JpZ2luIjoiIiwicGF5bWVudCI6eyJhbW91bnQiOnsiY3VycmVuY3kiOiJFVVIiLCJ2YWx1ZSI6MTAwMH0sImNvdW50cnlDb2RlIjoiTkwiLCJyZWZlcmVuY2UiOiJZb3VyIG9yZGVyIG51bWJlciIsInJldHVyblVybCI6Imh0dHBzOlwvXC95b3VyLWNvbXBhbnkuY29tXC8iLCJzZXNzaW9uVmFsaWRpdHkiOiIyMDE4LTA2LTIyVDE1OjMxOjI1WiJ9LCJwYXltZW50RGF0YSI6IkFiMDJiNGMwIUJRQUJBZ0FJemlidUZ2Z3hsMGVTOTFQZWtjbDB3VHJhRG1xTU1BWFdZUGdxOXI1NXJjKzJ5N2l5bWV2ZWswR0VWdU9sZDhPSkwyeTBzWnl3UVlYWFhHUDkwa0pZU21SVzIzS1dHYXp3VEhyMDV0cGpGMGZOMHJrZ2lPNTFBdkxrVnhQSWI4RE1iQUtmeVlyRVErdjlpZWIyUjI0emdiTXhYWGJJMWtjZGJWeEdKbENMRWVaXC9kNDUzclVGZ0NnRktWczNXUk1JRHVTTlBoQ1hCclwvMlhqMXJ4dDRFTkFFZEN3czVwb1VnTEdWdnBQK0RSSU9FNlU1bHB1djVJV1k0N256azBIeHdGdWZnNVZmUWhWOGZHd2RCQzZrdW4wTWI2dlZcL1JqWDc5Tm9FVHBKcUlXcDNseEFpQW5HZjl5Mlp0Q3UzNEROUlNOZUR4eUQ1UFFhaTlwWHRNTFo2YnBlMkZEMG1BRkpHNXAyUk9kNUc2RkM0UXRDMzA3YTRcL2d3ZVh5TklpeFN2MHBXdVZzV2RsUzlUM1RDN2dXZEZVSEVLb1ozU041MzZqeVdTZGRMTVNoMlRJZWwxN25ISnZsMnBxTmltQTlBRWpmUG05NG53U0M1SGJkd1NuSDlpQmdmY3NqaSsxVXYrVmlzVnVHbUk5V2lDYjRIR2pPZlFoQUxXbmxWZWZXVlhPWGs0NmkwOExRemZPN1krUXNRMjVRNmVkdEduM1ZCeHlUdDEwajlWMTZnMlwvaTl1Y3pcL2owZ0piODRoUGw3NFZ3bTlWYTNPZEl2bk1MdjdXNE14bG9MWlhcL2paakF3NGZ5V0ZtNHhQclp5ZUpWK2ZLbkV4UHdsY2FzbjVLQkp4SHpcLzJXNk9MOWQ1cE02T003WnprOE9RNVIwOWhcL1pKOHNSMTBGT29kOU1nQkJTNW1YeUMrWXU2Q1JSaGR6N2I4ZlRBRXA3SW10bGVTSTZJa0ZHTUVGQlFURXdNME5CTlRNM1JVRkZSRGczUXpJMFJFUTFNemt3T1VJNE1FRTNPRUU1TWpORk16Z3lNMFEyT0VSQlEwTTVORUk1UmtZNE16QTFSRU1pZlFkd01idGdFczlUZGRXeU96NGQrdlYyQVQxVUEwV3h3XC9NR05Pa0owdWxoaGhPYXVCQVpLK0RIdU5xXC9vQnQzRVQ0S3N2MDd2VnZRWFBZNkc2MzQ4Q2pzWWYyQURHQjV3NzlpeDc3ZERtZzZhWGRhSG95T3RxdHdDcyt2VUUxbXJhVytFOVhpZlh6Qm1UK2Roc2t4WlQ0NHllTzh1VGpjMTRKQnNpVWpmXC9ESEl5YUtzOHV3UFk2UnNxK3JUNjFtR3BseTBMQ25VNWlObjNDM2lPMHRcL3Y1WDY3eGRqWXhnYW5QcHEzTFVpZ29FNDZaOUpNdnp4NEFIdTZJNWJaUDJ6S3UwQzNWcXMyWjUwSENpQjh2MlhKY3dlY0lOcWFUWEZaQmwyclhNRmdBbDlDSjY2dkMwRnJJSWp1d3B4M1ZGelQxTHJmc3psOWdkYUY1aUp4VDlRemgraGNqNk9KaEhmcTNnQ0RGUFZsUnZIWkRcL1VHa3ltUmlvTGNPeDFBVEw3azhRclwvREpZQ3NjY3g5aXlEcnhhQ2hPa1FrV054VjZqcjBYSHRnaHdGSE5GeTFJc3kyeWxPcFJYMUVyY2Y0XC92bHJVU0N3WHQ2R0Z0dHhmR0xHbExlN0dBKzVaU3R3UGR4aGxUb2haeTdwMWg2a0U5ZnJxbU1tZk1YV2N1Rkt4NnZMWjVtMEtsbzZydllROWZ1Q0pUYkdKMDRENkI2RnR5WXYrOHlEWTJaeVBvRzhjbHJJZ3Z6dEtLaVlibG10RnRHakd3OVNaWkVxXC80ODBDOEZOdlVuZmtnXC9IT2FScnlKaXhvSjFicFBEK1YwRVlrYTVIbjBnWlwvRXVQTDFcL1B5eUp5Q0d5SVh2SlBFMHhZUWdDWllqcDJiNUhGZjZpMDdtUDFNdHNkYVBZd280VkQwRUNrckpDeE5DcnBIVmJqMWt3dmtcL0JxNE5QRXlFVFd2N25FamswUG1WalFySHpxZ2lpb2RIM1YrYXZodGxpSjcwNUx1RWFIdmNRTHU1aE5OSlVVRFNlTnMwR2hldVkxcGRuK3l6R1Y5ZG1OaklMSFI0N1B3UlQzRlwvMUJMNGU4elZLdFFOSWpYVnN1ZHd2UHN2RUNzamhmTGpaOEhmY3JGM1JTTW9pNnR0UlwvNkJlTVlSb1BHTlZ5bG9ybnBSQ3lqTXVsZmJlSzkzNWdaOVwvWkd6alFtZzRTRzlTWkUxSGdpaGhldFZ4bnh1YmRmMjhEcUxVNHBTZ2ZHWlFuMk83ZnYwNCt6RjQ0eHQ2VnJ6NFwvNHNzbTdaZUpKYW5HQStSVlFUZTlNTVNEYXU5Z1YyXC93Y0N4bGN6YmdkaUllYWQzb3RVK296V1FpS2VoODY2RVBrWjUxQmJraHRMNUxlT1lUYjAwYU5GRGk2QnVWZ2s2SG5sTnpJcDZIRDFcLytSaXVvc3llYTNmcVg0b1hwYVR0RE5WMEF1TlVLVnFvZUJkaktoTVVpb005UTVqbW94Q2hpcStWRndGbUlNUGFLMWpSRkpxTzRIUElsYWYwXC9MWk5cL3hzQU96WHQrVW5BQTFFZzZUU2FLYWN5amwxUXFmT21CNFV6TFwvcmx2WXRqRW5IdlwvdzZ4eUROMnp1IiwicGF5bWVudE1ldGhvZHMiOlt7ImNvbmZpZ3VyYXRpb24iOnsiY2FuSWdub3JlQ29va2llcyI6InRydWUifSwiZGV0YWlscyI6W3siaXRlbXMiOlt7ImlkIjoiMTEyMSIsIm5hbWUiOiJUZXN0IElzc3VlciJ9LHsiaWQiOiIxMTU0IiwibmFtZSI6IlRlc3QgSXNzdWVyIDUifSx7ImlkIjoiMTE1MyIsIm5hbWUiOiJUZXN0IElzc3VlciA0In0seyJpZCI6IjExNTIiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgMyJ9LHsiaWQiOiIxMTUxIiwibmFtZSI6IlRlc3QgSXNzdWVyIDIifSx7ImlkIjoiMTE2MiIsIm5hbWUiOiJUZXN0IElzc3VlciBDYW5jZWxsZWQifSx7ImlkIjoiMTE2MSIsIm5hbWUiOiJUZXN0IElzc3VlciBQZW5kaW5nIn0seyJpZCI6IjExNjAiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgUmVmdXNlZCJ9LHsiaWQiOiIxMTU5IiwibmFtZSI6IlRlc3QgSXNzdWVyIDEwIn0seyJpZCI6IjExNTgiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgOSJ9LHsiaWQiOiIxMTU3IiwibmFtZSI6IlRlc3QgSXNzdWVyIDgifSx7ImlkIjoiMTE1NiIsIm5hbWUiOiJUZXN0IElzc3VlciA3In0seyJpZCI6IjExNTUiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgNiJ9XSwia2V5IjoiaWRlYWxJc3N1ZXIiLCJ0eXBlIjoic2VsZWN0In1dLCJuYW1lIjoiaURFQUwiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXbGtaV0ZzIiwidHlwZSI6ImlkZWFsIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJNYXN0ZXJDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQVzFqIiwidHlwZSI6Im1jIn0seyJuYW1lIjoiUGF5UGFsIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWEJoZVhCaGJBPT0iLCJ0eXBlIjoicGF5cGFsIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJWSVNBIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWFpwYzJFPSIsInR5cGUiOiJ2aXNhIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJBbWVyaWNhbiBFeHByZXNzIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV0Z0WlhnPSIsInR5cGUiOiJhbWV4In0seyJuYW1lIjoiU0VQQSBEaXJlY3QgRGViaXQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmxjR0ZrYVhKbFkzUmtaV0pwZEE9PSIsInR5cGUiOiJzZXBhZGlyZWN0ZGViaXQifSx7Im5hbWUiOiJQYXlzYWZlY2FyZCIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFhCaGVYTmhabVZqWVhKayIsInR5cGUiOiJwYXlzYWZlY2FyZCJ9LHsibmFtZSI6IkJhbmsgVHJhbnNmZXIgKE5MKSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdKaGJtdFVjbUZ1YzJabGNsOU9UQT09IiwidHlwZSI6ImJhbmtUcmFuc2Zlcl9OTCJ9LHsiZGV0YWlscyI6W3sia2V5IjoiZW5jcnlwdGVkQ2FyZE51bWJlciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZFNlY3VyaXR5Q29kZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeU1vbnRoIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5WWVhciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImhvbGRlck5hbWUiLCJvcHRpb25hbCI6InRydWUiLCJ0eXBlIjoidGV4dCJ9XSwiZ3JvdXAiOnsibmFtZSI6IkNyZWRpdCBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWE5qYUdWdFpRPT0iLCJ0eXBlIjoiY2FyZCJ9LCJuYW1lIjoiTWFlc3RybyIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFcxaFpYTjBjbTg9IiwidHlwZSI6Im1hZXN0cm8ifSx7Im5hbWUiOiJIdW5rZW1vbGxlciBMaW5nZXJpZSBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV2h0YkdsdVoyVnlhV1U9IiwidHlwZSI6ImhtbGluZ2VyaWUifSx7Im5hbWUiOiJFZW5tYWxpZ2UgbWFjaHRpZ2luZyIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdScGNtVmpkR1JsWW1sMFgwNU0iLCJ0eXBlIjoiZGlyZWN0ZGViaXRfTkwifSx7Im5hbWUiOiJTRVBBIEJhbmsgVHJhbnNmZXIiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXSmhibXRVY21GdWMyWmxjbDlKUWtGTyIsInR5cGUiOiJiYW5rVHJhbnNmZXJfSUJBTiJ9LHsibmFtZSI6ImNfY2FzaCIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdOZlkyRnphQT09IiwidHlwZSI6ImNfY2FzaCJ9LHsiZGV0YWlscyI6W3sia2V5IjoiZW5jcnlwdGVkQ2FyZE51bWJlciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZFNlY3VyaXR5Q29kZSIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeU1vbnRoIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5WWVhciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImhvbGRlck5hbWUiLCJvcHRpb25hbCI6InRydWUiLCJ0eXBlIjoidGV4dCJ9XSwiZ3JvdXAiOnsibmFtZSI6IkNyZWRpdCBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWE5qYUdWdFpRPT0iLCJ0eXBlIjoiY2FyZCJ9LCJuYW1lIjoiRXhwcmVzc1BheSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdOMWNBPT0iLCJ0eXBlIjoiY3VwIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJEaW5lcnMgQ2x1YiIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdScGJtVnljdz09IiwidHlwZSI6ImRpbmVycyJ9LHsiZGV0YWlscyI6W3sia2V5IjoiZW5jcnlwdGVkQ2FyZE51bWJlciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZFNlY3VyaXR5Q29kZSIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeU1vbnRoIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5WWVhciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImhvbGRlck5hbWUiLCJvcHRpb25hbCI6InRydWUiLCJ0eXBlIjoidGV4dCJ9XSwiZ3JvdXAiOnsibmFtZSI6IkNyZWRpdCBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWE5qYUdWdFpRPT0iLCJ0eXBlIjoiY2FyZCJ9LCJuYW1lIjoiRGlzY292ZXIiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXUnBjMk52ZG1WeSIsInR5cGUiOiJkaXNjb3ZlciJ9LHsibmFtZSI6Ik5hdGlvbmFsZSBFbnRlcnRhaW5tZW50IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXVnVkR1Z5ZEdGcGJtMWxiblJqWVhKayIsInR5cGUiOiJlbnRlcnRhaW5tZW50Y2FyZCJ9LHsibmFtZSI6IkdhbGwgJiBHYWxsIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV2RoYkd4bllXeHMiLCJ0eXBlIjoiZ2FsbGdhbGwifSx7Im5hbWUiOiJQaG9uZSBQYXltZW50IiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV2wyY2c9PSIsInR5cGUiOiJpdnIifSx7Im5hbWUiOiJMYW5kbGluZSBwaG9uZSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdsMmNreGhibVJzYVc1bCIsInR5cGUiOiJpdnJMYW5kbGluZSJ9LHsibmFtZSI6Ik1vYmlsZSBwaG9uZSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdsMmNrMXZZbWxzWlE9PSIsInR5cGUiOiJpdnJNb2JpbGUifSx7ImRldGFpbHMiOlt7ImtleSI6ImVuY3J5cHRlZENhcmROdW1iZXIiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRTZWN1cml0eUNvZGUiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlNb250aCIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeVllYXIiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJob2xkZXJOYW1lIiwib3B0aW9uYWwiOiJ0cnVlIiwidHlwZSI6InRleHQifV0sImdyb3VwIjp7Im5hbWUiOiJDcmVkaXQgQ2FyZCIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFhOamFHVnRaUT09IiwidHlwZSI6ImNhcmQifSwibmFtZSI6IkpDQiIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdwallnPT0iLCJ0eXBlIjoiamNiIn0seyJuYW1lIjoiTW9uZXlib29rZXJzIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQVzF2Ym1WNVltOXZhMlZ5Y3c9PSIsInR5cGUiOiJtb25leWJvb2tlcnMifSx7Im5hbWUiOiJPbmViaXAiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXOXVaV0pwY0E9PSIsInR5cGUiOiJvbmViaXAifSx7Im5hbWUiOiJQcmVtaXVtIFNNUyIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFhOdGN3PT0iLCJ0eXBlIjoic21zIn0seyJuYW1lIjoiVW5pb25QYXkiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYVnVhVzl1Y0dGNSIsInR5cGUiOiJ1bmlvbnBheSJ9LHsibmFtZSI6IldlYnNob3AgR2lmdGNhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYZGxZbk5vYjNCbmFXWjBZMkZ5WkE9PSIsInR5cGUiOiJ3ZWJzaG9wZ2lmdGNhcmQifSx7Im5hbWUiOiJZb3VyIEdpZnQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYbHZkWEpuYVdaMCIsInR5cGUiOiJ5b3VyZ2lmdCJ9XSwicHVibGljS2V5IjoiMTAwMDF8QkNBREY4MjU3RTE4QTFBODlBQ0M0MTQ5RDBGQzMyNEU5ODMxNUMyNDA1RDc1NUU1MDRENjY0QjJDMUM3MUE2MzhCOUQxMkZEMjkwRTEyQTA0QkIxRTZCMkRBM0YzN0M1NTJEMDExQ0ZCQUJCQ0M4NDgwNkFCQjc4RUQxNjU3OERFRDk2NDQ4Q0I4QjU0MTM5RkQ3QzcyRjkwQzA4NkMzNkFFNzdFNjlFOTE3MUEzQTBENTIwRDAyMTM2MzcyNjNFMEM1REY5NjREQUQ4RDc5N0VCMURENkU1NEFENjY5RDYwQUFDMjU1NUUwQzhCRTIyNzNGODk4NDQ3M0U3NkVFNzM4N0ZFQzBFNzFCODM2ODQ0Qjg0MDZBQzkwNTk0OUZCODhGQzY4RThGMDE4NjYzMkYxRURCNEM5QjVCODg4RUY1QzU3RERFMTEzN0JCRjM2RjY1NEU0N0U1NzFGQkM4ODgyOENCRTk0MzhENzQyRjNDMDkyQUQ1RkYzRTYyQUNBRDI1MjQ2RUE0M0QyMkNGQzhBRTE0NDE5NzY3ODY3RDJDNjBEQ0JBNkFDOTIwMDhEMEQ4ODM0QkVBMTExN0FFMzQ3RjMxMkQ2QzAxQzU3Q0I0MkFERDNENEQ2MkUzNzI3QTNDRThBQTFGMDlCRjZCNzk2QTBBMzc0MUJDNDgxMTEifQ==" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payments-action.json b/tests/Resources/ModelBasedCheckout/payments-action.json new file mode 100644 index 000000000..659f627f9 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payments-action.json @@ -0,0 +1,4 @@ +{ + "resultCode": "RedirectShopper", + "action": {"type":"redirect","method":"GET","paymentMethodType":"ideal","url":"url"} +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payments-details-success.json b/tests/Resources/ModelBasedCheckout/payments-details-success.json new file mode 100644 index 000000000..50d146635 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payments-details-success.json @@ -0,0 +1,8 @@ +{ + "pspReference":"8515232733321252", + "resultCode":"Authorised", + "additionalData":{ + "liabilityShift":"true", + "refusalReasonRaw":"AUTHORISED" + } +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payments-forbidden.json b/tests/Resources/ModelBasedCheckout/payments-forbidden.json new file mode 100644 index 000000000..d4f790bc7 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payments-forbidden.json @@ -0,0 +1,7 @@ +{ + "error": { + "code": 403, + "message": "Forbidden", + "requested URI": "\/checkout\/\/v32\/payments" + } +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payments-result-success.json b/tests/Resources/ModelBasedCheckout/payments-result-success.json new file mode 100644 index 000000000..9ee3775ce --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payments-result-success.json @@ -0,0 +1,4 @@ +{ + "pspReference": "8535253563623704", + "resultCode": "Authorised" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payments-success-3D.json b/tests/Resources/ModelBasedCheckout/payments-success-3D.json new file mode 100644 index 000000000..96ee11563 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payments-success-3D.json @@ -0,0 +1,20 @@ +{ + "resultCode": "RedirectShopper", + "details": [{ + "key": "MD", + "type": "text" + }, { + "key": "PaRes", + "type": "text" + }], + "paymentData": "Ab02b4c0!BQABAgBnicwOBkouhPP08Qjg5E5clc0bGyemR...", + "redirect": { + "data": { + "PaReq": "eNpVUttygjAU\/BXbDyAXQZE5ZoZKZ+oD1lp97jDhjNKR...", + "TermUrl": "https:\/\/your-company.com\/...", + "MD": "djIhd29JYnByWUlsYkRuWndGakdkd0F5dz09IWSjFITvzeJZYp37u..." + }, + "method": "POST", + "url": "https:\/\/test.adyen.com\/hpp\/3d\/validate.shtml" + } +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/payments-success.json b/tests/Resources/ModelBasedCheckout/payments-success.json new file mode 100644 index 000000000..df6af3fca --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/payments-success.json @@ -0,0 +1,91 @@ +{ + "additionalData": { + "expiryDate": "3\/2030", + "fraudResultType": "GREEN", + "cardBin": "411111", + "cardSummary": "1111", + "fraudManualReview": "false", + "aliasType": "Default", + "alias": "H167852639363479", + "cardPaymentMethod": "visa", + "cardIssuingCountry": "NL" + }, + "fraudResult": { + "accountScore": 50, + "results": [{ + "FraudCheckResult": { + "accountScore": 0, + "checkId": 2, + "name": "CardChunkUsage" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 3, + "name": "PaymentDetailUsage" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 4, + "name": "HolderNameUsage" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 1, + "name": "PaymentDetailRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 13, + "name": "IssuerRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 15, + "name": "IssuingCountryReferral" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 27, + "name": "PmOwnerRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 50, + "checkId": 41, + "name": "PaymentDetailNonFraudRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 10, + "name": "HolderNameContainsNumber" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 11, + "name": "HolderNameIsOneWord" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 82, + "name": "CustomFieldCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 25, + "name": "CVCAuthResultCheck" + } + }] + }, + "pspReference": "8535253563623704", + "resultCode": "Authorised" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedCheckout/sessions-invalid.json b/tests/Resources/ModelBasedCheckout/sessions-invalid.json new file mode 100644 index 000000000..6bf8db0cb --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/sessions-invalid.json @@ -0,0 +1,6 @@ +{ + "status": 422, + "errorCode": "702", + "message": "Required field 'amount' is null", + "errorType": "validation" +} diff --git a/tests/Resources/ModelBasedCheckout/sessions-success.json b/tests/Resources/ModelBasedCheckout/sessions-success.json new file mode 100644 index 000000000..53b4f05f8 --- /dev/null +++ b/tests/Resources/ModelBasedCheckout/sessions-success.json @@ -0,0 +1,13 @@ +{ + "amount": { + "currency": "EUR", + "value": 100 + }, + "countryCode": "NL", + "expiresAt": "2021-10-07T17:10:07+02:00", + "id": "CS16116100127511AF", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "reference": "YOUR_PAYMENT_REFERENCE", + "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..", + "sessionData": "Ab02b4c0!BQABAgCkkdoH3sSbxaKW4DJPeqCo4nZ0L/YZbdvjoejgicrby+fv4zoa9ayczylZX25ZsG7NzE3Esf4iyHsvMnPz8DtFLgeEPlEV494WcY+p6Eaq9drJUciqschlRFDoVuNxv064s4JVRUQU9wzIOiPyZJCdWti4HN0u5mR7Eo2IoYJAbZdfWNketQGG9S5RNgRInMuyg1rtdQaeWGvGGZaWZbg48kJtCUol1tokF1LpDHjehENbsN1SJ8KPULqu4kRKG+RPTFzpWc+VygOqlaGo8baDbLbZfq0dTNEti/CNJGAP0hbx79BfJ2pfVpsQVrCY6J6mkqnGnosweinQwYnCH5wGcekZ89BCzkl8ZxzUI8cfAbubbs8hLefOEaqKyaKO1kOPbd+fs4kKFNqAmdB0MU86DuTommmR0ZPkTvWaa+c0b2YYtcoemCj7dVazRU6AQYCAG3Byhyx5fNwl/brPOEzWNdAIhwWdXbYLDlrb5bYxHYFKn08OeOqDQU/k4qOR9wJd0itrdeUU8g8c/7WCrnHWB/eCpZ+DbedfsRddGPPeTMFJCD3nntGEvrCbFJKZD1d1URZ95KqY9tbiPvnidSF7vAvail2t+T6xyJMaWu5u6yN6OS0o6hTxncvNvkvgwaDLeEAnb6kHvvUASU2rqBWtTW1uUfcLj+acIeu41qqUBRBJ1V34wlVnZ9ORNWcMyO0nAEp7ImtleSI6IkFGMEFBQTEwM0NBNTM3RUFFRDg3QzI0REQ1MzkwOUI4MEE3OEE5MjNFMzgyM0Q2OERBQ0M5NEI5RkY4MzA1REMifTv2bEojZ8Avv+Ib5c+vZx9vfWyuEEb694m4InmAr8YR+emAqk79XNhMaO5KO+H4e/A6t9lvgNywwGEnS0TzWoNUawCOORQRN3Ebx2MGkhRUnOXIQLucZqW5ibd/7Mw0i8D0q1JY3l5kUdSJHjfqw0+k8fVnPirdaawNsr3StEBZb/kBM39gh49a1xXOnMnenGenD4fcmVjGx0+PKZ3s5ItVm9bMfgbyjQQQmer+VPVu8mp9yoezaobFJFnRUn6THt+gUxny9A1Jl6NWGsrZZ4nt0k3/Wf2ixcWbBk9P3tg9X28FGAGpplS2jcP2Tt2NPClEIMbqh3mY3XWKMniXtRH992qBrAccJ2vN07zwu1U+lYrTr0wsI2oby2lyhZrHhCgeXWi+9aD74kZqzg6sXd4f4u4fbreXT/bxuPk=" +} \ No newline at end of file diff --git a/tests/Unit/ModelBasedCheckoutTest.php b/tests/Unit/ModelBasedCheckoutTest.php new file mode 100644 index 000000000..5787f0166 --- /dev/null +++ b/tests/Unit/ModelBasedCheckoutTest.php @@ -0,0 +1,395 @@ +createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Checkout\PaymentsApi($client); + + $params = array('merchant_account' => "YourMerchantAccount"); + $paymentMethodsRequest = new PaymentMethodsRequest($params); + + $result = $service->paymentMethods($paymentMethodsRequest); + $this->assertEquals('AliPay', $result->getPaymentMethods()[0]->getName()); + } + + public static function successPaymentMethodsProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/payment-methods-success.json', 200) + ); + } + + /** + * @dataProvider successPaymentsProvider + */ + public function testPaymentsSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient(__DIR__ . '/../../' . $jsonFile, $httpStatus); + + // initialize service + $service = new PaymentsApi($client); + + $params = array( + 'merchant_account' => "YourMerchantAccount", + 'amount' => array('currency' => "EUR", 'value' => 1000), + 'payment_method' => array( + 'type' => "scheme", + 'number' => "4111111111111111", + 'expiryMonth' => "08", + 'expiryYear' => "2018", + 'holderName' => self::HOLDER_NAME, + 'cvc' => "737" + ), + 'reference' => "Your order number", + 'return_url' => self::RETURN_URL, + 'additional_data' => array( + 'execute_three_d' => true + ) + ); + $result = $service->payments(new PaymentRequest($params)); + + $this->assertContains($result->getResultCode(), array('RedirectShopper', 'Authorised')); + } + + public static function successPaymentsProvider() + { + return array( + array('tests/Resources/Checkout/payments-success.json', 200), + array('tests/Resources/Checkout/payments-success-3D.json', 200) + ); + } + + /** + * @dataProvider successPaymentsDetailsProvider + */ + public function testPaymentsDetailsSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new PaymentsApi($client); + + $params = array( + 'merchant_account' => "YourMerchantAccount", + 'payment_data' => 'Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...', + 'details' => array( + 'MD' => 'sdfsdfsdf...', + 'PaRes' => 'sdkfhskdjfsdf...' + ), + ); + + $result = $service->paymentsDetails(new DetailsRequest($params)); + + $this->assertContains($result->getResultCode(), array('Authorised')); + } + + public static function successPaymentsDetailsProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/payments-details-success.json', 200) + ); + } + + /** + * @dataProvider successPaymentSessionProvider + */ + public function testPaymentSessionSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new ClassicCheckoutSDKApi($client); + + $params = array( + 'merchant_account' => "YourMerchantAccount", + 'amount' => array('currency' => "EUR", 'value' => 1000), + 'country_code' => "NL", + 'reference' => "Your order number", + 'return_url' => self::RETURN_URL, + "sdk_version" => "1.3.0" + ); + + $result = $service->paymentSession(new PaymentSetupRequest($params)); + + $this->assertNotNull($result->getPaymentSession()); + } + + public static function successPaymentSessionProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/payment-session-success.json', 200) + ); + } + + /** + * @dataProvider successPaymentsResultProvider + */ + public function testPaymentsResultSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new ClassicCheckoutSDKApi($client); + + $params = array( + 'payload' => "YourPayload" + ); + + $result = $service->verifyPaymentResult(new PaymentVerificationRequest($params)); + + $this->assertContains($result->getResultCode(), array('Authorised')); + } + + public static function successPaymentsResultProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/payments-result-success.json', 200) + ); + } + + /** + * @param string $jsonFile + * @param int $httpStatus + * + * @dataProvider successPaymentsLinkProvider + */ + public function testPaymentLinksSuccess($jsonFile, $httpStatus) + { + $client = $this->createMockClient($jsonFile, $httpStatus); + + $service = new PaymentLinksApi($client); + + $result = $service->paymentLinks(new CreatePaymentLinkRequest()); + + $this->assertEquals( + 'https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=PL0A6D6846DB347E59', + $result->getUrl() + ); + } + + public static function successPaymentsLinkProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/payment-links-success.json', 200) + ); + } + + /** + * @param string $jsonFile + * @param int $httpStatus + * + * @dataProvider successDonationsProvider + */ + public function testDonationsSuccess($jsonFile, $httpStatus) + { + $client = $this->createMockClient($jsonFile, $httpStatus); + + $service = new PaymentsApi($client); + + $result = $service->donations(new PaymentDonationRequest()); + $this->assertStringContainsString($result->getReference(), 'YOUR_DONATION_REFERENCE'); + $this->assertStringContainsString($result->getId(), 'UNIQUE_RESOURCE_ID'); + $this->assertStringContainsString($result->getDonationAccount(), 'CHARITY_ACCOUNT'); + } + + public static function successDonationsProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/donations-success.json', 200), + ); + } + + /** + * @param string $jsonFile + * @param int $httpStatus + * + * @dataProvider successSessionsProvider + */ + public function testSessionsSuccess($jsonFile, $httpStatus) + { + $client = $this->createMockClient($jsonFile, $httpStatus); + + $service = new PaymentsApi($client); + + $result = $service->sessions(new CreateCheckoutSessionRequest()); + + $this->assertNotNull($result->getSessionData()); + $this->assertEquals("CS16116100127511AF", $result->getId()); + } + public static function successSessionsProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/sessions-success.json', 200), + ); + } + + /** + * @param string $jsonFile + * @param int $httpStatus + * + * @dataProvider successCardDetailsProvider + */ + public function testCardDetailsSuccess($jsonFile, $httpStatus) + { + $client = $this->createMockClient($jsonFile, $httpStatus); + + $service = new PaymentsApi($client); + + $result = $service->cardDetails(new CardDetailsRequest()); + + $this->assertNotNull($result->getBrands()); + } + + public static function successCardDetailsProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/cardDetails-success.json', 200), + ); + } + + /** + * @param string $jsonFile + * @param int $httpStatus + * + * @dataProvider successGetStoredPaymentMethodsProvider + */ + public function testGetStoredPaymentMethodsSuccess($jsonFile, $httpStatus) + { + $client = $this->createMockClient($jsonFile, $httpStatus); + + $service = new RecurringApi($client); + + $result = $service->getTokensForStoredPaymentDetails(); + + $this->assertNotNull($result->getStoredPaymentMethods()); + $this->assertEquals("merchantAccount", $result->getMerchantAccount()); + } + + public static function successGetStoredPaymentMethodsProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/getStoredPaymentMethods-success.json', 200), + ); + } + + /** + * @param string $jsonFile + * @param int $httpStatus + * + * @dataProvider successDeleteStoredPaymentMethodsProvider + */ + public function testDeleteStoredPaymentMethodsSuccess($jsonFile, $httpStatus) + { + $client = $this->createMockClient($jsonFile, $httpStatus); + + $service = new RecurringApi($client); + + $result = $service->deleteTokenForStoredPaymentDetails("123"); + + $this->assertEquals("CS16116100127511AF", $result->getId()); + $this->assertEquals("networkRef", $result->getNetworkTxReference()); + } + + public static function successDeleteStoredPaymentMethodsProvider() + { + return array( + array('tests/Resources/ModelBasedCheckout/deleteStoredPaymentMethods-success.json', 200), + ); + } + + public function testPaymentMethodSerialization() + { + $amount = new Amount(); + $amount->setValue(100)->setCurrency("EUR"); + + $paymentMethod = new CheckoutPaymentMethod(); + $paymentMethod->setType("directEbanking"); + $paymentRequest = new PaymentRequest(); + $paymentRequest->setAmount($amount) + ->setPaymentMethod($paymentMethod); + + // removed the type checks for oneOf models, as they were not complete. Thus type can be anything that the + // merchant choose (improvements here would be nice) + $this->assertEquals($paymentRequest->getPaymentMethod()->getType(), "directEbanking"); + } + + public function testPaymentMethodOverload() + { + $amount = new Amount(); + $amount->setValue(100)->setCurrency("EUR"); + + $paymentMethod = new CheckoutPaymentMethod(); + $paymentMethod->setType("applepay"); + $paymentMethod->setApplePayToken("applepaytoken"); + $paymentMethod->setGooglePayToken("googlepay"); + $paymentMethod->setAmazonPayToken("token"); + $paymentMethod->setBlikCode("blik"); + // Merchants are able to set all kinds of specific paymentmethod params all in the same paymentMethod class, + // which means they need to rely on the API/docs/explorer to tell them the correct format. + $paymentRequest = new PaymentRequest(); + $paymentRequest->setAmount($amount) + ->setPaymentMethod($paymentMethod); + + $this->assertEquals("applepay", $paymentRequest->getPaymentMethod()->getType()); + } + + /** + * @dataProvider successPaymentsProviderAction + */ + public function testPaymentResponseAction($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new PaymentsApi($client); + $result = $service->payments(new PaymentRequest()); + $action = $result->getAction(); + + $this->assertNotNull($action); + $this->assertEquals("url", $action->getUrl()); + $this->assertEquals("ideal", $action->getPaymentMethodType()); + $this->assertEquals("redirect", $action->getType()); + $this->assertEquals("GET", $action->getMethod()); + } + + public static function successPaymentsProviderAction() + { + return array( + array('tests/Resources/ModelBasedCheckout/payments-action.json', 200) + ); + } +} From 9892a3270c455a48fa19ae65e1c0e4a406c3e173 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Thu, 6 Apr 2023 13:30:58 +0200 Subject: [PATCH 12/33] [ITT-407] Generate Classic Payments (#467) * Generate Payments and write tests * Added modifications tests * add payments to sonar exclusion * remove banner * regenerated * remove long description in services --- src/Adyen/Model/Payments/AccountInfo.php | 1221 +++++++++ src/Adyen/Model/Payments/AcctInfo.php | 1152 ++++++++ .../Model/Payments/AdditionalData3DSecure.php | 594 ++++ .../Model/Payments/AdditionalDataAirline.php | 1306 +++++++++ .../Payments/AdditionalDataCarRental.php | 1133 ++++++++ .../Model/Payments/AdditionalDataCommon.php | 928 +++++++ .../Model/Payments/AdditionalDataLevel23.php | 929 +++++++ .../Model/Payments/AdditionalDataLodging.php | 929 +++++++ .../Payments/AdditionalDataModifications.php | 385 +++ .../Payments/AdditionalDataOpenInvoice.php | 963 +++++++ .../Model/Payments/AdditionalDataOpi.php | 385 +++ .../Model/Payments/AdditionalDataRatepay.php | 623 +++++ .../Model/Payments/AdditionalDataRetry.php | 453 +++ .../Model/Payments/AdditionalDataRisk.php | 1065 ++++++++ .../Payments/AdditionalDataRiskStandalone.php | 861 ++++++ .../Payments/AdditionalDataSubMerchant.php | 691 +++++ .../AdditionalDataTemporaryServices.php | 657 +++++ .../Model/Payments/AdditionalDataWallets.php | 555 ++++ src/Adyen/Model/Payments/Address.php | 570 ++++ .../Payments/AdjustAuthorisationRequest.php | 734 +++++ src/Adyen/Model/Payments/Amount.php | 425 +++ src/Adyen/Model/Payments/ApplicationInfo.php | 555 ++++ .../Payments/AuthenticationResultRequest.php | 425 +++ .../Payments/AuthenticationResultResponse.php | 419 +++ src/Adyen/Model/Payments/BankAccount.php | 657 +++++ src/Adyen/Model/Payments/BrowserInfo.php | 673 +++++ .../Model/Payments/CancelOrRefundRequest.php | 663 +++++ src/Adyen/Model/Payments/CancelRequest.php | 697 +++++ src/Adyen/Model/Payments/CaptureRequest.php | 734 +++++ src/Adyen/Model/Payments/Card.php | 629 +++++ src/Adyen/Model/Payments/CommonField.php | 419 +++ .../Model/Payments/DeviceRenderOptions.php | 483 ++++ src/Adyen/Model/Payments/DonationRequest.php | 564 ++++ src/Adyen/Model/Payments/ExternalPlatform.php | 453 +++ src/Adyen/Model/Payments/ForexQuote.php | 763 ++++++ src/Adyen/Model/Payments/FraudCheckResult.php | 458 ++++ src/Adyen/Model/Payments/FraudResult.php | 420 +++ src/Adyen/Model/Payments/FundDestination.php | 657 +++++ src/Adyen/Model/Payments/FundSource.php | 555 ++++ src/Adyen/Model/Payments/Installments.php | 453 +++ src/Adyen/Model/Payments/Mandate.php | 745 +++++ src/Adyen/Model/Payments/MerchantDevice.php | 453 +++ .../Model/Payments/MerchantRiskIndicator.php | 907 ++++++ src/Adyen/Model/Payments/ModelInterface.php | 93 + .../Model/Payments/ModificationResult.php | 504 ++++ src/Adyen/Model/Payments/Name.php | 425 +++ src/Adyen/Model/Payments/ObjectSerializer.php | 318 +++ src/Adyen/Model/Payments/PaymentRequest.php | 2294 ++++++++++++++++ src/Adyen/Model/Payments/PaymentRequest3d.php | 1958 +++++++++++++ .../Model/Payments/PaymentRequest3ds2.php | 1958 +++++++++++++ src/Adyen/Model/Payments/PaymentResult.php | 780 ++++++ src/Adyen/Model/Payments/Phone.php | 419 +++ .../Payments/PlatformChargebackLogic.php | 454 +++ src/Adyen/Model/Payments/Recurring.php | 589 ++++ src/Adyen/Model/Payments/RefundRequest.php | 734 +++++ .../ResponseAdditionalData3DSecure.php | 521 ++++ .../ResponseAdditionalDataBillingAddress.php | 555 ++++ .../Payments/ResponseAdditionalDataCard.php | 623 +++++ .../Payments/ResponseAdditionalDataCommon.php | 2425 +++++++++++++++++ .../ResponseAdditionalDataInstallments.php | 759 ++++++ .../ResponseAdditionalDataNetworkTokens.php | 453 +++ .../Payments/ResponseAdditionalDataOpi.php | 385 +++ .../Payments/ResponseAdditionalDataSepa.php | 453 +++ src/Adyen/Model/Payments/SDKEphemPubKey.php | 487 ++++ src/Adyen/Model/Payments/ServiceError.php | 553 ++++ .../Payments/ShopperInteractionDevice.php | 453 +++ src/Adyen/Model/Payments/Split.php | 576 ++++ src/Adyen/Model/Payments/SplitAmount.php | 422 +++ src/Adyen/Model/Payments/SubMerchant.php | 521 ++++ .../Model/Payments/TechnicalCancelRequest.php | 697 +++++ src/Adyen/Model/Payments/ThreeDS1Result.php | 555 ++++ .../Model/Payments/ThreeDS2RequestData.php | 1906 +++++++++++++ src/Adyen/Model/Payments/ThreeDS2Result.php | 944 +++++++ .../Model/Payments/ThreeDS2ResultRequest.php | 425 +++ .../Model/Payments/ThreeDS2ResultResponse.php | 385 +++ .../ThreeDSRequestorAuthenticationInfo.php | 494 ++++ ...hreeDSRequestorPriorAuthenticationInfo.php | 524 ++++ src/Adyen/Model/Payments/ThreeDSecureData.php | 884 ++++++ .../Payments/VoidPendingRefundRequest.php | 728 +++++ src/Adyen/Service/Payments/GeneralApi.php | 117 + .../Service/Payments/ModificationsApi.php | 162 ++ templates/partial_header.mustache | 4 - .../ModelBasedPayments/adjust-auth.json | 4 + .../ModelBasedPayments/authorise-success.json | 29 + .../authorise3d-success.json | 29 + .../authorise3ds2-success.json | 29 + .../Resources/ModelBasedPayments/cancel.json | 9 + .../connected-terminals.json | 9 + .../invalid-merchant-account.json | 6 + tests/Unit/ModelBasedPaymentsTest.php | 119 + 90 files changed, 57108 insertions(+), 4 deletions(-) create mode 100644 src/Adyen/Model/Payments/AccountInfo.php create mode 100644 src/Adyen/Model/Payments/AcctInfo.php create mode 100644 src/Adyen/Model/Payments/AdditionalData3DSecure.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataAirline.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataCarRental.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataCommon.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataLevel23.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataLodging.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataModifications.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataOpenInvoice.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataOpi.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataRatepay.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataRetry.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataRisk.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataRiskStandalone.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataSubMerchant.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php create mode 100644 src/Adyen/Model/Payments/AdditionalDataWallets.php create mode 100644 src/Adyen/Model/Payments/Address.php create mode 100644 src/Adyen/Model/Payments/AdjustAuthorisationRequest.php create mode 100644 src/Adyen/Model/Payments/Amount.php create mode 100644 src/Adyen/Model/Payments/ApplicationInfo.php create mode 100644 src/Adyen/Model/Payments/AuthenticationResultRequest.php create mode 100644 src/Adyen/Model/Payments/AuthenticationResultResponse.php create mode 100644 src/Adyen/Model/Payments/BankAccount.php create mode 100644 src/Adyen/Model/Payments/BrowserInfo.php create mode 100644 src/Adyen/Model/Payments/CancelOrRefundRequest.php create mode 100644 src/Adyen/Model/Payments/CancelRequest.php create mode 100644 src/Adyen/Model/Payments/CaptureRequest.php create mode 100644 src/Adyen/Model/Payments/Card.php create mode 100644 src/Adyen/Model/Payments/CommonField.php create mode 100644 src/Adyen/Model/Payments/DeviceRenderOptions.php create mode 100644 src/Adyen/Model/Payments/DonationRequest.php create mode 100644 src/Adyen/Model/Payments/ExternalPlatform.php create mode 100644 src/Adyen/Model/Payments/ForexQuote.php create mode 100644 src/Adyen/Model/Payments/FraudCheckResult.php create mode 100644 src/Adyen/Model/Payments/FraudResult.php create mode 100644 src/Adyen/Model/Payments/FundDestination.php create mode 100644 src/Adyen/Model/Payments/FundSource.php create mode 100644 src/Adyen/Model/Payments/Installments.php create mode 100644 src/Adyen/Model/Payments/Mandate.php create mode 100644 src/Adyen/Model/Payments/MerchantDevice.php create mode 100644 src/Adyen/Model/Payments/MerchantRiskIndicator.php create mode 100644 src/Adyen/Model/Payments/ModelInterface.php create mode 100644 src/Adyen/Model/Payments/ModificationResult.php create mode 100644 src/Adyen/Model/Payments/Name.php create mode 100644 src/Adyen/Model/Payments/ObjectSerializer.php create mode 100644 src/Adyen/Model/Payments/PaymentRequest.php create mode 100644 src/Adyen/Model/Payments/PaymentRequest3d.php create mode 100644 src/Adyen/Model/Payments/PaymentRequest3ds2.php create mode 100644 src/Adyen/Model/Payments/PaymentResult.php create mode 100644 src/Adyen/Model/Payments/Phone.php create mode 100644 src/Adyen/Model/Payments/PlatformChargebackLogic.php create mode 100644 src/Adyen/Model/Payments/Recurring.php create mode 100644 src/Adyen/Model/Payments/RefundRequest.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalData3DSecure.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalDataBillingAddress.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalDataCard.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalDataCommon.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalDataInstallments.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalDataNetworkTokens.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalDataOpi.php create mode 100644 src/Adyen/Model/Payments/ResponseAdditionalDataSepa.php create mode 100644 src/Adyen/Model/Payments/SDKEphemPubKey.php create mode 100644 src/Adyen/Model/Payments/ServiceError.php create mode 100644 src/Adyen/Model/Payments/ShopperInteractionDevice.php create mode 100644 src/Adyen/Model/Payments/Split.php create mode 100644 src/Adyen/Model/Payments/SplitAmount.php create mode 100644 src/Adyen/Model/Payments/SubMerchant.php create mode 100644 src/Adyen/Model/Payments/TechnicalCancelRequest.php create mode 100644 src/Adyen/Model/Payments/ThreeDS1Result.php create mode 100644 src/Adyen/Model/Payments/ThreeDS2RequestData.php create mode 100644 src/Adyen/Model/Payments/ThreeDS2Result.php create mode 100644 src/Adyen/Model/Payments/ThreeDS2ResultRequest.php create mode 100644 src/Adyen/Model/Payments/ThreeDS2ResultResponse.php create mode 100644 src/Adyen/Model/Payments/ThreeDSRequestorAuthenticationInfo.php create mode 100644 src/Adyen/Model/Payments/ThreeDSRequestorPriorAuthenticationInfo.php create mode 100644 src/Adyen/Model/Payments/ThreeDSecureData.php create mode 100644 src/Adyen/Model/Payments/VoidPendingRefundRequest.php create mode 100644 src/Adyen/Service/Payments/GeneralApi.php create mode 100644 src/Adyen/Service/Payments/ModificationsApi.php create mode 100644 tests/Resources/ModelBasedPayments/adjust-auth.json create mode 100644 tests/Resources/ModelBasedPayments/authorise-success.json create mode 100644 tests/Resources/ModelBasedPayments/authorise3d-success.json create mode 100644 tests/Resources/ModelBasedPayments/authorise3ds2-success.json create mode 100644 tests/Resources/ModelBasedPayments/cancel.json create mode 100644 tests/Resources/ModelBasedPayments/connected-terminals.json create mode 100644 tests/Resources/ModelBasedPayments/invalid-merchant-account.json create mode 100644 tests/Unit/ModelBasedPaymentsTest.php diff --git a/src/Adyen/Model/Payments/AccountInfo.php b/src/Adyen/Model/Payments/AccountInfo.php new file mode 100644 index 000000000..f8f2bca8a --- /dev/null +++ b/src/Adyen/Model/Payments/AccountInfo.php @@ -0,0 +1,1221 @@ + + */ +class AccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_age_indicator' => 'string', + 'account_change_date' => '\DateTime', + 'account_change_indicator' => 'string', + 'account_creation_date' => '\DateTime', + 'account_type' => 'string', + 'add_card_attempts_day' => 'int', + 'delivery_address_usage_date' => '\DateTime', + 'delivery_address_usage_indicator' => 'string', + 'home_phone' => 'string', + 'mobile_phone' => 'string', + 'password_change_date' => '\DateTime', + 'password_change_indicator' => 'string', + 'past_transactions_day' => 'int', + 'past_transactions_year' => 'int', + 'payment_account_age' => '\DateTime', + 'payment_account_indicator' => 'string', + 'purchases_last6_months' => 'int', + 'suspicious_activity' => 'bool', + 'work_phone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_age_indicator' => null, + 'account_change_date' => 'date-time', + 'account_change_indicator' => null, + 'account_creation_date' => 'date-time', + 'account_type' => null, + 'add_card_attempts_day' => 'int32', + 'delivery_address_usage_date' => 'date-time', + 'delivery_address_usage_indicator' => null, + 'home_phone' => null, + 'mobile_phone' => null, + 'password_change_date' => 'date-time', + 'password_change_indicator' => null, + 'past_transactions_day' => 'int32', + 'past_transactions_year' => 'int32', + 'payment_account_age' => 'date-time', + 'payment_account_indicator' => null, + 'purchases_last6_months' => 'int32', + 'suspicious_activity' => null, + 'work_phone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_age_indicator' => false, + 'account_change_date' => false, + 'account_change_indicator' => false, + 'account_creation_date' => false, + 'account_type' => false, + 'add_card_attempts_day' => true, + 'delivery_address_usage_date' => false, + 'delivery_address_usage_indicator' => false, + 'home_phone' => false, + 'mobile_phone' => false, + 'password_change_date' => false, + 'password_change_indicator' => false, + 'past_transactions_day' => true, + 'past_transactions_year' => true, + 'payment_account_age' => false, + 'payment_account_indicator' => false, + 'purchases_last6_months' => true, + 'suspicious_activity' => false, + 'work_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_age_indicator' => 'accountAgeIndicator', + 'account_change_date' => 'accountChangeDate', + 'account_change_indicator' => 'accountChangeIndicator', + 'account_creation_date' => 'accountCreationDate', + 'account_type' => 'accountType', + 'add_card_attempts_day' => 'addCardAttemptsDay', + 'delivery_address_usage_date' => 'deliveryAddressUsageDate', + 'delivery_address_usage_indicator' => 'deliveryAddressUsageIndicator', + 'home_phone' => 'homePhone', + 'mobile_phone' => 'mobilePhone', + 'password_change_date' => 'passwordChangeDate', + 'password_change_indicator' => 'passwordChangeIndicator', + 'past_transactions_day' => 'pastTransactionsDay', + 'past_transactions_year' => 'pastTransactionsYear', + 'payment_account_age' => 'paymentAccountAge', + 'payment_account_indicator' => 'paymentAccountIndicator', + 'purchases_last6_months' => 'purchasesLast6Months', + 'suspicious_activity' => 'suspiciousActivity', + 'work_phone' => 'workPhone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_age_indicator' => 'setAccountAgeIndicator', + 'account_change_date' => 'setAccountChangeDate', + 'account_change_indicator' => 'setAccountChangeIndicator', + 'account_creation_date' => 'setAccountCreationDate', + 'account_type' => 'setAccountType', + 'add_card_attempts_day' => 'setAddCardAttemptsDay', + 'delivery_address_usage_date' => 'setDeliveryAddressUsageDate', + 'delivery_address_usage_indicator' => 'setDeliveryAddressUsageIndicator', + 'home_phone' => 'setHomePhone', + 'mobile_phone' => 'setMobilePhone', + 'password_change_date' => 'setPasswordChangeDate', + 'password_change_indicator' => 'setPasswordChangeIndicator', + 'past_transactions_day' => 'setPastTransactionsDay', + 'past_transactions_year' => 'setPastTransactionsYear', + 'payment_account_age' => 'setPaymentAccountAge', + 'payment_account_indicator' => 'setPaymentAccountIndicator', + 'purchases_last6_months' => 'setPurchasesLast6Months', + 'suspicious_activity' => 'setSuspiciousActivity', + 'work_phone' => 'setWorkPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_age_indicator' => 'getAccountAgeIndicator', + 'account_change_date' => 'getAccountChangeDate', + 'account_change_indicator' => 'getAccountChangeIndicator', + 'account_creation_date' => 'getAccountCreationDate', + 'account_type' => 'getAccountType', + 'add_card_attempts_day' => 'getAddCardAttemptsDay', + 'delivery_address_usage_date' => 'getDeliveryAddressUsageDate', + 'delivery_address_usage_indicator' => 'getDeliveryAddressUsageIndicator', + 'home_phone' => 'getHomePhone', + 'mobile_phone' => 'getMobilePhone', + 'password_change_date' => 'getPasswordChangeDate', + 'password_change_indicator' => 'getPasswordChangeIndicator', + 'past_transactions_day' => 'getPastTransactionsDay', + 'past_transactions_year' => 'getPastTransactionsYear', + 'payment_account_age' => 'getPaymentAccountAge', + 'payment_account_indicator' => 'getPaymentAccountIndicator', + 'purchases_last6_months' => 'getPurchasesLast6Months', + 'suspicious_activity' => 'getSuspiciousActivity', + 'work_phone' => 'getWorkPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACCOUNT_AGE_INDICATOR_NOT_APPLICABLE = 'notApplicable'; + public const ACCOUNT_AGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const ACCOUNT_AGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const ACCOUNT_AGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const ACCOUNT_AGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const ACCOUNT_CHANGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const ACCOUNT_CHANGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const ACCOUNT_CHANGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const ACCOUNT_CHANGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const ACCOUNT_TYPE_NOT_APPLICABLE = 'notApplicable'; + public const ACCOUNT_TYPE_CREDIT = 'credit'; + public const ACCOUNT_TYPE_DEBIT = 'debit'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const DELIVERY_ADDRESS_USAGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const PASSWORD_CHANGE_INDICATOR_NOT_APPLICABLE = 'notApplicable'; + public const PASSWORD_CHANGE_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const PASSWORD_CHANGE_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const PASSWORD_CHANGE_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const PASSWORD_CHANGE_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + public const PAYMENT_ACCOUNT_INDICATOR_NOT_APPLICABLE = 'notApplicable'; + public const PAYMENT_ACCOUNT_INDICATOR_THIS_TRANSACTION = 'thisTransaction'; + public const PAYMENT_ACCOUNT_INDICATOR_LESS_THAN30_DAYS = 'lessThan30Days'; + public const PAYMENT_ACCOUNT_INDICATOR_FROM30_TO60_DAYS = 'from30To60Days'; + public const PAYMENT_ACCOUNT_INDICATOR_MORE_THAN60_DAYS = 'moreThan60Days'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountAgeIndicatorAllowableValues() + { + return [ + self::ACCOUNT_AGE_INDICATOR_NOT_APPLICABLE, + self::ACCOUNT_AGE_INDICATOR_THIS_TRANSACTION, + self::ACCOUNT_AGE_INDICATOR_LESS_THAN30_DAYS, + self::ACCOUNT_AGE_INDICATOR_FROM30_TO60_DAYS, + self::ACCOUNT_AGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountChangeIndicatorAllowableValues() + { + return [ + self::ACCOUNT_CHANGE_INDICATOR_THIS_TRANSACTION, + self::ACCOUNT_CHANGE_INDICATOR_LESS_THAN30_DAYS, + self::ACCOUNT_CHANGE_INDICATOR_FROM30_TO60_DAYS, + self::ACCOUNT_CHANGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAccountTypeAllowableValues() + { + return [ + self::ACCOUNT_TYPE_NOT_APPLICABLE, + self::ACCOUNT_TYPE_CREDIT, + self::ACCOUNT_TYPE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeliveryAddressUsageIndicatorAllowableValues() + { + return [ + self::DELIVERY_ADDRESS_USAGE_INDICATOR_THIS_TRANSACTION, + self::DELIVERY_ADDRESS_USAGE_INDICATOR_LESS_THAN30_DAYS, + self::DELIVERY_ADDRESS_USAGE_INDICATOR_FROM30_TO60_DAYS, + self::DELIVERY_ADDRESS_USAGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPasswordChangeIndicatorAllowableValues() + { + return [ + self::PASSWORD_CHANGE_INDICATOR_NOT_APPLICABLE, + self::PASSWORD_CHANGE_INDICATOR_THIS_TRANSACTION, + self::PASSWORD_CHANGE_INDICATOR_LESS_THAN30_DAYS, + self::PASSWORD_CHANGE_INDICATOR_FROM30_TO60_DAYS, + self::PASSWORD_CHANGE_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentAccountIndicatorAllowableValues() + { + return [ + self::PAYMENT_ACCOUNT_INDICATOR_NOT_APPLICABLE, + self::PAYMENT_ACCOUNT_INDICATOR_THIS_TRANSACTION, + self::PAYMENT_ACCOUNT_INDICATOR_LESS_THAN30_DAYS, + self::PAYMENT_ACCOUNT_INDICATOR_FROM30_TO60_DAYS, + self::PAYMENT_ACCOUNT_INDICATOR_MORE_THAN60_DAYS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_age_indicator', $data ?? [], null); + $this->setIfExists('account_change_date', $data ?? [], null); + $this->setIfExists('account_change_indicator', $data ?? [], null); + $this->setIfExists('account_creation_date', $data ?? [], null); + $this->setIfExists('account_type', $data ?? [], null); + $this->setIfExists('add_card_attempts_day', $data ?? [], null); + $this->setIfExists('delivery_address_usage_date', $data ?? [], null); + $this->setIfExists('delivery_address_usage_indicator', $data ?? [], null); + $this->setIfExists('home_phone', $data ?? [], null); + $this->setIfExists('mobile_phone', $data ?? [], null); + $this->setIfExists('password_change_date', $data ?? [], null); + $this->setIfExists('password_change_indicator', $data ?? [], null); + $this->setIfExists('past_transactions_day', $data ?? [], null); + $this->setIfExists('past_transactions_year', $data ?? [], null); + $this->setIfExists('payment_account_age', $data ?? [], null); + $this->setIfExists('payment_account_indicator', $data ?? [], null); + $this->setIfExists('purchases_last6_months', $data ?? [], null); + $this->setIfExists('suspicious_activity', $data ?? [], null); + $this->setIfExists('work_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAccountAgeIndicatorAllowableValues(); + if (!is_null($this->container['account_age_indicator']) && !in_array($this->container['account_age_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_age_indicator', must be one of '%s'", + $this->container['account_age_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAccountChangeIndicatorAllowableValues(); + if (!is_null($this->container['account_change_indicator']) && !in_array($this->container['account_change_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_change_indicator', must be one of '%s'", + $this->container['account_change_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!is_null($this->container['account_type']) && !in_array($this->container['account_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'account_type', must be one of '%s'", + $this->container['account_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDeliveryAddressUsageIndicatorAllowableValues(); + if (!is_null($this->container['delivery_address_usage_indicator']) && !in_array($this->container['delivery_address_usage_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'delivery_address_usage_indicator', must be one of '%s'", + $this->container['delivery_address_usage_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPasswordChangeIndicatorAllowableValues(); + if (!is_null($this->container['password_change_indicator']) && !in_array($this->container['password_change_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'password_change_indicator', must be one of '%s'", + $this->container['password_change_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPaymentAccountIndicatorAllowableValues(); + if (!is_null($this->container['payment_account_indicator']) && !in_array($this->container['payment_account_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'payment_account_indicator', must be one of '%s'", + $this->container['payment_account_indicator'], + 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 account_age_indicator + * + * @return string|null + */ + public function getAccountAgeIndicator() + { + return $this->container['account_age_indicator']; + } + + /** + * Sets account_age_indicator + * + * @param string|null $account_age_indicator Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setAccountAgeIndicator($account_age_indicator) + { + if (is_null($account_age_indicator)) { + throw new \InvalidArgumentException('non-nullable account_age_indicator cannot be null'); + } + $allowedValues = $this->getAccountAgeIndicatorAllowableValues(); + if (!in_array($account_age_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_age_indicator', must be one of '%s'", + $account_age_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_age_indicator'] = $account_age_indicator; + + return $this; + } + + /** + * Gets account_change_date + * + * @return \DateTime|null + */ + public function getAccountChangeDate() + { + return $this->container['account_change_date']; + } + + /** + * Sets account_change_date + * + * @param \DateTime|null $account_change_date Date when the shopper's account was last changed. + * + * @return self + */ + public function setAccountChangeDate($account_change_date) + { + if (is_null($account_change_date)) { + throw new \InvalidArgumentException('non-nullable account_change_date cannot be null'); + } + $this->container['account_change_date'] = $account_change_date; + + return $this; + } + + /** + * Gets account_change_indicator + * + * @return string|null + */ + public function getAccountChangeIndicator() + { + return $this->container['account_change_indicator']; + } + + /** + * Sets account_change_indicator + * + * @param string|null $account_change_indicator Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setAccountChangeIndicator($account_change_indicator) + { + if (is_null($account_change_indicator)) { + throw new \InvalidArgumentException('non-nullable account_change_indicator cannot be null'); + } + $allowedValues = $this->getAccountChangeIndicatorAllowableValues(); + if (!in_array($account_change_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_change_indicator', must be one of '%s'", + $account_change_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_change_indicator'] = $account_change_indicator; + + return $this; + } + + /** + * Gets account_creation_date + * + * @return \DateTime|null + */ + public function getAccountCreationDate() + { + return $this->container['account_creation_date']; + } + + /** + * Sets account_creation_date + * + * @param \DateTime|null $account_creation_date Date when the shopper's account was created. + * + * @return self + */ + public function setAccountCreationDate($account_creation_date) + { + if (is_null($account_creation_date)) { + throw new \InvalidArgumentException('non-nullable account_creation_date cannot be null'); + } + $this->container['account_creation_date'] = $account_creation_date; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $allowedValues = $this->getAccountTypeAllowableValues(); + if (!in_array($account_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'account_type', must be one of '%s'", + $account_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets add_card_attempts_day + * + * @return int|null + */ + public function getAddCardAttemptsDay() + { + return $this->container['add_card_attempts_day']; + } + + /** + * Sets add_card_attempts_day + * + * @param int|null $add_card_attempts_day Number of attempts the shopper tried to add a card to their account in the last day. + * + * @return self + */ + public function setAddCardAttemptsDay($add_card_attempts_day) + { + // Do nothing for nullable integers + $this->container['add_card_attempts_day'] = $add_card_attempts_day; + + return $this; + } + + /** + * Gets delivery_address_usage_date + * + * @return \DateTime|null + */ + public function getDeliveryAddressUsageDate() + { + return $this->container['delivery_address_usage_date']; + } + + /** + * Sets delivery_address_usage_date + * + * @param \DateTime|null $delivery_address_usage_date Date the selected delivery address was first used. + * + * @return self + */ + public function setDeliveryAddressUsageDate($delivery_address_usage_date) + { + if (is_null($delivery_address_usage_date)) { + throw new \InvalidArgumentException('non-nullable delivery_address_usage_date cannot be null'); + } + $this->container['delivery_address_usage_date'] = $delivery_address_usage_date; + + return $this; + } + + /** + * Gets delivery_address_usage_indicator + * + * @return string|null + */ + public function getDeliveryAddressUsageIndicator() + { + return $this->container['delivery_address_usage_indicator']; + } + + /** + * Sets delivery_address_usage_indicator + * + * @param string|null $delivery_address_usage_indicator Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setDeliveryAddressUsageIndicator($delivery_address_usage_indicator) + { + if (is_null($delivery_address_usage_indicator)) { + throw new \InvalidArgumentException('non-nullable delivery_address_usage_indicator cannot be null'); + } + $allowedValues = $this->getDeliveryAddressUsageIndicatorAllowableValues(); + if (!in_array($delivery_address_usage_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'delivery_address_usage_indicator', must be one of '%s'", + $delivery_address_usage_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['delivery_address_usage_indicator'] = $delivery_address_usage_indicator; + + return $this; + } + + /** + * Gets home_phone + * + * @return string|null + * @deprecated + */ + public function getHomePhone() + { + return $this->container['home_phone']; + } + + /** + * Sets home_phone + * + * @param string|null $home_phone Shopper's home phone number (including the country code). + * + * @return self + * @deprecated + */ + public function setHomePhone($home_phone) + { + if (is_null($home_phone)) { + throw new \InvalidArgumentException('non-nullable home_phone cannot be null'); + } + $this->container['home_phone'] = $home_phone; + + return $this; + } + + /** + * Gets mobile_phone + * + * @return string|null + * @deprecated + */ + public function getMobilePhone() + { + return $this->container['mobile_phone']; + } + + /** + * Sets mobile_phone + * + * @param string|null $mobile_phone Shopper's mobile phone number (including the country code). + * + * @return self + * @deprecated + */ + public function setMobilePhone($mobile_phone) + { + if (is_null($mobile_phone)) { + throw new \InvalidArgumentException('non-nullable mobile_phone cannot be null'); + } + $this->container['mobile_phone'] = $mobile_phone; + + return $this; + } + + /** + * Gets password_change_date + * + * @return \DateTime|null + */ + public function getPasswordChangeDate() + { + return $this->container['password_change_date']; + } + + /** + * Sets password_change_date + * + * @param \DateTime|null $password_change_date Date when the shopper last changed their password. + * + * @return self + */ + public function setPasswordChangeDate($password_change_date) + { + if (is_null($password_change_date)) { + throw new \InvalidArgumentException('non-nullable password_change_date cannot be null'); + } + $this->container['password_change_date'] = $password_change_date; + + return $this; + } + + /** + * Gets password_change_indicator + * + * @return string|null + */ + public function getPasswordChangeIndicator() + { + return $this->container['password_change_indicator']; + } + + /** + * Sets password_change_indicator + * + * @param string|null $password_change_indicator Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setPasswordChangeIndicator($password_change_indicator) + { + if (is_null($password_change_indicator)) { + throw new \InvalidArgumentException('non-nullable password_change_indicator cannot be null'); + } + $allowedValues = $this->getPasswordChangeIndicatorAllowableValues(); + if (!in_array($password_change_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'password_change_indicator', must be one of '%s'", + $password_change_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['password_change_indicator'] = $password_change_indicator; + + return $this; + } + + /** + * Gets past_transactions_day + * + * @return int|null + */ + public function getPastTransactionsDay() + { + return $this->container['past_transactions_day']; + } + + /** + * Sets past_transactions_day + * + * @param int|null $past_transactions_day Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. + * + * @return self + */ + public function setPastTransactionsDay($past_transactions_day) + { + // Do nothing for nullable integers + $this->container['past_transactions_day'] = $past_transactions_day; + + return $this; + } + + /** + * Gets past_transactions_year + * + * @return int|null + */ + public function getPastTransactionsYear() + { + return $this->container['past_transactions_year']; + } + + /** + * Sets past_transactions_year + * + * @param int|null $past_transactions_year Number of all transactions (successful and abandoned) from this shopper in the past year. + * + * @return self + */ + public function setPastTransactionsYear($past_transactions_year) + { + // Do nothing for nullable integers + $this->container['past_transactions_year'] = $past_transactions_year; + + return $this; + } + + /** + * Gets payment_account_age + * + * @return \DateTime|null + */ + public function getPaymentAccountAge() + { + return $this->container['payment_account_age']; + } + + /** + * Sets payment_account_age + * + * @param \DateTime|null $payment_account_age Date this payment method was added to the shopper's account. + * + * @return self + */ + public function setPaymentAccountAge($payment_account_age) + { + if (is_null($payment_account_age)) { + throw new \InvalidArgumentException('non-nullable payment_account_age cannot be null'); + } + $this->container['payment_account_age'] = $payment_account_age; + + return $this; + } + + /** + * Gets payment_account_indicator + * + * @return string|null + */ + public function getPaymentAccountIndicator() + { + return $this->container['payment_account_indicator']; + } + + /** + * Sets payment_account_indicator + * + * @param string|null $payment_account_indicator Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + * + * @return self + */ + public function setPaymentAccountIndicator($payment_account_indicator) + { + if (is_null($payment_account_indicator)) { + throw new \InvalidArgumentException('non-nullable payment_account_indicator cannot be null'); + } + $allowedValues = $this->getPaymentAccountIndicatorAllowableValues(); + if (!in_array($payment_account_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'payment_account_indicator', must be one of '%s'", + $payment_account_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['payment_account_indicator'] = $payment_account_indicator; + + return $this; + } + + /** + * Gets purchases_last6_months + * + * @return int|null + */ + public function getPurchasesLast6Months() + { + return $this->container['purchases_last6_months']; + } + + /** + * Sets purchases_last6_months + * + * @param int|null $purchases_last6_months Number of successful purchases in the last six months. + * + * @return self + */ + public function setPurchasesLast6Months($purchases_last6_months) + { + // Do nothing for nullable integers + $this->container['purchases_last6_months'] = $purchases_last6_months; + + return $this; + } + + /** + * Gets suspicious_activity + * + * @return bool|null + */ + public function getSuspiciousActivity() + { + return $this->container['suspicious_activity']; + } + + /** + * Sets suspicious_activity + * + * @param bool|null $suspicious_activity Whether suspicious activity was recorded on this account. + * + * @return self + */ + public function setSuspiciousActivity($suspicious_activity) + { + if (is_null($suspicious_activity)) { + throw new \InvalidArgumentException('non-nullable suspicious_activity cannot be null'); + } + $this->container['suspicious_activity'] = $suspicious_activity; + + return $this; + } + + /** + * Gets work_phone + * + * @return string|null + * @deprecated + */ + public function getWorkPhone() + { + return $this->container['work_phone']; + } + + /** + * Sets work_phone + * + * @param string|null $work_phone Shopper's work phone number (including the country code). + * + * @return self + * @deprecated + */ + public function setWorkPhone($work_phone) + { + if (is_null($work_phone)) { + throw new \InvalidArgumentException('non-nullable work_phone cannot be null'); + } + $this->container['work_phone'] = $work_phone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AcctInfo.php b/src/Adyen/Model/Payments/AcctInfo.php new file mode 100644 index 000000000..579cbb160 --- /dev/null +++ b/src/Adyen/Model/Payments/AcctInfo.php @@ -0,0 +1,1152 @@ + + */ +class AcctInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AcctInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ch_acc_age_ind' => 'string', + 'ch_acc_change' => 'string', + 'ch_acc_change_ind' => 'string', + 'ch_acc_pw_change' => 'string', + 'ch_acc_pw_change_ind' => 'string', + 'ch_acc_string' => 'string', + 'nb_purchase_account' => 'string', + 'payment_acc_age' => 'string', + 'payment_acc_ind' => 'string', + 'provision_attempts_day' => 'string', + 'ship_address_usage' => 'string', + 'ship_address_usage_ind' => 'string', + 'ship_name_indicator' => 'string', + 'suspicious_acc_activity' => 'string', + 'txn_activity_day' => 'string', + 'txn_activity_year' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ch_acc_age_ind' => null, + 'ch_acc_change' => null, + 'ch_acc_change_ind' => null, + 'ch_acc_pw_change' => null, + 'ch_acc_pw_change_ind' => null, + 'ch_acc_string' => null, + 'nb_purchase_account' => null, + 'payment_acc_age' => null, + 'payment_acc_ind' => null, + 'provision_attempts_day' => null, + 'ship_address_usage' => null, + 'ship_address_usage_ind' => null, + 'ship_name_indicator' => null, + 'suspicious_acc_activity' => null, + 'txn_activity_day' => null, + 'txn_activity_year' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'ch_acc_age_ind' => false, + 'ch_acc_change' => false, + 'ch_acc_change_ind' => false, + 'ch_acc_pw_change' => false, + 'ch_acc_pw_change_ind' => false, + 'ch_acc_string' => false, + 'nb_purchase_account' => false, + 'payment_acc_age' => false, + 'payment_acc_ind' => false, + 'provision_attempts_day' => false, + 'ship_address_usage' => false, + 'ship_address_usage_ind' => false, + 'ship_name_indicator' => false, + 'suspicious_acc_activity' => false, + 'txn_activity_day' => false, + 'txn_activity_year' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ch_acc_age_ind' => 'chAccAgeInd', + 'ch_acc_change' => 'chAccChange', + 'ch_acc_change_ind' => 'chAccChangeInd', + 'ch_acc_pw_change' => 'chAccPwChange', + 'ch_acc_pw_change_ind' => 'chAccPwChangeInd', + 'ch_acc_string' => 'chAccString', + 'nb_purchase_account' => 'nbPurchaseAccount', + 'payment_acc_age' => 'paymentAccAge', + 'payment_acc_ind' => 'paymentAccInd', + 'provision_attempts_day' => 'provisionAttemptsDay', + 'ship_address_usage' => 'shipAddressUsage', + 'ship_address_usage_ind' => 'shipAddressUsageInd', + 'ship_name_indicator' => 'shipNameIndicator', + 'suspicious_acc_activity' => 'suspiciousAccActivity', + 'txn_activity_day' => 'txnActivityDay', + 'txn_activity_year' => 'txnActivityYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ch_acc_age_ind' => 'setChAccAgeInd', + 'ch_acc_change' => 'setChAccChange', + 'ch_acc_change_ind' => 'setChAccChangeInd', + 'ch_acc_pw_change' => 'setChAccPwChange', + 'ch_acc_pw_change_ind' => 'setChAccPwChangeInd', + 'ch_acc_string' => 'setChAccString', + 'nb_purchase_account' => 'setNbPurchaseAccount', + 'payment_acc_age' => 'setPaymentAccAge', + 'payment_acc_ind' => 'setPaymentAccInd', + 'provision_attempts_day' => 'setProvisionAttemptsDay', + 'ship_address_usage' => 'setShipAddressUsage', + 'ship_address_usage_ind' => 'setShipAddressUsageInd', + 'ship_name_indicator' => 'setShipNameIndicator', + 'suspicious_acc_activity' => 'setSuspiciousAccActivity', + 'txn_activity_day' => 'setTxnActivityDay', + 'txn_activity_year' => 'setTxnActivityYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ch_acc_age_ind' => 'getChAccAgeInd', + 'ch_acc_change' => 'getChAccChange', + 'ch_acc_change_ind' => 'getChAccChangeInd', + 'ch_acc_pw_change' => 'getChAccPwChange', + 'ch_acc_pw_change_ind' => 'getChAccPwChangeInd', + 'ch_acc_string' => 'getChAccString', + 'nb_purchase_account' => 'getNbPurchaseAccount', + 'payment_acc_age' => 'getPaymentAccAge', + 'payment_acc_ind' => 'getPaymentAccInd', + 'provision_attempts_day' => 'getProvisionAttemptsDay', + 'ship_address_usage' => 'getShipAddressUsage', + 'ship_address_usage_ind' => 'getShipAddressUsageInd', + 'ship_name_indicator' => 'getShipNameIndicator', + 'suspicious_acc_activity' => 'getSuspiciousAccActivity', + 'txn_activity_day' => 'getTxnActivityDay', + 'txn_activity_year' => 'getTxnActivityYear' + ]; + + /** + * 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 CH_ACC_AGE_IND__01 = '01'; + public const CH_ACC_AGE_IND__02 = '02'; + public const CH_ACC_AGE_IND__03 = '03'; + public const CH_ACC_AGE_IND__04 = '04'; + public const CH_ACC_AGE_IND__05 = '05'; + public const CH_ACC_CHANGE_IND__01 = '01'; + public const CH_ACC_CHANGE_IND__02 = '02'; + public const CH_ACC_CHANGE_IND__03 = '03'; + public const CH_ACC_CHANGE_IND__04 = '04'; + public const CH_ACC_PW_CHANGE_IND__01 = '01'; + public const CH_ACC_PW_CHANGE_IND__02 = '02'; + public const CH_ACC_PW_CHANGE_IND__03 = '03'; + public const CH_ACC_PW_CHANGE_IND__04 = '04'; + public const CH_ACC_PW_CHANGE_IND__05 = '05'; + public const PAYMENT_ACC_IND__01 = '01'; + public const PAYMENT_ACC_IND__02 = '02'; + public const PAYMENT_ACC_IND__03 = '03'; + public const PAYMENT_ACC_IND__04 = '04'; + public const PAYMENT_ACC_IND__05 = '05'; + public const SHIP_ADDRESS_USAGE_IND__01 = '01'; + public const SHIP_ADDRESS_USAGE_IND__02 = '02'; + public const SHIP_ADDRESS_USAGE_IND__03 = '03'; + public const SHIP_ADDRESS_USAGE_IND__04 = '04'; + public const SHIP_NAME_INDICATOR__01 = '01'; + public const SHIP_NAME_INDICATOR__02 = '02'; + public const SUSPICIOUS_ACC_ACTIVITY__01 = '01'; + public const SUSPICIOUS_ACC_ACTIVITY__02 = '02'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChAccAgeIndAllowableValues() + { + return [ + self::CH_ACC_AGE_IND__01, + self::CH_ACC_AGE_IND__02, + self::CH_ACC_AGE_IND__03, + self::CH_ACC_AGE_IND__04, + self::CH_ACC_AGE_IND__05, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChAccChangeIndAllowableValues() + { + return [ + self::CH_ACC_CHANGE_IND__01, + self::CH_ACC_CHANGE_IND__02, + self::CH_ACC_CHANGE_IND__03, + self::CH_ACC_CHANGE_IND__04, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChAccPwChangeIndAllowableValues() + { + return [ + self::CH_ACC_PW_CHANGE_IND__01, + self::CH_ACC_PW_CHANGE_IND__02, + self::CH_ACC_PW_CHANGE_IND__03, + self::CH_ACC_PW_CHANGE_IND__04, + self::CH_ACC_PW_CHANGE_IND__05, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentAccIndAllowableValues() + { + return [ + self::PAYMENT_ACC_IND__01, + self::PAYMENT_ACC_IND__02, + self::PAYMENT_ACC_IND__03, + self::PAYMENT_ACC_IND__04, + self::PAYMENT_ACC_IND__05, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShipAddressUsageIndAllowableValues() + { + return [ + self::SHIP_ADDRESS_USAGE_IND__01, + self::SHIP_ADDRESS_USAGE_IND__02, + self::SHIP_ADDRESS_USAGE_IND__03, + self::SHIP_ADDRESS_USAGE_IND__04, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShipNameIndicatorAllowableValues() + { + return [ + self::SHIP_NAME_INDICATOR__01, + self::SHIP_NAME_INDICATOR__02, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSuspiciousAccActivityAllowableValues() + { + return [ + self::SUSPICIOUS_ACC_ACTIVITY__01, + self::SUSPICIOUS_ACC_ACTIVITY__02, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ch_acc_age_ind', $data ?? [], null); + $this->setIfExists('ch_acc_change', $data ?? [], null); + $this->setIfExists('ch_acc_change_ind', $data ?? [], null); + $this->setIfExists('ch_acc_pw_change', $data ?? [], null); + $this->setIfExists('ch_acc_pw_change_ind', $data ?? [], null); + $this->setIfExists('ch_acc_string', $data ?? [], null); + $this->setIfExists('nb_purchase_account', $data ?? [], null); + $this->setIfExists('payment_acc_age', $data ?? [], null); + $this->setIfExists('payment_acc_ind', $data ?? [], null); + $this->setIfExists('provision_attempts_day', $data ?? [], null); + $this->setIfExists('ship_address_usage', $data ?? [], null); + $this->setIfExists('ship_address_usage_ind', $data ?? [], null); + $this->setIfExists('ship_name_indicator', $data ?? [], null); + $this->setIfExists('suspicious_acc_activity', $data ?? [], null); + $this->setIfExists('txn_activity_day', $data ?? [], null); + $this->setIfExists('txn_activity_year', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChAccAgeIndAllowableValues(); + if (!is_null($this->container['ch_acc_age_ind']) && !in_array($this->container['ch_acc_age_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ch_acc_age_ind', must be one of '%s'", + $this->container['ch_acc_age_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChAccChangeIndAllowableValues(); + if (!is_null($this->container['ch_acc_change_ind']) && !in_array($this->container['ch_acc_change_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ch_acc_change_ind', must be one of '%s'", + $this->container['ch_acc_change_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChAccPwChangeIndAllowableValues(); + if (!is_null($this->container['ch_acc_pw_change_ind']) && !in_array($this->container['ch_acc_pw_change_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ch_acc_pw_change_ind', must be one of '%s'", + $this->container['ch_acc_pw_change_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPaymentAccIndAllowableValues(); + if (!is_null($this->container['payment_acc_ind']) && !in_array($this->container['payment_acc_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'payment_acc_ind', must be one of '%s'", + $this->container['payment_acc_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getShipAddressUsageIndAllowableValues(); + if (!is_null($this->container['ship_address_usage_ind']) && !in_array($this->container['ship_address_usage_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ship_address_usage_ind', must be one of '%s'", + $this->container['ship_address_usage_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getShipNameIndicatorAllowableValues(); + if (!is_null($this->container['ship_name_indicator']) && !in_array($this->container['ship_name_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ship_name_indicator', must be one of '%s'", + $this->container['ship_name_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSuspiciousAccActivityAllowableValues(); + if (!is_null($this->container['suspicious_acc_activity']) && !in_array($this->container['suspicious_acc_activity'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'suspicious_acc_activity', must be one of '%s'", + $this->container['suspicious_acc_activity'], + 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 ch_acc_age_ind + * + * @return string|null + */ + public function getChAccAgeInd() + { + return $this->container['ch_acc_age_ind']; + } + + /** + * Sets ch_acc_age_ind + * + * @param string|null $ch_acc_age_ind Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + * + * @return self + */ + public function setChAccAgeInd($ch_acc_age_ind) + { + if (is_null($ch_acc_age_ind)) { + throw new \InvalidArgumentException('non-nullable ch_acc_age_ind cannot be null'); + } + $allowedValues = $this->getChAccAgeIndAllowableValues(); + if (!in_array($ch_acc_age_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ch_acc_age_ind', must be one of '%s'", + $ch_acc_age_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ch_acc_age_ind'] = $ch_acc_age_ind; + + return $this; + } + + /** + * Gets ch_acc_change + * + * @return string|null + */ + public function getChAccChange() + { + return $this->container['ch_acc_change']; + } + + /** + * Sets ch_acc_change + * + * @param string|null $ch_acc_change Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** + * + * @return self + */ + public function setChAccChange($ch_acc_change) + { + if (is_null($ch_acc_change)) { + throw new \InvalidArgumentException('non-nullable ch_acc_change cannot be null'); + } + $this->container['ch_acc_change'] = $ch_acc_change; + + return $this; + } + + /** + * Gets ch_acc_change_ind + * + * @return string|null + */ + public function getChAccChangeInd() + { + return $this->container['ch_acc_change_ind']; + } + + /** + * Sets ch_acc_change_ind + * + * @param string|null $ch_acc_change_ind Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + * + * @return self + */ + public function setChAccChangeInd($ch_acc_change_ind) + { + if (is_null($ch_acc_change_ind)) { + throw new \InvalidArgumentException('non-nullable ch_acc_change_ind cannot be null'); + } + $allowedValues = $this->getChAccChangeIndAllowableValues(); + if (!in_array($ch_acc_change_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ch_acc_change_ind', must be one of '%s'", + $ch_acc_change_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ch_acc_change_ind'] = $ch_acc_change_ind; + + return $this; + } + + /** + * Gets ch_acc_pw_change + * + * @return string|null + */ + public function getChAccPwChange() + { + return $this->container['ch_acc_pw_change']; + } + + /** + * Sets ch_acc_pw_change + * + * @param string|null $ch_acc_pw_change Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** + * + * @return self + */ + public function setChAccPwChange($ch_acc_pw_change) + { + if (is_null($ch_acc_pw_change)) { + throw new \InvalidArgumentException('non-nullable ch_acc_pw_change cannot be null'); + } + $this->container['ch_acc_pw_change'] = $ch_acc_pw_change; + + return $this; + } + + /** + * Gets ch_acc_pw_change_ind + * + * @return string|null + */ + public function getChAccPwChangeInd() + { + return $this->container['ch_acc_pw_change_ind']; + } + + /** + * Sets ch_acc_pw_change_ind + * + * @param string|null $ch_acc_pw_change_ind Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + * + * @return self + */ + public function setChAccPwChangeInd($ch_acc_pw_change_ind) + { + if (is_null($ch_acc_pw_change_ind)) { + throw new \InvalidArgumentException('non-nullable ch_acc_pw_change_ind cannot be null'); + } + $allowedValues = $this->getChAccPwChangeIndAllowableValues(); + if (!in_array($ch_acc_pw_change_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ch_acc_pw_change_ind', must be one of '%s'", + $ch_acc_pw_change_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ch_acc_pw_change_ind'] = $ch_acc_pw_change_ind; + + return $this; + } + + /** + * Gets ch_acc_string + * + * @return string|null + */ + public function getChAccString() + { + return $this->container['ch_acc_string']; + } + + /** + * Sets ch_acc_string + * + * @param string|null $ch_acc_string Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** + * + * @return self + */ + public function setChAccString($ch_acc_string) + { + if (is_null($ch_acc_string)) { + throw new \InvalidArgumentException('non-nullable ch_acc_string cannot be null'); + } + $this->container['ch_acc_string'] = $ch_acc_string; + + return $this; + } + + /** + * Gets nb_purchase_account + * + * @return string|null + */ + public function getNbPurchaseAccount() + { + return $this->container['nb_purchase_account']; + } + + /** + * Sets nb_purchase_account + * + * @param string|null $nb_purchase_account Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. + * + * @return self + */ + public function setNbPurchaseAccount($nb_purchase_account) + { + if (is_null($nb_purchase_account)) { + throw new \InvalidArgumentException('non-nullable nb_purchase_account cannot be null'); + } + $this->container['nb_purchase_account'] = $nb_purchase_account; + + return $this; + } + + /** + * Gets payment_acc_age + * + * @return string|null + */ + public function getPaymentAccAge() + { + return $this->container['payment_acc_age']; + } + + /** + * Sets payment_acc_age + * + * @param string|null $payment_acc_age String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** + * + * @return self + */ + public function setPaymentAccAge($payment_acc_age) + { + if (is_null($payment_acc_age)) { + throw new \InvalidArgumentException('non-nullable payment_acc_age cannot be null'); + } + $this->container['payment_acc_age'] = $payment_acc_age; + + return $this; + } + + /** + * Gets payment_acc_ind + * + * @return string|null + */ + public function getPaymentAccInd() + { + return $this->container['payment_acc_ind']; + } + + /** + * Sets payment_acc_ind + * + * @param string|null $payment_acc_ind Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + * + * @return self + */ + public function setPaymentAccInd($payment_acc_ind) + { + if (is_null($payment_acc_ind)) { + throw new \InvalidArgumentException('non-nullable payment_acc_ind cannot be null'); + } + $allowedValues = $this->getPaymentAccIndAllowableValues(); + if (!in_array($payment_acc_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'payment_acc_ind', must be one of '%s'", + $payment_acc_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['payment_acc_ind'] = $payment_acc_ind; + + return $this; + } + + /** + * Gets provision_attempts_day + * + * @return string|null + */ + public function getProvisionAttemptsDay() + { + return $this->container['provision_attempts_day']; + } + + /** + * Sets provision_attempts_day + * + * @param string|null $provision_attempts_day Number of Add Card attempts in the last 24 hours. Max length: 3 characters. + * + * @return self + */ + public function setProvisionAttemptsDay($provision_attempts_day) + { + if (is_null($provision_attempts_day)) { + throw new \InvalidArgumentException('non-nullable provision_attempts_day cannot be null'); + } + $this->container['provision_attempts_day'] = $provision_attempts_day; + + return $this; + } + + /** + * Gets ship_address_usage + * + * @return string|null + */ + public function getShipAddressUsage() + { + return $this->container['ship_address_usage']; + } + + /** + * Sets ship_address_usage + * + * @param string|null $ship_address_usage String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** + * + * @return self + */ + public function setShipAddressUsage($ship_address_usage) + { + if (is_null($ship_address_usage)) { + throw new \InvalidArgumentException('non-nullable ship_address_usage cannot be null'); + } + $this->container['ship_address_usage'] = $ship_address_usage; + + return $this; + } + + /** + * Gets ship_address_usage_ind + * + * @return string|null + */ + public function getShipAddressUsageInd() + { + return $this->container['ship_address_usage_ind']; + } + + /** + * Sets ship_address_usage_ind + * + * @param string|null $ship_address_usage_ind Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + * + * @return self + */ + public function setShipAddressUsageInd($ship_address_usage_ind) + { + if (is_null($ship_address_usage_ind)) { + throw new \InvalidArgumentException('non-nullable ship_address_usage_ind cannot be null'); + } + $allowedValues = $this->getShipAddressUsageIndAllowableValues(); + if (!in_array($ship_address_usage_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ship_address_usage_ind', must be one of '%s'", + $ship_address_usage_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ship_address_usage_ind'] = $ship_address_usage_ind; + + return $this; + } + + /** + * Gets ship_name_indicator + * + * @return string|null + */ + public function getShipNameIndicator() + { + return $this->container['ship_name_indicator']; + } + + /** + * Sets ship_name_indicator + * + * @param string|null $ship_name_indicator Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name + * + * @return self + */ + public function setShipNameIndicator($ship_name_indicator) + { + if (is_null($ship_name_indicator)) { + throw new \InvalidArgumentException('non-nullable ship_name_indicator cannot be null'); + } + $allowedValues = $this->getShipNameIndicatorAllowableValues(); + if (!in_array($ship_name_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ship_name_indicator', must be one of '%s'", + $ship_name_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ship_name_indicator'] = $ship_name_indicator; + + return $this; + } + + /** + * Gets suspicious_acc_activity + * + * @return string|null + */ + public function getSuspiciousAccActivity() + { + return $this->container['suspicious_acc_activity']; + } + + /** + * Sets suspicious_acc_activity + * + * @param string|null $suspicious_acc_activity Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed + * + * @return self + */ + public function setSuspiciousAccActivity($suspicious_acc_activity) + { + if (is_null($suspicious_acc_activity)) { + throw new \InvalidArgumentException('non-nullable suspicious_acc_activity cannot be null'); + } + $allowedValues = $this->getSuspiciousAccActivityAllowableValues(); + if (!in_array($suspicious_acc_activity, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'suspicious_acc_activity', must be one of '%s'", + $suspicious_acc_activity, + implode("', '", $allowedValues) + ) + ); + } + $this->container['suspicious_acc_activity'] = $suspicious_acc_activity; + + return $this; + } + + /** + * Gets txn_activity_day + * + * @return string|null + */ + public function getTxnActivityDay() + { + return $this->container['txn_activity_day']; + } + + /** + * Sets txn_activity_day + * + * @param string|null $txn_activity_day Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. + * + * @return self + */ + public function setTxnActivityDay($txn_activity_day) + { + if (is_null($txn_activity_day)) { + throw new \InvalidArgumentException('non-nullable txn_activity_day cannot be null'); + } + $this->container['txn_activity_day'] = $txn_activity_day; + + return $this; + } + + /** + * Gets txn_activity_year + * + * @return string|null + */ + public function getTxnActivityYear() + { + return $this->container['txn_activity_year']; + } + + /** + * Sets txn_activity_year + * + * @param string|null $txn_activity_year Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. + * + * @return self + */ + public function setTxnActivityYear($txn_activity_year) + { + if (is_null($txn_activity_year)) { + throw new \InvalidArgumentException('non-nullable txn_activity_year cannot be null'); + } + $this->container['txn_activity_year'] = $txn_activity_year; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalData3DSecure.php b/src/Adyen/Model/Payments/AdditionalData3DSecure.php new file mode 100644 index 000000000..9e26d394b --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalData3DSecure.php @@ -0,0 +1,594 @@ + + */ +class AdditionalData3DSecure implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalData3DSecure'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allow3_ds2' => 'string', + 'challenge_window_size' => 'string', + 'execute_three_d' => 'string', + 'mpi_implementation_type' => 'string', + 'sca_exemption' => 'string', + 'three_ds_version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allow3_ds2' => null, + 'challenge_window_size' => null, + 'execute_three_d' => null, + 'mpi_implementation_type' => null, + 'sca_exemption' => null, + 'three_ds_version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allow3_ds2' => false, + 'challenge_window_size' => false, + 'execute_three_d' => false, + 'mpi_implementation_type' => false, + 'sca_exemption' => false, + 'three_ds_version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allow3_ds2' => 'allow3DS2', + 'challenge_window_size' => 'challengeWindowSize', + 'execute_three_d' => 'executeThreeD', + 'mpi_implementation_type' => 'mpiImplementationType', + 'sca_exemption' => 'scaExemption', + 'three_ds_version' => 'threeDSVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allow3_ds2' => 'setAllow3Ds2', + 'challenge_window_size' => 'setChallengeWindowSize', + 'execute_three_d' => 'setExecuteThreeD', + 'mpi_implementation_type' => 'setMpiImplementationType', + 'sca_exemption' => 'setScaExemption', + 'three_ds_version' => 'setThreeDsVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allow3_ds2' => 'getAllow3Ds2', + 'challenge_window_size' => 'getChallengeWindowSize', + 'execute_three_d' => 'getExecuteThreeD', + 'mpi_implementation_type' => 'getMpiImplementationType', + 'sca_exemption' => 'getScaExemption', + 'three_ds_version' => 'getThreeDsVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHALLENGE_WINDOW_SIZE__01 = '01'; + public const CHALLENGE_WINDOW_SIZE__02 = '02'; + public const CHALLENGE_WINDOW_SIZE__03 = '03'; + public const CHALLENGE_WINDOW_SIZE__04 = '04'; + public const CHALLENGE_WINDOW_SIZE__05 = '05'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeWindowSizeAllowableValues() + { + return [ + self::CHALLENGE_WINDOW_SIZE__01, + self::CHALLENGE_WINDOW_SIZE__02, + self::CHALLENGE_WINDOW_SIZE__03, + self::CHALLENGE_WINDOW_SIZE__04, + self::CHALLENGE_WINDOW_SIZE__05, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allow3_ds2', $data ?? [], null); + $this->setIfExists('challenge_window_size', $data ?? [], null); + $this->setIfExists('execute_three_d', $data ?? [], null); + $this->setIfExists('mpi_implementation_type', $data ?? [], null); + $this->setIfExists('sca_exemption', $data ?? [], null); + $this->setIfExists('three_ds_version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChallengeWindowSizeAllowableValues(); + if (!is_null($this->container['challenge_window_size']) && !in_array($this->container['challenge_window_size'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_window_size', must be one of '%s'", + $this->container['challenge_window_size'], + 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 allow3_ds2 + * + * @return string|null + */ + public function getAllow3Ds2() + { + return $this->container['allow3_ds2']; + } + + /** + * Sets allow3_ds2 + * + * @param string|null $allow3_ds2 Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. + * + * @return self + */ + public function setAllow3Ds2($allow3_ds2) + { + if (is_null($allow3_ds2)) { + throw new \InvalidArgumentException('non-nullable allow3_ds2 cannot be null'); + } + $this->container['allow3_ds2'] = $allow3_ds2; + + return $this; + } + + /** + * Gets challenge_window_size + * + * @return string|null + */ + public function getChallengeWindowSize() + { + return $this->container['challenge_window_size']; + } + + /** + * Sets challenge_window_size + * + * @param string|null $challenge_window_size Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen + * + * @return self + */ + public function setChallengeWindowSize($challenge_window_size) + { + if (is_null($challenge_window_size)) { + throw new \InvalidArgumentException('non-nullable challenge_window_size cannot be null'); + } + $allowedValues = $this->getChallengeWindowSizeAllowableValues(); + if (!in_array($challenge_window_size, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_window_size', must be one of '%s'", + $challenge_window_size, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_window_size'] = $challenge_window_size; + + return $this; + } + + /** + * Gets execute_three_d + * + * @return string|null + */ + public function getExecuteThreeD() + { + return $this->container['execute_three_d']; + } + + /** + * Sets execute_three_d + * + * @param string|null $execute_three_d Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + * + * @return self + */ + public function setExecuteThreeD($execute_three_d) + { + if (is_null($execute_three_d)) { + throw new \InvalidArgumentException('non-nullable execute_three_d cannot be null'); + } + $this->container['execute_three_d'] = $execute_three_d; + + return $this; + } + + /** + * Gets mpi_implementation_type + * + * @return string|null + */ + public function getMpiImplementationType() + { + return $this->container['mpi_implementation_type']; + } + + /** + * Sets mpi_implementation_type + * + * @param string|null $mpi_implementation_type In case of Secure+, this field must be set to **CUPSecurePlus**. + * + * @return self + */ + public function setMpiImplementationType($mpi_implementation_type) + { + if (is_null($mpi_implementation_type)) { + throw new \InvalidArgumentException('non-nullable mpi_implementation_type cannot be null'); + } + $this->container['mpi_implementation_type'] = $mpi_implementation_type; + + return $this; + } + + /** + * Gets sca_exemption + * + * @return string|null + */ + public function getScaExemption() + { + return $this->container['sca_exemption']; + } + + /** + * Sets sca_exemption + * + * @param string|null $sca_exemption Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + * + * @return self + */ + public function setScaExemption($sca_exemption) + { + if (is_null($sca_exemption)) { + throw new \InvalidArgumentException('non-nullable sca_exemption cannot be null'); + } + $this->container['sca_exemption'] = $sca_exemption; + + return $this; + } + + /** + * Gets three_ds_version + * + * @return string|null + */ + public function getThreeDsVersion() + { + return $this->container['three_ds_version']; + } + + /** + * Sets three_ds_version + * + * @param string|null $three_ds_version Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. + * + * @return self + */ + public function setThreeDsVersion($three_ds_version) + { + if (is_null($three_ds_version)) { + throw new \InvalidArgumentException('non-nullable three_ds_version cannot be null'); + } + $this->container['three_ds_version'] = $three_ds_version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataAirline.php b/src/Adyen/Model/Payments/AdditionalDataAirline.php new file mode 100644 index 000000000..8d926aeaa --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataAirline.php @@ -0,0 +1,1306 @@ + + */ +class AdditionalDataAirline implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataAirline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'airline_agency_invoice_number' => 'string', + 'airline_agency_plan_name' => 'string', + 'airline_airline_code' => 'string', + 'airline_airline_designator_code' => 'string', + 'airline_boarding_fee' => 'string', + 'airline_computerized_reservation_system' => 'string', + 'airline_customer_reference_number' => 'string', + 'airline_document_type' => 'string', + 'airline_flight_date' => 'string', + 'airline_leg_carrier_code' => 'string', + 'airline_leg_class_of_travel' => 'string', + 'airline_leg_date_of_travel' => 'string', + 'airline_leg_depart_airport' => 'string', + 'airline_leg_depart_tax' => 'string', + 'airline_leg_destination_code' => 'string', + 'airline_leg_fare_base_code' => 'string', + 'airline_leg_flight_number' => 'string', + 'airline_leg_stop_over_code' => 'string', + 'airline_passenger_date_of_birth' => 'string', + 'airline_passenger_first_name' => 'string', + 'airline_passenger_last_name' => 'string', + 'airline_passenger_telephone_number' => 'string', + 'airline_passenger_traveller_type' => 'string', + 'airline_passenger_name' => 'string', + 'airline_ticket_issue_address' => 'string', + 'airline_ticket_number' => 'string', + 'airline_travel_agency_code' => 'string', + 'airline_travel_agency_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'airline_agency_invoice_number' => null, + 'airline_agency_plan_name' => null, + 'airline_airline_code' => null, + 'airline_airline_designator_code' => null, + 'airline_boarding_fee' => null, + 'airline_computerized_reservation_system' => null, + 'airline_customer_reference_number' => null, + 'airline_document_type' => null, + 'airline_flight_date' => null, + 'airline_leg_carrier_code' => null, + 'airline_leg_class_of_travel' => null, + 'airline_leg_date_of_travel' => null, + 'airline_leg_depart_airport' => null, + 'airline_leg_depart_tax' => null, + 'airline_leg_destination_code' => null, + 'airline_leg_fare_base_code' => null, + 'airline_leg_flight_number' => null, + 'airline_leg_stop_over_code' => null, + 'airline_passenger_date_of_birth' => null, + 'airline_passenger_first_name' => null, + 'airline_passenger_last_name' => null, + 'airline_passenger_telephone_number' => null, + 'airline_passenger_traveller_type' => null, + 'airline_passenger_name' => null, + 'airline_ticket_issue_address' => null, + 'airline_ticket_number' => null, + 'airline_travel_agency_code' => null, + 'airline_travel_agency_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'airline_agency_invoice_number' => false, + 'airline_agency_plan_name' => false, + 'airline_airline_code' => false, + 'airline_airline_designator_code' => false, + 'airline_boarding_fee' => false, + 'airline_computerized_reservation_system' => false, + 'airline_customer_reference_number' => false, + 'airline_document_type' => false, + 'airline_flight_date' => false, + 'airline_leg_carrier_code' => false, + 'airline_leg_class_of_travel' => false, + 'airline_leg_date_of_travel' => false, + 'airline_leg_depart_airport' => false, + 'airline_leg_depart_tax' => false, + 'airline_leg_destination_code' => false, + 'airline_leg_fare_base_code' => false, + 'airline_leg_flight_number' => false, + 'airline_leg_stop_over_code' => false, + 'airline_passenger_date_of_birth' => false, + 'airline_passenger_first_name' => false, + 'airline_passenger_last_name' => false, + 'airline_passenger_telephone_number' => false, + 'airline_passenger_traveller_type' => false, + 'airline_passenger_name' => false, + 'airline_ticket_issue_address' => false, + 'airline_ticket_number' => false, + 'airline_travel_agency_code' => false, + 'airline_travel_agency_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'airline_agency_invoice_number' => 'airline.agency_invoice_number', + 'airline_agency_plan_name' => 'airline.agency_plan_name', + 'airline_airline_code' => 'airline.airline_code', + 'airline_airline_designator_code' => 'airline.airline_designator_code', + 'airline_boarding_fee' => 'airline.boarding_fee', + 'airline_computerized_reservation_system' => 'airline.computerized_reservation_system', + 'airline_customer_reference_number' => 'airline.customer_reference_number', + 'airline_document_type' => 'airline.document_type', + 'airline_flight_date' => 'airline.flight_date', + 'airline_leg_carrier_code' => 'airline.leg.carrier_code', + 'airline_leg_class_of_travel' => 'airline.leg.class_of_travel', + 'airline_leg_date_of_travel' => 'airline.leg.date_of_travel', + 'airline_leg_depart_airport' => 'airline.leg.depart_airport', + 'airline_leg_depart_tax' => 'airline.leg.depart_tax', + 'airline_leg_destination_code' => 'airline.leg.destination_code', + 'airline_leg_fare_base_code' => 'airline.leg.fare_base_code', + 'airline_leg_flight_number' => 'airline.leg.flight_number', + 'airline_leg_stop_over_code' => 'airline.leg.stop_over_code', + 'airline_passenger_date_of_birth' => 'airline.passenger.date_of_birth', + 'airline_passenger_first_name' => 'airline.passenger.first_name', + 'airline_passenger_last_name' => 'airline.passenger.last_name', + 'airline_passenger_telephone_number' => 'airline.passenger.telephone_number', + 'airline_passenger_traveller_type' => 'airline.passenger.traveller_type', + 'airline_passenger_name' => 'airline.passenger_name', + 'airline_ticket_issue_address' => 'airline.ticket_issue_address', + 'airline_ticket_number' => 'airline.ticket_number', + 'airline_travel_agency_code' => 'airline.travel_agency_code', + 'airline_travel_agency_name' => 'airline.travel_agency_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'airline_agency_invoice_number' => 'setAirlineAgencyInvoiceNumber', + 'airline_agency_plan_name' => 'setAirlineAgencyPlanName', + 'airline_airline_code' => 'setAirlineAirlineCode', + 'airline_airline_designator_code' => 'setAirlineAirlineDesignatorCode', + 'airline_boarding_fee' => 'setAirlineBoardingFee', + 'airline_computerized_reservation_system' => 'setAirlineComputerizedReservationSystem', + 'airline_customer_reference_number' => 'setAirlineCustomerReferenceNumber', + 'airline_document_type' => 'setAirlineDocumentType', + 'airline_flight_date' => 'setAirlineFlightDate', + 'airline_leg_carrier_code' => 'setAirlineLegCarrierCode', + 'airline_leg_class_of_travel' => 'setAirlineLegClassOfTravel', + 'airline_leg_date_of_travel' => 'setAirlineLegDateOfTravel', + 'airline_leg_depart_airport' => 'setAirlineLegDepartAirport', + 'airline_leg_depart_tax' => 'setAirlineLegDepartTax', + 'airline_leg_destination_code' => 'setAirlineLegDestinationCode', + 'airline_leg_fare_base_code' => 'setAirlineLegFareBaseCode', + 'airline_leg_flight_number' => 'setAirlineLegFlightNumber', + 'airline_leg_stop_over_code' => 'setAirlineLegStopOverCode', + 'airline_passenger_date_of_birth' => 'setAirlinePassengerDateOfBirth', + 'airline_passenger_first_name' => 'setAirlinePassengerFirstName', + 'airline_passenger_last_name' => 'setAirlinePassengerLastName', + 'airline_passenger_telephone_number' => 'setAirlinePassengerTelephoneNumber', + 'airline_passenger_traveller_type' => 'setAirlinePassengerTravellerType', + 'airline_passenger_name' => 'setAirlinePassengerName', + 'airline_ticket_issue_address' => 'setAirlineTicketIssueAddress', + 'airline_ticket_number' => 'setAirlineTicketNumber', + 'airline_travel_agency_code' => 'setAirlineTravelAgencyCode', + 'airline_travel_agency_name' => 'setAirlineTravelAgencyName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'airline_agency_invoice_number' => 'getAirlineAgencyInvoiceNumber', + 'airline_agency_plan_name' => 'getAirlineAgencyPlanName', + 'airline_airline_code' => 'getAirlineAirlineCode', + 'airline_airline_designator_code' => 'getAirlineAirlineDesignatorCode', + 'airline_boarding_fee' => 'getAirlineBoardingFee', + 'airline_computerized_reservation_system' => 'getAirlineComputerizedReservationSystem', + 'airline_customer_reference_number' => 'getAirlineCustomerReferenceNumber', + 'airline_document_type' => 'getAirlineDocumentType', + 'airline_flight_date' => 'getAirlineFlightDate', + 'airline_leg_carrier_code' => 'getAirlineLegCarrierCode', + 'airline_leg_class_of_travel' => 'getAirlineLegClassOfTravel', + 'airline_leg_date_of_travel' => 'getAirlineLegDateOfTravel', + 'airline_leg_depart_airport' => 'getAirlineLegDepartAirport', + 'airline_leg_depart_tax' => 'getAirlineLegDepartTax', + 'airline_leg_destination_code' => 'getAirlineLegDestinationCode', + 'airline_leg_fare_base_code' => 'getAirlineLegFareBaseCode', + 'airline_leg_flight_number' => 'getAirlineLegFlightNumber', + 'airline_leg_stop_over_code' => 'getAirlineLegStopOverCode', + 'airline_passenger_date_of_birth' => 'getAirlinePassengerDateOfBirth', + 'airline_passenger_first_name' => 'getAirlinePassengerFirstName', + 'airline_passenger_last_name' => 'getAirlinePassengerLastName', + 'airline_passenger_telephone_number' => 'getAirlinePassengerTelephoneNumber', + 'airline_passenger_traveller_type' => 'getAirlinePassengerTravellerType', + 'airline_passenger_name' => 'getAirlinePassengerName', + 'airline_ticket_issue_address' => 'getAirlineTicketIssueAddress', + 'airline_ticket_number' => 'getAirlineTicketNumber', + 'airline_travel_agency_code' => 'getAirlineTravelAgencyCode', + 'airline_travel_agency_name' => 'getAirlineTravelAgencyName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('airline_agency_invoice_number', $data ?? [], null); + $this->setIfExists('airline_agency_plan_name', $data ?? [], null); + $this->setIfExists('airline_airline_code', $data ?? [], null); + $this->setIfExists('airline_airline_designator_code', $data ?? [], null); + $this->setIfExists('airline_boarding_fee', $data ?? [], null); + $this->setIfExists('airline_computerized_reservation_system', $data ?? [], null); + $this->setIfExists('airline_customer_reference_number', $data ?? [], null); + $this->setIfExists('airline_document_type', $data ?? [], null); + $this->setIfExists('airline_flight_date', $data ?? [], null); + $this->setIfExists('airline_leg_carrier_code', $data ?? [], null); + $this->setIfExists('airline_leg_class_of_travel', $data ?? [], null); + $this->setIfExists('airline_leg_date_of_travel', $data ?? [], null); + $this->setIfExists('airline_leg_depart_airport', $data ?? [], null); + $this->setIfExists('airline_leg_depart_tax', $data ?? [], null); + $this->setIfExists('airline_leg_destination_code', $data ?? [], null); + $this->setIfExists('airline_leg_fare_base_code', $data ?? [], null); + $this->setIfExists('airline_leg_flight_number', $data ?? [], null); + $this->setIfExists('airline_leg_stop_over_code', $data ?? [], null); + $this->setIfExists('airline_passenger_date_of_birth', $data ?? [], null); + $this->setIfExists('airline_passenger_first_name', $data ?? [], null); + $this->setIfExists('airline_passenger_last_name', $data ?? [], null); + $this->setIfExists('airline_passenger_telephone_number', $data ?? [], null); + $this->setIfExists('airline_passenger_traveller_type', $data ?? [], null); + $this->setIfExists('airline_passenger_name', $data ?? [], null); + $this->setIfExists('airline_ticket_issue_address', $data ?? [], null); + $this->setIfExists('airline_ticket_number', $data ?? [], null); + $this->setIfExists('airline_travel_agency_code', $data ?? [], null); + $this->setIfExists('airline_travel_agency_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['airline_passenger_name'] === null) { + $invalidProperties[] = "'airline_passenger_name' 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 airline_agency_invoice_number + * + * @return string|null + */ + public function getAirlineAgencyInvoiceNumber() + { + return $this->container['airline_agency_invoice_number']; + } + + /** + * Sets airline_agency_invoice_number + * + * @param string|null $airline_agency_invoice_number Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 + * + * @return self + */ + public function setAirlineAgencyInvoiceNumber($airline_agency_invoice_number) + { + if (is_null($airline_agency_invoice_number)) { + throw new \InvalidArgumentException('non-nullable airline_agency_invoice_number cannot be null'); + } + $this->container['airline_agency_invoice_number'] = $airline_agency_invoice_number; + + return $this; + } + + /** + * Gets airline_agency_plan_name + * + * @return string|null + */ + public function getAirlineAgencyPlanName() + { + return $this->container['airline_agency_plan_name']; + } + + /** + * Sets airline_agency_plan_name + * + * @param string|null $airline_agency_plan_name 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineAgencyPlanName($airline_agency_plan_name) + { + if (is_null($airline_agency_plan_name)) { + throw new \InvalidArgumentException('non-nullable airline_agency_plan_name cannot be null'); + } + $this->container['airline_agency_plan_name'] = $airline_agency_plan_name; + + return $this; + } + + /** + * Gets airline_airline_code + * + * @return string|null + */ + public function getAirlineAirlineCode() + { + return $this->container['airline_airline_code']; + } + + /** + * Sets airline_airline_code + * + * @param string|null $airline_airline_code [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 + * + * @return self + */ + public function setAirlineAirlineCode($airline_airline_code) + { + if (is_null($airline_airline_code)) { + throw new \InvalidArgumentException('non-nullable airline_airline_code cannot be null'); + } + $this->container['airline_airline_code'] = $airline_airline_code; + + return $this; + } + + /** + * Gets airline_airline_designator_code + * + * @return string|null + */ + public function getAirlineAirlineDesignatorCode() + { + return $this->container['airline_airline_designator_code']; + } + + /** + * Sets airline_airline_designator_code + * + * @param string|null $airline_airline_designator_code [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineAirlineDesignatorCode($airline_airline_designator_code) + { + if (is_null($airline_airline_designator_code)) { + throw new \InvalidArgumentException('non-nullable airline_airline_designator_code cannot be null'); + } + $this->container['airline_airline_designator_code'] = $airline_airline_designator_code; + + return $this; + } + + /** + * Gets airline_boarding_fee + * + * @return string|null + */ + public function getAirlineBoardingFee() + { + return $this->container['airline_boarding_fee']; + } + + /** + * Sets airline_boarding_fee + * + * @param string|null $airline_boarding_fee Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 + * + * @return self + */ + public function setAirlineBoardingFee($airline_boarding_fee) + { + if (is_null($airline_boarding_fee)) { + throw new \InvalidArgumentException('non-nullable airline_boarding_fee cannot be null'); + } + $this->container['airline_boarding_fee'] = $airline_boarding_fee; + + return $this; + } + + /** + * Gets airline_computerized_reservation_system + * + * @return string|null + */ + public function getAirlineComputerizedReservationSystem() + { + return $this->container['airline_computerized_reservation_system']; + } + + /** + * Sets airline_computerized_reservation_system + * + * @param string|null $airline_computerized_reservation_system The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 + * + * @return self + */ + public function setAirlineComputerizedReservationSystem($airline_computerized_reservation_system) + { + if (is_null($airline_computerized_reservation_system)) { + throw new \InvalidArgumentException('non-nullable airline_computerized_reservation_system cannot be null'); + } + $this->container['airline_computerized_reservation_system'] = $airline_computerized_reservation_system; + + return $this; + } + + /** + * Gets airline_customer_reference_number + * + * @return string|null + */ + public function getAirlineCustomerReferenceNumber() + { + return $this->container['airline_customer_reference_number']; + } + + /** + * Sets airline_customer_reference_number + * + * @param string|null $airline_customer_reference_number Reference number; alphanumeric. * minLength: 0 * maxLength: 20 + * + * @return self + */ + public function setAirlineCustomerReferenceNumber($airline_customer_reference_number) + { + if (is_null($airline_customer_reference_number)) { + throw new \InvalidArgumentException('non-nullable airline_customer_reference_number cannot be null'); + } + $this->container['airline_customer_reference_number'] = $airline_customer_reference_number; + + return $this; + } + + /** + * Gets airline_document_type + * + * @return string|null + */ + public function getAirlineDocumentType() + { + return $this->container['airline_document_type']; + } + + /** + * Sets airline_document_type + * + * @param string|null $airline_document_type Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineDocumentType($airline_document_type) + { + if (is_null($airline_document_type)) { + throw new \InvalidArgumentException('non-nullable airline_document_type cannot be null'); + } + $this->container['airline_document_type'] = $airline_document_type; + + return $this; + } + + /** + * Gets airline_flight_date + * + * @return string|null + */ + public function getAirlineFlightDate() + { + return $this->container['airline_flight_date']; + } + + /** + * Sets airline_flight_date + * + * @param string|null $airline_flight_date Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 + * + * @return self + */ + public function setAirlineFlightDate($airline_flight_date) + { + if (is_null($airline_flight_date)) { + throw new \InvalidArgumentException('non-nullable airline_flight_date cannot be null'); + } + $this->container['airline_flight_date'] = $airline_flight_date; + + return $this; + } + + /** + * Gets airline_leg_carrier_code + * + * @return string|null + */ + public function getAirlineLegCarrierCode() + { + return $this->container['airline_leg_carrier_code']; + } + + /** + * Sets airline_leg_carrier_code + * + * @param string|null $airline_leg_carrier_code [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * + * @return self + */ + public function setAirlineLegCarrierCode($airline_leg_carrier_code) + { + if (is_null($airline_leg_carrier_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_carrier_code cannot be null'); + } + $this->container['airline_leg_carrier_code'] = $airline_leg_carrier_code; + + return $this; + } + + /** + * Gets airline_leg_class_of_travel + * + * @return string|null + */ + public function getAirlineLegClassOfTravel() + { + return $this->container['airline_leg_class_of_travel']; + } + + /** + * Sets airline_leg_class_of_travel + * + * @param string|null $airline_leg_class_of_travel 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 + * + * @return self + */ + public function setAirlineLegClassOfTravel($airline_leg_class_of_travel) + { + if (is_null($airline_leg_class_of_travel)) { + throw new \InvalidArgumentException('non-nullable airline_leg_class_of_travel cannot be null'); + } + $this->container['airline_leg_class_of_travel'] = $airline_leg_class_of_travel; + + return $this; + } + + /** + * Gets airline_leg_date_of_travel + * + * @return string|null + */ + public function getAirlineLegDateOfTravel() + { + return $this->container['airline_leg_date_of_travel']; + } + + /** + * Sets airline_leg_date_of_travel + * + * @param string|null $airline_leg_date_of_travel Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 + * + * @return self + */ + public function setAirlineLegDateOfTravel($airline_leg_date_of_travel) + { + if (is_null($airline_leg_date_of_travel)) { + throw new \InvalidArgumentException('non-nullable airline_leg_date_of_travel cannot be null'); + } + $this->container['airline_leg_date_of_travel'] = $airline_leg_date_of_travel; + + return $this; + } + + /** + * Gets airline_leg_depart_airport + * + * @return string|null + */ + public function getAirlineLegDepartAirport() + { + return $this->container['airline_leg_depart_airport']; + } + + /** + * Sets airline_leg_depart_airport + * + * @param string|null $airline_leg_depart_airport Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * + * @return self + */ + public function setAirlineLegDepartAirport($airline_leg_depart_airport) + { + if (is_null($airline_leg_depart_airport)) { + throw new \InvalidArgumentException('non-nullable airline_leg_depart_airport cannot be null'); + } + $this->container['airline_leg_depart_airport'] = $airline_leg_depart_airport; + + return $this; + } + + /** + * Gets airline_leg_depart_tax + * + * @return string|null + */ + public function getAirlineLegDepartTax() + { + return $this->container['airline_leg_depart_tax']; + } + + /** + * Sets airline_leg_depart_tax + * + * @param string|null $airline_leg_depart_tax [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 + * + * @return self + */ + public function setAirlineLegDepartTax($airline_leg_depart_tax) + { + if (is_null($airline_leg_depart_tax)) { + throw new \InvalidArgumentException('non-nullable airline_leg_depart_tax cannot be null'); + } + $this->container['airline_leg_depart_tax'] = $airline_leg_depart_tax; + + return $this; + } + + /** + * Gets airline_leg_destination_code + * + * @return string|null + */ + public function getAirlineLegDestinationCode() + { + return $this->container['airline_leg_destination_code']; + } + + /** + * Sets airline_leg_destination_code + * + * @param string|null $airline_leg_destination_code Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * + * @return self + */ + public function setAirlineLegDestinationCode($airline_leg_destination_code) + { + if (is_null($airline_leg_destination_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_destination_code cannot be null'); + } + $this->container['airline_leg_destination_code'] = $airline_leg_destination_code; + + return $this; + } + + /** + * Gets airline_leg_fare_base_code + * + * @return string|null + */ + public function getAirlineLegFareBaseCode() + { + return $this->container['airline_leg_fare_base_code']; + } + + /** + * Sets airline_leg_fare_base_code + * + * @param string|null $airline_leg_fare_base_code [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 + * + * @return self + */ + public function setAirlineLegFareBaseCode($airline_leg_fare_base_code) + { + if (is_null($airline_leg_fare_base_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_fare_base_code cannot be null'); + } + $this->container['airline_leg_fare_base_code'] = $airline_leg_fare_base_code; + + return $this; + } + + /** + * Gets airline_leg_flight_number + * + * @return string|null + */ + public function getAirlineLegFlightNumber() + { + return $this->container['airline_leg_flight_number']; + } + + /** + * Sets airline_leg_flight_number + * + * @param string|null $airline_leg_flight_number The flight identifier. * minLength: 1 * maxLength: 5 + * + * @return self + */ + public function setAirlineLegFlightNumber($airline_leg_flight_number) + { + if (is_null($airline_leg_flight_number)) { + throw new \InvalidArgumentException('non-nullable airline_leg_flight_number cannot be null'); + } + $this->container['airline_leg_flight_number'] = $airline_leg_flight_number; + + return $this; + } + + /** + * Gets airline_leg_stop_over_code + * + * @return string|null + */ + public function getAirlineLegStopOverCode() + { + return $this->container['airline_leg_stop_over_code']; + } + + /** + * Sets airline_leg_stop_over_code + * + * @param string|null $airline_leg_stop_over_code 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 + * + * @return self + */ + public function setAirlineLegStopOverCode($airline_leg_stop_over_code) + { + if (is_null($airline_leg_stop_over_code)) { + throw new \InvalidArgumentException('non-nullable airline_leg_stop_over_code cannot be null'); + } + $this->container['airline_leg_stop_over_code'] = $airline_leg_stop_over_code; + + return $this; + } + + /** + * Gets airline_passenger_date_of_birth + * + * @return string|null + */ + public function getAirlinePassengerDateOfBirth() + { + return $this->container['airline_passenger_date_of_birth']; + } + + /** + * Sets airline_passenger_date_of_birth + * + * @param string|null $airline_passenger_date_of_birth Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + * + * @return self + */ + public function setAirlinePassengerDateOfBirth($airline_passenger_date_of_birth) + { + if (is_null($airline_passenger_date_of_birth)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_date_of_birth cannot be null'); + } + $this->container['airline_passenger_date_of_birth'] = $airline_passenger_date_of_birth; + + return $this; + } + + /** + * Gets airline_passenger_first_name + * + * @return string|null + */ + public function getAirlinePassengerFirstName() + { + return $this->container['airline_passenger_first_name']; + } + + /** + * Sets airline_passenger_first_name + * + * @param string|null $airline_passenger_first_name Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * + * @return self + */ + public function setAirlinePassengerFirstName($airline_passenger_first_name) + { + if (is_null($airline_passenger_first_name)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_first_name cannot be null'); + } + $this->container['airline_passenger_first_name'] = $airline_passenger_first_name; + + return $this; + } + + /** + * Gets airline_passenger_last_name + * + * @return string|null + */ + public function getAirlinePassengerLastName() + { + return $this->container['airline_passenger_last_name']; + } + + /** + * Sets airline_passenger_last_name + * + * @param string|null $airline_passenger_last_name Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * + * @return self + */ + public function setAirlinePassengerLastName($airline_passenger_last_name) + { + if (is_null($airline_passenger_last_name)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_last_name cannot be null'); + } + $this->container['airline_passenger_last_name'] = $airline_passenger_last_name; + + return $this; + } + + /** + * Gets airline_passenger_telephone_number + * + * @return string|null + */ + public function getAirlinePassengerTelephoneNumber() + { + return $this->container['airline_passenger_telephone_number']; + } + + /** + * Sets airline_passenger_telephone_number + * + * @param string|null $airline_passenger_telephone_number Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30 + * + * @return self + */ + public function setAirlinePassengerTelephoneNumber($airline_passenger_telephone_number) + { + if (is_null($airline_passenger_telephone_number)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_telephone_number cannot be null'); + } + $this->container['airline_passenger_telephone_number'] = $airline_passenger_telephone_number; + + return $this; + } + + /** + * Gets airline_passenger_traveller_type + * + * @return string|null + */ + public function getAirlinePassengerTravellerType() + { + return $this->container['airline_passenger_traveller_type']; + } + + /** + * Sets airline_passenger_traveller_type + * + * @param string|null $airline_passenger_traveller_type Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 + * + * @return self + */ + public function setAirlinePassengerTravellerType($airline_passenger_traveller_type) + { + if (is_null($airline_passenger_traveller_type)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_traveller_type cannot be null'); + } + $this->container['airline_passenger_traveller_type'] = $airline_passenger_traveller_type; + + return $this; + } + + /** + * Gets airline_passenger_name + * + * @return string + */ + public function getAirlinePassengerName() + { + return $this->container['airline_passenger_name']; + } + + /** + * Sets airline_passenger_name + * + * @param string $airline_passenger_name Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 + * + * @return self + */ + public function setAirlinePassengerName($airline_passenger_name) + { + if (is_null($airline_passenger_name)) { + throw new \InvalidArgumentException('non-nullable airline_passenger_name cannot be null'); + } + $this->container['airline_passenger_name'] = $airline_passenger_name; + + return $this; + } + + /** + * Gets airline_ticket_issue_address + * + * @return string|null + */ + public function getAirlineTicketIssueAddress() + { + return $this->container['airline_ticket_issue_address']; + } + + /** + * Sets airline_ticket_issue_address + * + * @param string|null $airline_ticket_issue_address Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 + * + * @return self + */ + public function setAirlineTicketIssueAddress($airline_ticket_issue_address) + { + if (is_null($airline_ticket_issue_address)) { + throw new \InvalidArgumentException('non-nullable airline_ticket_issue_address cannot be null'); + } + $this->container['airline_ticket_issue_address'] = $airline_ticket_issue_address; + + return $this; + } + + /** + * Gets airline_ticket_number + * + * @return string|null + */ + public function getAirlineTicketNumber() + { + return $this->container['airline_ticket_number']; + } + + /** + * Sets airline_ticket_number + * + * @param string|null $airline_ticket_number The ticket's unique identifier. * minLength: 1 * maxLength: 150 + * + * @return self + */ + public function setAirlineTicketNumber($airline_ticket_number) + { + if (is_null($airline_ticket_number)) { + throw new \InvalidArgumentException('non-nullable airline_ticket_number cannot be null'); + } + $this->container['airline_ticket_number'] = $airline_ticket_number; + + return $this; + } + + /** + * Gets airline_travel_agency_code + * + * @return string|null + */ + public function getAirlineTravelAgencyCode() + { + return $this->container['airline_travel_agency_code']; + } + + /** + * Sets airline_travel_agency_code + * + * @param string|null $airline_travel_agency_code IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 + * + * @return self + */ + public function setAirlineTravelAgencyCode($airline_travel_agency_code) + { + if (is_null($airline_travel_agency_code)) { + throw new \InvalidArgumentException('non-nullable airline_travel_agency_code cannot be null'); + } + $this->container['airline_travel_agency_code'] = $airline_travel_agency_code; + + return $this; + } + + /** + * Gets airline_travel_agency_name + * + * @return string|null + */ + public function getAirlineTravelAgencyName() + { + return $this->container['airline_travel_agency_name']; + } + + /** + * Sets airline_travel_agency_name + * + * @param string|null $airline_travel_agency_name The name of the travel agency. * minLength: 1 * maxLength: 25 + * + * @return self + */ + public function setAirlineTravelAgencyName($airline_travel_agency_name) + { + if (is_null($airline_travel_agency_name)) { + throw new \InvalidArgumentException('non-nullable airline_travel_agency_name cannot be null'); + } + $this->container['airline_travel_agency_name'] = $airline_travel_agency_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 + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataCarRental.php b/src/Adyen/Model/Payments/AdditionalDataCarRental.php new file mode 100644 index 000000000..172b0c2cf --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataCarRental.php @@ -0,0 +1,1133 @@ + + */ +class AdditionalDataCarRental implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataCarRental'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'car_rental_check_out_date' => 'string', + 'car_rental_customer_service_toll_free_number' => 'string', + 'car_rental_days_rented' => 'string', + 'car_rental_fuel_charges' => 'string', + 'car_rental_insurance_charges' => 'string', + 'car_rental_location_city' => 'string', + 'car_rental_location_country' => 'string', + 'car_rental_location_state_province' => 'string', + 'car_rental_no_show_indicator' => 'string', + 'car_rental_one_way_drop_off_charges' => 'string', + 'car_rental_rate' => 'string', + 'car_rental_rate_indicator' => 'string', + 'car_rental_rental_agreement_number' => 'string', + 'car_rental_rental_class_id' => 'string', + 'car_rental_renter_name' => 'string', + 'car_rental_return_city' => 'string', + 'car_rental_return_country' => 'string', + 'car_rental_return_date' => 'string', + 'car_rental_return_location_id' => 'string', + 'car_rental_return_state_province' => 'string', + 'car_rental_tax_exempt_indicator' => 'string', + 'travel_entertainment_auth_data_duration' => 'string', + 'travel_entertainment_auth_data_market' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'car_rental_check_out_date' => null, + 'car_rental_customer_service_toll_free_number' => null, + 'car_rental_days_rented' => null, + 'car_rental_fuel_charges' => null, + 'car_rental_insurance_charges' => null, + 'car_rental_location_city' => null, + 'car_rental_location_country' => null, + 'car_rental_location_state_province' => null, + 'car_rental_no_show_indicator' => null, + 'car_rental_one_way_drop_off_charges' => null, + 'car_rental_rate' => null, + 'car_rental_rate_indicator' => null, + 'car_rental_rental_agreement_number' => null, + 'car_rental_rental_class_id' => null, + 'car_rental_renter_name' => null, + 'car_rental_return_city' => null, + 'car_rental_return_country' => null, + 'car_rental_return_date' => null, + 'car_rental_return_location_id' => null, + 'car_rental_return_state_province' => null, + 'car_rental_tax_exempt_indicator' => null, + 'travel_entertainment_auth_data_duration' => null, + 'travel_entertainment_auth_data_market' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'car_rental_check_out_date' => false, + 'car_rental_customer_service_toll_free_number' => false, + 'car_rental_days_rented' => false, + 'car_rental_fuel_charges' => false, + 'car_rental_insurance_charges' => false, + 'car_rental_location_city' => false, + 'car_rental_location_country' => false, + 'car_rental_location_state_province' => false, + 'car_rental_no_show_indicator' => false, + 'car_rental_one_way_drop_off_charges' => false, + 'car_rental_rate' => false, + 'car_rental_rate_indicator' => false, + 'car_rental_rental_agreement_number' => false, + 'car_rental_rental_class_id' => false, + 'car_rental_renter_name' => false, + 'car_rental_return_city' => false, + 'car_rental_return_country' => false, + 'car_rental_return_date' => false, + 'car_rental_return_location_id' => false, + 'car_rental_return_state_province' => false, + 'car_rental_tax_exempt_indicator' => false, + 'travel_entertainment_auth_data_duration' => false, + 'travel_entertainment_auth_data_market' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'car_rental_check_out_date' => 'carRental.checkOutDate', + 'car_rental_customer_service_toll_free_number' => 'carRental.customerServiceTollFreeNumber', + 'car_rental_days_rented' => 'carRental.daysRented', + 'car_rental_fuel_charges' => 'carRental.fuelCharges', + 'car_rental_insurance_charges' => 'carRental.insuranceCharges', + 'car_rental_location_city' => 'carRental.locationCity', + 'car_rental_location_country' => 'carRental.locationCountry', + 'car_rental_location_state_province' => 'carRental.locationStateProvince', + 'car_rental_no_show_indicator' => 'carRental.noShowIndicator', + 'car_rental_one_way_drop_off_charges' => 'carRental.oneWayDropOffCharges', + 'car_rental_rate' => 'carRental.rate', + 'car_rental_rate_indicator' => 'carRental.rateIndicator', + 'car_rental_rental_agreement_number' => 'carRental.rentalAgreementNumber', + 'car_rental_rental_class_id' => 'carRental.rentalClassId', + 'car_rental_renter_name' => 'carRental.renterName', + 'car_rental_return_city' => 'carRental.returnCity', + 'car_rental_return_country' => 'carRental.returnCountry', + 'car_rental_return_date' => 'carRental.returnDate', + 'car_rental_return_location_id' => 'carRental.returnLocationId', + 'car_rental_return_state_province' => 'carRental.returnStateProvince', + 'car_rental_tax_exempt_indicator' => 'carRental.taxExemptIndicator', + 'travel_entertainment_auth_data_duration' => 'travelEntertainmentAuthData.duration', + 'travel_entertainment_auth_data_market' => 'travelEntertainmentAuthData.market' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'car_rental_check_out_date' => 'setCarRentalCheckOutDate', + 'car_rental_customer_service_toll_free_number' => 'setCarRentalCustomerServiceTollFreeNumber', + 'car_rental_days_rented' => 'setCarRentalDaysRented', + 'car_rental_fuel_charges' => 'setCarRentalFuelCharges', + 'car_rental_insurance_charges' => 'setCarRentalInsuranceCharges', + 'car_rental_location_city' => 'setCarRentalLocationCity', + 'car_rental_location_country' => 'setCarRentalLocationCountry', + 'car_rental_location_state_province' => 'setCarRentalLocationStateProvince', + 'car_rental_no_show_indicator' => 'setCarRentalNoShowIndicator', + 'car_rental_one_way_drop_off_charges' => 'setCarRentalOneWayDropOffCharges', + 'car_rental_rate' => 'setCarRentalRate', + 'car_rental_rate_indicator' => 'setCarRentalRateIndicator', + 'car_rental_rental_agreement_number' => 'setCarRentalRentalAgreementNumber', + 'car_rental_rental_class_id' => 'setCarRentalRentalClassId', + 'car_rental_renter_name' => 'setCarRentalRenterName', + 'car_rental_return_city' => 'setCarRentalReturnCity', + 'car_rental_return_country' => 'setCarRentalReturnCountry', + 'car_rental_return_date' => 'setCarRentalReturnDate', + 'car_rental_return_location_id' => 'setCarRentalReturnLocationId', + 'car_rental_return_state_province' => 'setCarRentalReturnStateProvince', + 'car_rental_tax_exempt_indicator' => 'setCarRentalTaxExemptIndicator', + 'travel_entertainment_auth_data_duration' => 'setTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'setTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'car_rental_check_out_date' => 'getCarRentalCheckOutDate', + 'car_rental_customer_service_toll_free_number' => 'getCarRentalCustomerServiceTollFreeNumber', + 'car_rental_days_rented' => 'getCarRentalDaysRented', + 'car_rental_fuel_charges' => 'getCarRentalFuelCharges', + 'car_rental_insurance_charges' => 'getCarRentalInsuranceCharges', + 'car_rental_location_city' => 'getCarRentalLocationCity', + 'car_rental_location_country' => 'getCarRentalLocationCountry', + 'car_rental_location_state_province' => 'getCarRentalLocationStateProvince', + 'car_rental_no_show_indicator' => 'getCarRentalNoShowIndicator', + 'car_rental_one_way_drop_off_charges' => 'getCarRentalOneWayDropOffCharges', + 'car_rental_rate' => 'getCarRentalRate', + 'car_rental_rate_indicator' => 'getCarRentalRateIndicator', + 'car_rental_rental_agreement_number' => 'getCarRentalRentalAgreementNumber', + 'car_rental_rental_class_id' => 'getCarRentalRentalClassId', + 'car_rental_renter_name' => 'getCarRentalRenterName', + 'car_rental_return_city' => 'getCarRentalReturnCity', + 'car_rental_return_country' => 'getCarRentalReturnCountry', + 'car_rental_return_date' => 'getCarRentalReturnDate', + 'car_rental_return_location_id' => 'getCarRentalReturnLocationId', + 'car_rental_return_state_province' => 'getCarRentalReturnStateProvince', + 'car_rental_tax_exempt_indicator' => 'getCarRentalTaxExemptIndicator', + 'travel_entertainment_auth_data_duration' => 'getTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'getTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('car_rental_check_out_date', $data ?? [], null); + $this->setIfExists('car_rental_customer_service_toll_free_number', $data ?? [], null); + $this->setIfExists('car_rental_days_rented', $data ?? [], null); + $this->setIfExists('car_rental_fuel_charges', $data ?? [], null); + $this->setIfExists('car_rental_insurance_charges', $data ?? [], null); + $this->setIfExists('car_rental_location_city', $data ?? [], null); + $this->setIfExists('car_rental_location_country', $data ?? [], null); + $this->setIfExists('car_rental_location_state_province', $data ?? [], null); + $this->setIfExists('car_rental_no_show_indicator', $data ?? [], null); + $this->setIfExists('car_rental_one_way_drop_off_charges', $data ?? [], null); + $this->setIfExists('car_rental_rate', $data ?? [], null); + $this->setIfExists('car_rental_rate_indicator', $data ?? [], null); + $this->setIfExists('car_rental_rental_agreement_number', $data ?? [], null); + $this->setIfExists('car_rental_rental_class_id', $data ?? [], null); + $this->setIfExists('car_rental_renter_name', $data ?? [], null); + $this->setIfExists('car_rental_return_city', $data ?? [], null); + $this->setIfExists('car_rental_return_country', $data ?? [], null); + $this->setIfExists('car_rental_return_date', $data ?? [], null); + $this->setIfExists('car_rental_return_location_id', $data ?? [], null); + $this->setIfExists('car_rental_return_state_province', $data ?? [], null); + $this->setIfExists('car_rental_tax_exempt_indicator', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_duration', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_market', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets car_rental_check_out_date + * + * @return string|null + */ + public function getCarRentalCheckOutDate() + { + return $this->container['car_rental_check_out_date']; + } + + /** + * Sets car_rental_check_out_date + * + * @param string|null $car_rental_check_out_date Pick-up date. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setCarRentalCheckOutDate($car_rental_check_out_date) + { + if (is_null($car_rental_check_out_date)) { + throw new \InvalidArgumentException('non-nullable car_rental_check_out_date cannot be null'); + } + $this->container['car_rental_check_out_date'] = $car_rental_check_out_date; + + return $this; + } + + /** + * Gets car_rental_customer_service_toll_free_number + * + * @return string|null + */ + public function getCarRentalCustomerServiceTollFreeNumber() + { + return $this->container['car_rental_customer_service_toll_free_number']; + } + + /** + * Sets car_rental_customer_service_toll_free_number + * + * @param string|null $car_rental_customer_service_toll_free_number The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 + * + * @return self + */ + public function setCarRentalCustomerServiceTollFreeNumber($car_rental_customer_service_toll_free_number) + { + if (is_null($car_rental_customer_service_toll_free_number)) { + throw new \InvalidArgumentException('non-nullable car_rental_customer_service_toll_free_number cannot be null'); + } + $this->container['car_rental_customer_service_toll_free_number'] = $car_rental_customer_service_toll_free_number; + + return $this; + } + + /** + * Gets car_rental_days_rented + * + * @return string|null + */ + public function getCarRentalDaysRented() + { + return $this->container['car_rental_days_rented']; + } + + /** + * Sets car_rental_days_rented + * + * @param string|null $car_rental_days_rented Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 + * + * @return self + */ + public function setCarRentalDaysRented($car_rental_days_rented) + { + if (is_null($car_rental_days_rented)) { + throw new \InvalidArgumentException('non-nullable car_rental_days_rented cannot be null'); + } + $this->container['car_rental_days_rented'] = $car_rental_days_rented; + + return $this; + } + + /** + * Gets car_rental_fuel_charges + * + * @return string|null + */ + public function getCarRentalFuelCharges() + { + return $this->container['car_rental_fuel_charges']; + } + + /** + * Sets car_rental_fuel_charges + * + * @param string|null $car_rental_fuel_charges Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalFuelCharges($car_rental_fuel_charges) + { + if (is_null($car_rental_fuel_charges)) { + throw new \InvalidArgumentException('non-nullable car_rental_fuel_charges cannot be null'); + } + $this->container['car_rental_fuel_charges'] = $car_rental_fuel_charges; + + return $this; + } + + /** + * Gets car_rental_insurance_charges + * + * @return string|null + */ + public function getCarRentalInsuranceCharges() + { + return $this->container['car_rental_insurance_charges']; + } + + /** + * Sets car_rental_insurance_charges + * + * @param string|null $car_rental_insurance_charges Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalInsuranceCharges($car_rental_insurance_charges) + { + if (is_null($car_rental_insurance_charges)) { + throw new \InvalidArgumentException('non-nullable car_rental_insurance_charges cannot be null'); + } + $this->container['car_rental_insurance_charges'] = $car_rental_insurance_charges; + + return $this; + } + + /** + * Gets car_rental_location_city + * + * @return string|null + */ + public function getCarRentalLocationCity() + { + return $this->container['car_rental_location_city']; + } + + /** + * Sets car_rental_location_city + * + * @param string|null $car_rental_location_city The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 + * + * @return self + */ + public function setCarRentalLocationCity($car_rental_location_city) + { + if (is_null($car_rental_location_city)) { + throw new \InvalidArgumentException('non-nullable car_rental_location_city cannot be null'); + } + $this->container['car_rental_location_city'] = $car_rental_location_city; + + return $this; + } + + /** + * Gets car_rental_location_country + * + * @return string|null + */ + public function getCarRentalLocationCountry() + { + return $this->container['car_rental_location_country']; + } + + /** + * Sets car_rental_location_country + * + * @param string|null $car_rental_location_country The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 + * + * @return self + */ + public function setCarRentalLocationCountry($car_rental_location_country) + { + if (is_null($car_rental_location_country)) { + throw new \InvalidArgumentException('non-nullable car_rental_location_country cannot be null'); + } + $this->container['car_rental_location_country'] = $car_rental_location_country; + + return $this; + } + + /** + * Gets car_rental_location_state_province + * + * @return string|null + */ + public function getCarRentalLocationStateProvince() + { + return $this->container['car_rental_location_state_province']; + } + + /** + * Sets car_rental_location_state_province + * + * @param string|null $car_rental_location_state_province The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 + * + * @return self + */ + public function setCarRentalLocationStateProvince($car_rental_location_state_province) + { + if (is_null($car_rental_location_state_province)) { + throw new \InvalidArgumentException('non-nullable car_rental_location_state_province cannot be null'); + } + $this->container['car_rental_location_state_province'] = $car_rental_location_state_province; + + return $this; + } + + /** + * Gets car_rental_no_show_indicator + * + * @return string|null + */ + public function getCarRentalNoShowIndicator() + { + return $this->container['car_rental_no_show_indicator']; + } + + /** + * Sets car_rental_no_show_indicator + * + * @param string|null $car_rental_no_show_indicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. + * + * @return self + */ + public function setCarRentalNoShowIndicator($car_rental_no_show_indicator) + { + if (is_null($car_rental_no_show_indicator)) { + throw new \InvalidArgumentException('non-nullable car_rental_no_show_indicator cannot be null'); + } + $this->container['car_rental_no_show_indicator'] = $car_rental_no_show_indicator; + + return $this; + } + + /** + * Gets car_rental_one_way_drop_off_charges + * + * @return string|null + */ + public function getCarRentalOneWayDropOffCharges() + { + return $this->container['car_rental_one_way_drop_off_charges']; + } + + /** + * Sets car_rental_one_way_drop_off_charges + * + * @param string|null $car_rental_one_way_drop_off_charges Charge associated with not returning a vehicle to the original rental location. + * + * @return self + */ + public function setCarRentalOneWayDropOffCharges($car_rental_one_way_drop_off_charges) + { + if (is_null($car_rental_one_way_drop_off_charges)) { + throw new \InvalidArgumentException('non-nullable car_rental_one_way_drop_off_charges cannot be null'); + } + $this->container['car_rental_one_way_drop_off_charges'] = $car_rental_one_way_drop_off_charges; + + return $this; + } + + /** + * Gets car_rental_rate + * + * @return string|null + */ + public function getCarRentalRate() + { + return $this->container['car_rental_rate']; + } + + /** + * Sets car_rental_rate + * + * @param string|null $car_rental_rate Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalRate($car_rental_rate) + { + if (is_null($car_rental_rate)) { + throw new \InvalidArgumentException('non-nullable car_rental_rate cannot be null'); + } + $this->container['car_rental_rate'] = $car_rental_rate; + + return $this; + } + + /** + * Gets car_rental_rate_indicator + * + * @return string|null + */ + public function getCarRentalRateIndicator() + { + return $this->container['car_rental_rate_indicator']; + } + + /** + * Sets car_rental_rate_indicator + * + * @param string|null $car_rental_rate_indicator Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. + * + * @return self + */ + public function setCarRentalRateIndicator($car_rental_rate_indicator) + { + if (is_null($car_rental_rate_indicator)) { + throw new \InvalidArgumentException('non-nullable car_rental_rate_indicator cannot be null'); + } + $this->container['car_rental_rate_indicator'] = $car_rental_rate_indicator; + + return $this; + } + + /** + * Gets car_rental_rental_agreement_number + * + * @return string|null + */ + public function getCarRentalRentalAgreementNumber() + { + return $this->container['car_rental_rental_agreement_number']; + } + + /** + * Sets car_rental_rental_agreement_number + * + * @param string|null $car_rental_rental_agreement_number The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 + * + * @return self + */ + public function setCarRentalRentalAgreementNumber($car_rental_rental_agreement_number) + { + if (is_null($car_rental_rental_agreement_number)) { + throw new \InvalidArgumentException('non-nullable car_rental_rental_agreement_number cannot be null'); + } + $this->container['car_rental_rental_agreement_number'] = $car_rental_rental_agreement_number; + + return $this; + } + + /** + * Gets car_rental_rental_class_id + * + * @return string|null + */ + public function getCarRentalRentalClassId() + { + return $this->container['car_rental_rental_class_id']; + } + + /** + * Sets car_rental_rental_class_id + * + * @param string|null $car_rental_rental_class_id Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * + * @return self + */ + public function setCarRentalRentalClassId($car_rental_rental_class_id) + { + if (is_null($car_rental_rental_class_id)) { + throw new \InvalidArgumentException('non-nullable car_rental_rental_class_id cannot be null'); + } + $this->container['car_rental_rental_class_id'] = $car_rental_rental_class_id; + + return $this; + } + + /** + * Gets car_rental_renter_name + * + * @return string|null + */ + public function getCarRentalRenterName() + { + return $this->container['car_rental_renter_name']; + } + + /** + * Sets car_rental_renter_name + * + * @param string|null $car_rental_renter_name The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 + * + * @return self + */ + public function setCarRentalRenterName($car_rental_renter_name) + { + if (is_null($car_rental_renter_name)) { + throw new \InvalidArgumentException('non-nullable car_rental_renter_name cannot be null'); + } + $this->container['car_rental_renter_name'] = $car_rental_renter_name; + + return $this; + } + + /** + * Gets car_rental_return_city + * + * @return string|null + */ + public function getCarRentalReturnCity() + { + return $this->container['car_rental_return_city']; + } + + /** + * Sets car_rental_return_city + * + * @param string|null $car_rental_return_city The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 + * + * @return self + */ + public function setCarRentalReturnCity($car_rental_return_city) + { + if (is_null($car_rental_return_city)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_city cannot be null'); + } + $this->container['car_rental_return_city'] = $car_rental_return_city; + + return $this; + } + + /** + * Gets car_rental_return_country + * + * @return string|null + */ + public function getCarRentalReturnCountry() + { + return $this->container['car_rental_return_country']; + } + + /** + * Sets car_rental_return_country + * + * @param string|null $car_rental_return_country The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 + * + * @return self + */ + public function setCarRentalReturnCountry($car_rental_return_country) + { + if (is_null($car_rental_return_country)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_country cannot be null'); + } + $this->container['car_rental_return_country'] = $car_rental_return_country; + + return $this; + } + + /** + * Gets car_rental_return_date + * + * @return string|null + */ + public function getCarRentalReturnDate() + { + return $this->container['car_rental_return_date']; + } + + /** + * Sets car_rental_return_date + * + * @param string|null $car_rental_return_date The last date to return the car by. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setCarRentalReturnDate($car_rental_return_date) + { + if (is_null($car_rental_return_date)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_date cannot be null'); + } + $this->container['car_rental_return_date'] = $car_rental_return_date; + + return $this; + } + + /** + * Gets car_rental_return_location_id + * + * @return string|null + */ + public function getCarRentalReturnLocationId() + { + return $this->container['car_rental_return_location_id']; + } + + /** + * Sets car_rental_return_location_id + * + * @param string|null $car_rental_return_location_id Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 + * + * @return self + */ + public function setCarRentalReturnLocationId($car_rental_return_location_id) + { + if (is_null($car_rental_return_location_id)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_location_id cannot be null'); + } + $this->container['car_rental_return_location_id'] = $car_rental_return_location_id; + + return $this; + } + + /** + * Gets car_rental_return_state_province + * + * @return string|null + */ + public function getCarRentalReturnStateProvince() + { + return $this->container['car_rental_return_state_province']; + } + + /** + * Sets car_rental_return_state_province + * + * @param string|null $car_rental_return_state_province The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 + * + * @return self + */ + public function setCarRentalReturnStateProvince($car_rental_return_state_province) + { + if (is_null($car_rental_return_state_province)) { + throw new \InvalidArgumentException('non-nullable car_rental_return_state_province cannot be null'); + } + $this->container['car_rental_return_state_province'] = $car_rental_return_state_province; + + return $this; + } + + /** + * Gets car_rental_tax_exempt_indicator + * + * @return string|null + */ + public function getCarRentalTaxExemptIndicator() + { + return $this->container['car_rental_tax_exempt_indicator']; + } + + /** + * Sets car_rental_tax_exempt_indicator + * + * @param string|null $car_rental_tax_exempt_indicator Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + * + * @return self + */ + public function setCarRentalTaxExemptIndicator($car_rental_tax_exempt_indicator) + { + if (is_null($car_rental_tax_exempt_indicator)) { + throw new \InvalidArgumentException('non-nullable car_rental_tax_exempt_indicator cannot be null'); + } + $this->container['car_rental_tax_exempt_indicator'] = $car_rental_tax_exempt_indicator; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_duration + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataDuration() + { + return $this->container['travel_entertainment_auth_data_duration']; + } + + /** + * Sets travel_entertainment_auth_data_duration + * + * @param string|null $travel_entertainment_auth_data_duration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * + * @return self + */ + public function setTravelEntertainmentAuthDataDuration($travel_entertainment_auth_data_duration) + { + if (is_null($travel_entertainment_auth_data_duration)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_duration cannot be null'); + } + $this->container['travel_entertainment_auth_data_duration'] = $travel_entertainment_auth_data_duration; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_market + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataMarket() + { + return $this->container['travel_entertainment_auth_data_market']; + } + + /** + * Sets travel_entertainment_auth_data_market + * + * @param string|null $travel_entertainment_auth_data_market Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * + * @return self + */ + public function setTravelEntertainmentAuthDataMarket($travel_entertainment_auth_data_market) + { + if (is_null($travel_entertainment_auth_data_market)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_market cannot be null'); + } + $this->container['travel_entertainment_auth_data_market'] = $travel_entertainment_auth_data_market; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataCommon.php b/src/Adyen/Model/Payments/AdditionalDataCommon.php new file mode 100644 index 000000000..b018f1898 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataCommon.php @@ -0,0 +1,928 @@ + + */ +class AdditionalDataCommon implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataCommon'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requested_test_error_response_code' => 'string', + 'allow_partial_auth' => 'string', + 'authorisation_type' => 'string', + 'custom_routing_flag' => 'string', + 'industry_usage' => 'string', + 'manual_capture' => 'string', + 'network_tx_reference' => 'string', + 'overwrite_brand' => 'string', + 'sub_merchant_city' => 'string', + 'sub_merchant_country' => 'string', + 'sub_merchant_id' => 'string', + 'sub_merchant_name' => 'string', + 'sub_merchant_postal_code' => 'string', + 'sub_merchant_state' => 'string', + 'sub_merchant_street' => 'string', + 'sub_merchant_tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requested_test_error_response_code' => null, + 'allow_partial_auth' => null, + 'authorisation_type' => null, + 'custom_routing_flag' => null, + 'industry_usage' => null, + 'manual_capture' => null, + 'network_tx_reference' => null, + 'overwrite_brand' => null, + 'sub_merchant_city' => null, + 'sub_merchant_country' => null, + 'sub_merchant_id' => null, + 'sub_merchant_name' => null, + 'sub_merchant_postal_code' => null, + 'sub_merchant_state' => null, + 'sub_merchant_street' => null, + 'sub_merchant_tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'requested_test_error_response_code' => false, + 'allow_partial_auth' => false, + 'authorisation_type' => false, + 'custom_routing_flag' => false, + 'industry_usage' => false, + 'manual_capture' => false, + 'network_tx_reference' => false, + 'overwrite_brand' => false, + 'sub_merchant_city' => false, + 'sub_merchant_country' => false, + 'sub_merchant_id' => false, + 'sub_merchant_name' => false, + 'sub_merchant_postal_code' => false, + 'sub_merchant_state' => false, + 'sub_merchant_street' => false, + 'sub_merchant_tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requested_test_error_response_code' => 'RequestedTestErrorResponseCode', + 'allow_partial_auth' => 'allowPartialAuth', + 'authorisation_type' => 'authorisationType', + 'custom_routing_flag' => 'customRoutingFlag', + 'industry_usage' => 'industryUsage', + 'manual_capture' => 'manualCapture', + 'network_tx_reference' => 'networkTxReference', + 'overwrite_brand' => 'overwriteBrand', + 'sub_merchant_city' => 'subMerchantCity', + 'sub_merchant_country' => 'subMerchantCountry', + 'sub_merchant_id' => 'subMerchantID', + 'sub_merchant_name' => 'subMerchantName', + 'sub_merchant_postal_code' => 'subMerchantPostalCode', + 'sub_merchant_state' => 'subMerchantState', + 'sub_merchant_street' => 'subMerchantStreet', + 'sub_merchant_tax_id' => 'subMerchantTaxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requested_test_error_response_code' => 'setRequestedTestErrorResponseCode', + 'allow_partial_auth' => 'setAllowPartialAuth', + 'authorisation_type' => 'setAuthorisationType', + 'custom_routing_flag' => 'setCustomRoutingFlag', + 'industry_usage' => 'setIndustryUsage', + 'manual_capture' => 'setManualCapture', + 'network_tx_reference' => 'setNetworkTxReference', + 'overwrite_brand' => 'setOverwriteBrand', + 'sub_merchant_city' => 'setSubMerchantCity', + 'sub_merchant_country' => 'setSubMerchantCountry', + 'sub_merchant_id' => 'setSubMerchantId', + 'sub_merchant_name' => 'setSubMerchantName', + 'sub_merchant_postal_code' => 'setSubMerchantPostalCode', + 'sub_merchant_state' => 'setSubMerchantState', + 'sub_merchant_street' => 'setSubMerchantStreet', + 'sub_merchant_tax_id' => 'setSubMerchantTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requested_test_error_response_code' => 'getRequestedTestErrorResponseCode', + 'allow_partial_auth' => 'getAllowPartialAuth', + 'authorisation_type' => 'getAuthorisationType', + 'custom_routing_flag' => 'getCustomRoutingFlag', + 'industry_usage' => 'getIndustryUsage', + 'manual_capture' => 'getManualCapture', + 'network_tx_reference' => 'getNetworkTxReference', + 'overwrite_brand' => 'getOverwriteBrand', + 'sub_merchant_city' => 'getSubMerchantCity', + 'sub_merchant_country' => 'getSubMerchantCountry', + 'sub_merchant_id' => 'getSubMerchantId', + 'sub_merchant_name' => 'getSubMerchantName', + 'sub_merchant_postal_code' => 'getSubMerchantPostalCode', + 'sub_merchant_state' => 'getSubMerchantState', + 'sub_merchant_street' => 'getSubMerchantStreet', + 'sub_merchant_tax_id' => 'getSubMerchantTaxId' + ]; + + /** + * 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 INDUSTRY_USAGE_NO_SHOW = 'NoShow'; + public const INDUSTRY_USAGE_DELAYED_CHARGE = 'DelayedCharge'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIndustryUsageAllowableValues() + { + return [ + self::INDUSTRY_USAGE_NO_SHOW, + self::INDUSTRY_USAGE_DELAYED_CHARGE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('requested_test_error_response_code', $data ?? [], null); + $this->setIfExists('allow_partial_auth', $data ?? [], null); + $this->setIfExists('authorisation_type', $data ?? [], null); + $this->setIfExists('custom_routing_flag', $data ?? [], null); + $this->setIfExists('industry_usage', $data ?? [], null); + $this->setIfExists('manual_capture', $data ?? [], null); + $this->setIfExists('network_tx_reference', $data ?? [], null); + $this->setIfExists('overwrite_brand', $data ?? [], null); + $this->setIfExists('sub_merchant_city', $data ?? [], null); + $this->setIfExists('sub_merchant_country', $data ?? [], null); + $this->setIfExists('sub_merchant_id', $data ?? [], null); + $this->setIfExists('sub_merchant_name', $data ?? [], null); + $this->setIfExists('sub_merchant_postal_code', $data ?? [], null); + $this->setIfExists('sub_merchant_state', $data ?? [], null); + $this->setIfExists('sub_merchant_street', $data ?? [], null); + $this->setIfExists('sub_merchant_tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!is_null($this->container['industry_usage']) && !in_array($this->container['industry_usage'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'industry_usage', must be one of '%s'", + $this->container['industry_usage'], + 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 requested_test_error_response_code + * + * @return string|null + */ + public function getRequestedTestErrorResponseCode() + { + return $this->container['requested_test_error_response_code']; + } + + /** + * Sets requested_test_error_response_code + * + * @param string|null $requested_test_error_response_code Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. + * + * @return self + */ + public function setRequestedTestErrorResponseCode($requested_test_error_response_code) + { + if (is_null($requested_test_error_response_code)) { + throw new \InvalidArgumentException('non-nullable requested_test_error_response_code cannot be null'); + } + $this->container['requested_test_error_response_code'] = $requested_test_error_response_code; + + return $this; + } + + /** + * Gets allow_partial_auth + * + * @return string|null + */ + public function getAllowPartialAuth() + { + return $this->container['allow_partial_auth']; + } + + /** + * Sets allow_partial_auth + * + * @param string|null $allow_partial_auth Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. + * + * @return self + */ + public function setAllowPartialAuth($allow_partial_auth) + { + if (is_null($allow_partial_auth)) { + throw new \InvalidArgumentException('non-nullable allow_partial_auth cannot be null'); + } + $this->container['allow_partial_auth'] = $allow_partial_auth; + + return $this; + } + + /** + * Gets authorisation_type + * + * @return string|null + */ + public function getAuthorisationType() + { + return $this->container['authorisation_type']; + } + + /** + * Sets authorisation_type + * + * @param string|null $authorisation_type Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. + * + * @return self + */ + public function setAuthorisationType($authorisation_type) + { + if (is_null($authorisation_type)) { + throw new \InvalidArgumentException('non-nullable authorisation_type cannot be null'); + } + $this->container['authorisation_type'] = $authorisation_type; + + return $this; + } + + /** + * Gets custom_routing_flag + * + * @return string|null + */ + public function getCustomRoutingFlag() + { + return $this->container['custom_routing_flag']; + } + + /** + * Sets custom_routing_flag + * + * @param string|null $custom_routing_flag Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setCustomRoutingFlag($custom_routing_flag) + { + if (is_null($custom_routing_flag)) { + throw new \InvalidArgumentException('non-nullable custom_routing_flag cannot be null'); + } + $this->container['custom_routing_flag'] = $custom_routing_flag; + + return $this; + } + + /** + * Gets industry_usage + * + * @return string|null + */ + public function getIndustryUsage() + { + return $this->container['industry_usage']; + } + + /** + * Sets industry_usage + * + * @param string|null $industry_usage In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. + * + * @return self + */ + public function setIndustryUsage($industry_usage) + { + if (is_null($industry_usage)) { + throw new \InvalidArgumentException('non-nullable industry_usage cannot be null'); + } + $allowedValues = $this->getIndustryUsageAllowableValues(); + if (!in_array($industry_usage, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'industry_usage', must be one of '%s'", + $industry_usage, + implode("', '", $allowedValues) + ) + ); + } + $this->container['industry_usage'] = $industry_usage; + + return $this; + } + + /** + * Gets manual_capture + * + * @return string|null + */ + public function getManualCapture() + { + return $this->container['manual_capture']; + } + + /** + * Sets manual_capture + * + * @param string|null $manual_capture Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. + * + * @return self + */ + public function setManualCapture($manual_capture) + { + if (is_null($manual_capture)) { + throw new \InvalidArgumentException('non-nullable manual_capture cannot be null'); + } + $this->container['manual_capture'] = $manual_capture; + + return $this; + } + + /** + * Gets network_tx_reference + * + * @return string|null + */ + public function getNetworkTxReference() + { + return $this->container['network_tx_reference']; + } + + /** + * Sets network_tx_reference + * + * @param string|null $network_tx_reference Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. + * + * @return self + */ + public function setNetworkTxReference($network_tx_reference) + { + if (is_null($network_tx_reference)) { + throw new \InvalidArgumentException('non-nullable network_tx_reference cannot be null'); + } + $this->container['network_tx_reference'] = $network_tx_reference; + + return $this; + } + + /** + * Gets overwrite_brand + * + * @return string|null + */ + public function getOverwriteBrand() + { + return $this->container['overwrite_brand']; + } + + /** + * Sets overwrite_brand + * + * @param string|null $overwrite_brand Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. + * + * @return self + */ + public function setOverwriteBrand($overwrite_brand) + { + if (is_null($overwrite_brand)) { + throw new \InvalidArgumentException('non-nullable overwrite_brand cannot be null'); + } + $this->container['overwrite_brand'] = $overwrite_brand; + + return $this; + } + + /** + * Gets sub_merchant_city + * + * @return string|null + */ + public function getSubMerchantCity() + { + return $this->container['sub_merchant_city']; + } + + /** + * Sets sub_merchant_city + * + * @param string|null $sub_merchant_city This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. + * + * @return self + */ + public function setSubMerchantCity($sub_merchant_city) + { + if (is_null($sub_merchant_city)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_city cannot be null'); + } + $this->container['sub_merchant_city'] = $sub_merchant_city; + + return $this; + } + + /** + * Gets sub_merchant_country + * + * @return string|null + */ + public function getSubMerchantCountry() + { + return $this->container['sub_merchant_country']; + } + + /** + * Sets sub_merchant_country + * + * @param string|null $sub_merchant_country This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. + * + * @return self + */ + public function setSubMerchantCountry($sub_merchant_country) + { + if (is_null($sub_merchant_country)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_country cannot be null'); + } + $this->container['sub_merchant_country'] = $sub_merchant_country; + + return $this; + } + + /** + * Gets sub_merchant_id + * + * @return string|null + */ + public function getSubMerchantId() + { + return $this->container['sub_merchant_id']; + } + + /** + * Sets sub_merchant_id + * + * @param string|null $sub_merchant_id This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. + * + * @return self + */ + public function setSubMerchantId($sub_merchant_id) + { + if (is_null($sub_merchant_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_id cannot be null'); + } + $this->container['sub_merchant_id'] = $sub_merchant_id; + + return $this; + } + + /** + * Gets sub_merchant_name + * + * @return string|null + */ + public function getSubMerchantName() + { + return $this->container['sub_merchant_name']; + } + + /** + * Sets sub_merchant_name + * + * @param string|null $sub_merchant_name This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. + * + * @return self + */ + public function setSubMerchantName($sub_merchant_name) + { + if (is_null($sub_merchant_name)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_name cannot be null'); + } + $this->container['sub_merchant_name'] = $sub_merchant_name; + + return $this; + } + + /** + * Gets sub_merchant_postal_code + * + * @return string|null + */ + public function getSubMerchantPostalCode() + { + return $this->container['sub_merchant_postal_code']; + } + + /** + * Sets sub_merchant_postal_code + * + * @param string|null $sub_merchant_postal_code This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. + * + * @return self + */ + public function setSubMerchantPostalCode($sub_merchant_postal_code) + { + if (is_null($sub_merchant_postal_code)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_postal_code cannot be null'); + } + $this->container['sub_merchant_postal_code'] = $sub_merchant_postal_code; + + return $this; + } + + /** + * Gets sub_merchant_state + * + * @return string|null + */ + public function getSubMerchantState() + { + return $this->container['sub_merchant_state']; + } + + /** + * Sets sub_merchant_state + * + * @param string|null $sub_merchant_state This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. + * + * @return self + */ + public function setSubMerchantState($sub_merchant_state) + { + if (is_null($sub_merchant_state)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_state cannot be null'); + } + $this->container['sub_merchant_state'] = $sub_merchant_state; + + return $this; + } + + /** + * Gets sub_merchant_street + * + * @return string|null + */ + public function getSubMerchantStreet() + { + return $this->container['sub_merchant_street']; + } + + /** + * Sets sub_merchant_street + * + * @param string|null $sub_merchant_street This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. + * + * @return self + */ + public function setSubMerchantStreet($sub_merchant_street) + { + if (is_null($sub_merchant_street)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_street cannot be null'); + } + $this->container['sub_merchant_street'] = $sub_merchant_street; + + return $this; + } + + /** + * Gets sub_merchant_tax_id + * + * @return string|null + */ + public function getSubMerchantTaxId() + { + return $this->container['sub_merchant_tax_id']; + } + + /** + * Sets sub_merchant_tax_id + * + * @param string|null $sub_merchant_tax_id This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. + * + * @return self + */ + public function setSubMerchantTaxId($sub_merchant_tax_id) + { + if (is_null($sub_merchant_tax_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_tax_id cannot be null'); + } + $this->container['sub_merchant_tax_id'] = $sub_merchant_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 + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataLevel23.php b/src/Adyen/Model/Payments/AdditionalDataLevel23.php new file mode 100644 index 000000000..c05d4c2e4 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataLevel23.php @@ -0,0 +1,929 @@ + + */ +class AdditionalDataLevel23 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataLevel23'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enhanced_scheme_data_customer_reference' => 'string', + 'enhanced_scheme_data_destination_country_code' => 'string', + 'enhanced_scheme_data_destination_postal_code' => 'string', + 'enhanced_scheme_data_destination_state_province_code' => 'string', + 'enhanced_scheme_data_duty_amount' => 'string', + 'enhanced_scheme_data_freight_amount' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'string', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'string', + 'enhanced_scheme_data_order_date' => 'string', + 'enhanced_scheme_data_ship_from_postal_code' => 'string', + 'enhanced_scheme_data_total_tax_amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enhanced_scheme_data_customer_reference' => null, + 'enhanced_scheme_data_destination_country_code' => null, + 'enhanced_scheme_data_destination_postal_code' => null, + 'enhanced_scheme_data_destination_state_province_code' => null, + 'enhanced_scheme_data_duty_amount' => null, + 'enhanced_scheme_data_freight_amount' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_description' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => null, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => null, + 'enhanced_scheme_data_order_date' => null, + 'enhanced_scheme_data_ship_from_postal_code' => null, + 'enhanced_scheme_data_total_tax_amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enhanced_scheme_data_customer_reference' => false, + 'enhanced_scheme_data_destination_country_code' => false, + 'enhanced_scheme_data_destination_postal_code' => false, + 'enhanced_scheme_data_destination_state_province_code' => false, + 'enhanced_scheme_data_duty_amount' => false, + 'enhanced_scheme_data_freight_amount' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_description' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => false, + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => false, + 'enhanced_scheme_data_order_date' => false, + 'enhanced_scheme_data_ship_from_postal_code' => false, + 'enhanced_scheme_data_total_tax_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enhanced_scheme_data_customer_reference' => 'enhancedSchemeData.customerReference', + 'enhanced_scheme_data_destination_country_code' => 'enhancedSchemeData.destinationCountryCode', + 'enhanced_scheme_data_destination_postal_code' => 'enhancedSchemeData.destinationPostalCode', + 'enhanced_scheme_data_destination_state_province_code' => 'enhancedSchemeData.destinationStateProvinceCode', + 'enhanced_scheme_data_duty_amount' => 'enhancedSchemeData.dutyAmount', + 'enhanced_scheme_data_freight_amount' => 'enhancedSchemeData.freightAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'enhancedSchemeData.itemDetailLine[itemNr].commodityCode', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'enhancedSchemeData.itemDetailLine[itemNr].description', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'enhancedSchemeData.itemDetailLine[itemNr].discountAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'enhancedSchemeData.itemDetailLine[itemNr].productCode', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'enhancedSchemeData.itemDetailLine[itemNr].quantity', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'enhancedSchemeData.itemDetailLine[itemNr].totalAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'enhancedSchemeData.itemDetailLine[itemNr].unitPrice', + 'enhanced_scheme_data_order_date' => 'enhancedSchemeData.orderDate', + 'enhanced_scheme_data_ship_from_postal_code' => 'enhancedSchemeData.shipFromPostalCode', + 'enhanced_scheme_data_total_tax_amount' => 'enhancedSchemeData.totalTaxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enhanced_scheme_data_customer_reference' => 'setEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_destination_country_code' => 'setEnhancedSchemeDataDestinationCountryCode', + 'enhanced_scheme_data_destination_postal_code' => 'setEnhancedSchemeDataDestinationPostalCode', + 'enhanced_scheme_data_destination_state_province_code' => 'setEnhancedSchemeDataDestinationStateProvinceCode', + 'enhanced_scheme_data_duty_amount' => 'setEnhancedSchemeDataDutyAmount', + 'enhanced_scheme_data_freight_amount' => 'setEnhancedSchemeDataFreightAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'setEnhancedSchemeDataItemDetailLineItemNrCommodityCode', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'setEnhancedSchemeDataItemDetailLineItemNrDescription', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'setEnhancedSchemeDataItemDetailLineItemNrDiscountAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'setEnhancedSchemeDataItemDetailLineItemNrProductCode', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'setEnhancedSchemeDataItemDetailLineItemNrQuantity', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'setEnhancedSchemeDataItemDetailLineItemNrTotalAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'setEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'setEnhancedSchemeDataItemDetailLineItemNrUnitPrice', + 'enhanced_scheme_data_order_date' => 'setEnhancedSchemeDataOrderDate', + 'enhanced_scheme_data_ship_from_postal_code' => 'setEnhancedSchemeDataShipFromPostalCode', + 'enhanced_scheme_data_total_tax_amount' => 'setEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enhanced_scheme_data_customer_reference' => 'getEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_destination_country_code' => 'getEnhancedSchemeDataDestinationCountryCode', + 'enhanced_scheme_data_destination_postal_code' => 'getEnhancedSchemeDataDestinationPostalCode', + 'enhanced_scheme_data_destination_state_province_code' => 'getEnhancedSchemeDataDestinationStateProvinceCode', + 'enhanced_scheme_data_duty_amount' => 'getEnhancedSchemeDataDutyAmount', + 'enhanced_scheme_data_freight_amount' => 'getEnhancedSchemeDataFreightAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_commodity_code' => 'getEnhancedSchemeDataItemDetailLineItemNrCommodityCode', + 'enhanced_scheme_data_item_detail_line_item_nr_description' => 'getEnhancedSchemeDataItemDetailLineItemNrDescription', + 'enhanced_scheme_data_item_detail_line_item_nr_discount_amount' => 'getEnhancedSchemeDataItemDetailLineItemNrDiscountAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_product_code' => 'getEnhancedSchemeDataItemDetailLineItemNrProductCode', + 'enhanced_scheme_data_item_detail_line_item_nr_quantity' => 'getEnhancedSchemeDataItemDetailLineItemNrQuantity', + 'enhanced_scheme_data_item_detail_line_item_nr_total_amount' => 'getEnhancedSchemeDataItemDetailLineItemNrTotalAmount', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure' => 'getEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure', + 'enhanced_scheme_data_item_detail_line_item_nr_unit_price' => 'getEnhancedSchemeDataItemDetailLineItemNrUnitPrice', + 'enhanced_scheme_data_order_date' => 'getEnhancedSchemeDataOrderDate', + 'enhanced_scheme_data_ship_from_postal_code' => 'getEnhancedSchemeDataShipFromPostalCode', + 'enhanced_scheme_data_total_tax_amount' => 'getEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enhanced_scheme_data_customer_reference', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_destination_country_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_destination_postal_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_destination_state_province_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_duty_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_freight_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_commodity_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_description', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_discount_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_product_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_quantity', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_total_amount', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_item_detail_line_item_nr_unit_price', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_order_date', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_ship_from_postal_code', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_total_tax_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enhanced_scheme_data_customer_reference + * + * @return string|null + */ + public function getEnhancedSchemeDataCustomerReference() + { + return $this->container['enhanced_scheme_data_customer_reference']; + } + + /** + * Sets enhanced_scheme_data_customer_reference + * + * @param string|null $enhanced_scheme_data_customer_reference Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. + * + * @return self + */ + public function setEnhancedSchemeDataCustomerReference($enhanced_scheme_data_customer_reference) + { + if (is_null($enhanced_scheme_data_customer_reference)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_customer_reference cannot be null'); + } + $this->container['enhanced_scheme_data_customer_reference'] = $enhanced_scheme_data_customer_reference; + + return $this; + } + + /** + * Gets enhanced_scheme_data_destination_country_code + * + * @return string|null + */ + public function getEnhancedSchemeDataDestinationCountryCode() + { + return $this->container['enhanced_scheme_data_destination_country_code']; + } + + /** + * Sets enhanced_scheme_data_destination_country_code + * + * @param string|null $enhanced_scheme_data_destination_country_code Destination country code. Encoding: ASCII. Max length: 3 characters. + * + * @return self + */ + public function setEnhancedSchemeDataDestinationCountryCode($enhanced_scheme_data_destination_country_code) + { + if (is_null($enhanced_scheme_data_destination_country_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_destination_country_code cannot be null'); + } + $this->container['enhanced_scheme_data_destination_country_code'] = $enhanced_scheme_data_destination_country_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_destination_postal_code + * + * @return string|null + */ + public function getEnhancedSchemeDataDestinationPostalCode() + { + return $this->container['enhanced_scheme_data_destination_postal_code']; + } + + /** + * Sets enhanced_scheme_data_destination_postal_code + * + * @param string|null $enhanced_scheme_data_destination_postal_code The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. + * + * @return self + */ + public function setEnhancedSchemeDataDestinationPostalCode($enhanced_scheme_data_destination_postal_code) + { + if (is_null($enhanced_scheme_data_destination_postal_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_destination_postal_code cannot be null'); + } + $this->container['enhanced_scheme_data_destination_postal_code'] = $enhanced_scheme_data_destination_postal_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_destination_state_province_code + * + * @return string|null + */ + public function getEnhancedSchemeDataDestinationStateProvinceCode() + { + return $this->container['enhanced_scheme_data_destination_state_province_code']; + } + + /** + * Sets enhanced_scheme_data_destination_state_province_code + * + * @param string|null $enhanced_scheme_data_destination_state_province_code Destination state or province code. Encoding: ASCII.Max length: 3 characters. + * + * @return self + */ + public function setEnhancedSchemeDataDestinationStateProvinceCode($enhanced_scheme_data_destination_state_province_code) + { + if (is_null($enhanced_scheme_data_destination_state_province_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_destination_state_province_code cannot be null'); + } + $this->container['enhanced_scheme_data_destination_state_province_code'] = $enhanced_scheme_data_destination_state_province_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_duty_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataDutyAmount() + { + return $this->container['enhanced_scheme_data_duty_amount']; + } + + /** + * Sets enhanced_scheme_data_duty_amount + * + * @param string|null $enhanced_scheme_data_duty_amount Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataDutyAmount($enhanced_scheme_data_duty_amount) + { + if (is_null($enhanced_scheme_data_duty_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_duty_amount cannot be null'); + } + $this->container['enhanced_scheme_data_duty_amount'] = $enhanced_scheme_data_duty_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_freight_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataFreightAmount() + { + return $this->container['enhanced_scheme_data_freight_amount']; + } + + /** + * Sets enhanced_scheme_data_freight_amount + * + * @param string|null $enhanced_scheme_data_freight_amount Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataFreightAmount($enhanced_scheme_data_freight_amount) + { + if (is_null($enhanced_scheme_data_freight_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_freight_amount cannot be null'); + } + $this->container['enhanced_scheme_data_freight_amount'] = $enhanced_scheme_data_freight_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_commodity_code + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrCommodityCode() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_commodity_code']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_commodity_code + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_commodity_code Item commodity code. Encoding: ASCII. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrCommodityCode($enhanced_scheme_data_item_detail_line_item_nr_commodity_code) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_commodity_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_commodity_code cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_commodity_code'] = $enhanced_scheme_data_item_detail_line_item_nr_commodity_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_description + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrDescription() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_description']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_description + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_description Item description. Encoding: ASCII. Max length: 26 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrDescription($enhanced_scheme_data_item_detail_line_item_nr_description) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_description)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_description cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_description'] = $enhanced_scheme_data_item_detail_line_item_nr_description; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_discount_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrDiscountAmount() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_discount_amount']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_discount_amount + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_discount_amount Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrDiscountAmount($enhanced_scheme_data_item_detail_line_item_nr_discount_amount) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_discount_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_discount_amount cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_discount_amount'] = $enhanced_scheme_data_item_detail_line_item_nr_discount_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_product_code + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrProductCode() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_product_code']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_product_code + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_product_code Product code. Encoding: ASCII. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrProductCode($enhanced_scheme_data_item_detail_line_item_nr_product_code) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_product_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_product_code cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_product_code'] = $enhanced_scheme_data_item_detail_line_item_nr_product_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_quantity + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrQuantity() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_quantity']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_quantity + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_quantity Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrQuantity($enhanced_scheme_data_item_detail_line_item_nr_quantity) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_quantity)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_quantity cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_quantity'] = $enhanced_scheme_data_item_detail_line_item_nr_quantity; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_total_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrTotalAmount() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_total_amount']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_total_amount + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_total_amount Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrTotalAmount($enhanced_scheme_data_item_detail_line_item_nr_total_amount) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_total_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_total_amount cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_total_amount'] = $enhanced_scheme_data_item_detail_line_item_nr_total_amount; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure Item unit of measurement. Encoding: ASCII. Max length: 3 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure($enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure'] = $enhanced_scheme_data_item_detail_line_item_nr_unit_of_measure; + + return $this; + } + + /** + * Gets enhanced_scheme_data_item_detail_line_item_nr_unit_price + * + * @return string|null + */ + public function getEnhancedSchemeDataItemDetailLineItemNrUnitPrice() + { + return $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_price']; + } + + /** + * Sets enhanced_scheme_data_item_detail_line_item_nr_unit_price + * + * @param string|null $enhanced_scheme_data_item_detail_line_item_nr_unit_price Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. + * + * @return self + */ + public function setEnhancedSchemeDataItemDetailLineItemNrUnitPrice($enhanced_scheme_data_item_detail_line_item_nr_unit_price) + { + if (is_null($enhanced_scheme_data_item_detail_line_item_nr_unit_price)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_item_detail_line_item_nr_unit_price cannot be null'); + } + $this->container['enhanced_scheme_data_item_detail_line_item_nr_unit_price'] = $enhanced_scheme_data_item_detail_line_item_nr_unit_price; + + return $this; + } + + /** + * Gets enhanced_scheme_data_order_date + * + * @return string|null + */ + public function getEnhancedSchemeDataOrderDate() + { + return $this->container['enhanced_scheme_data_order_date']; + } + + /** + * Sets enhanced_scheme_data_order_date + * + * @param string|null $enhanced_scheme_data_order_date Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. + * + * @return self + */ + public function setEnhancedSchemeDataOrderDate($enhanced_scheme_data_order_date) + { + if (is_null($enhanced_scheme_data_order_date)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_order_date cannot be null'); + } + $this->container['enhanced_scheme_data_order_date'] = $enhanced_scheme_data_order_date; + + return $this; + } + + /** + * Gets enhanced_scheme_data_ship_from_postal_code + * + * @return string|null + */ + public function getEnhancedSchemeDataShipFromPostalCode() + { + return $this->container['enhanced_scheme_data_ship_from_postal_code']; + } + + /** + * Sets enhanced_scheme_data_ship_from_postal_code + * + * @param string|null $enhanced_scheme_data_ship_from_postal_code The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. + * + * @return self + */ + public function setEnhancedSchemeDataShipFromPostalCode($enhanced_scheme_data_ship_from_postal_code) + { + if (is_null($enhanced_scheme_data_ship_from_postal_code)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_ship_from_postal_code cannot be null'); + } + $this->container['enhanced_scheme_data_ship_from_postal_code'] = $enhanced_scheme_data_ship_from_postal_code; + + return $this; + } + + /** + * Gets enhanced_scheme_data_total_tax_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataTotalTaxAmount() + { + return $this->container['enhanced_scheme_data_total_tax_amount']; + } + + /** + * Sets enhanced_scheme_data_total_tax_amount + * + * @param string|null $enhanced_scheme_data_total_tax_amount Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. + * + * @return self + */ + public function setEnhancedSchemeDataTotalTaxAmount($enhanced_scheme_data_total_tax_amount) + { + if (is_null($enhanced_scheme_data_total_tax_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_total_tax_amount cannot be null'); + } + $this->container['enhanced_scheme_data_total_tax_amount'] = $enhanced_scheme_data_total_tax_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataLodging.php b/src/Adyen/Model/Payments/AdditionalDataLodging.php new file mode 100644 index 000000000..0a6761c5a --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataLodging.php @@ -0,0 +1,929 @@ + + */ +class AdditionalDataLodging implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataLodging'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'lodging_check_in_date' => 'string', + 'lodging_check_out_date' => 'string', + 'lodging_customer_service_toll_free_number' => 'string', + 'lodging_fire_safety_act_indicator' => 'string', + 'lodging_folio_cash_advances' => 'string', + 'lodging_folio_number' => 'string', + 'lodging_food_beverage_charges' => 'string', + 'lodging_no_show_indicator' => 'string', + 'lodging_prepaid_expenses' => 'string', + 'lodging_property_phone_number' => 'string', + 'lodging_room1_number_of_nights' => 'string', + 'lodging_room1_rate' => 'string', + 'lodging_room1_tax' => 'string', + 'lodging_total_room_tax' => 'string', + 'lodging_total_tax' => 'string', + 'travel_entertainment_auth_data_duration' => 'string', + 'travel_entertainment_auth_data_market' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'lodging_check_in_date' => null, + 'lodging_check_out_date' => null, + 'lodging_customer_service_toll_free_number' => null, + 'lodging_fire_safety_act_indicator' => null, + 'lodging_folio_cash_advances' => null, + 'lodging_folio_number' => null, + 'lodging_food_beverage_charges' => null, + 'lodging_no_show_indicator' => null, + 'lodging_prepaid_expenses' => null, + 'lodging_property_phone_number' => null, + 'lodging_room1_number_of_nights' => null, + 'lodging_room1_rate' => null, + 'lodging_room1_tax' => null, + 'lodging_total_room_tax' => null, + 'lodging_total_tax' => null, + 'travel_entertainment_auth_data_duration' => null, + 'travel_entertainment_auth_data_market' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'lodging_check_in_date' => false, + 'lodging_check_out_date' => false, + 'lodging_customer_service_toll_free_number' => false, + 'lodging_fire_safety_act_indicator' => false, + 'lodging_folio_cash_advances' => false, + 'lodging_folio_number' => false, + 'lodging_food_beverage_charges' => false, + 'lodging_no_show_indicator' => false, + 'lodging_prepaid_expenses' => false, + 'lodging_property_phone_number' => false, + 'lodging_room1_number_of_nights' => false, + 'lodging_room1_rate' => false, + 'lodging_room1_tax' => false, + 'lodging_total_room_tax' => false, + 'lodging_total_tax' => false, + 'travel_entertainment_auth_data_duration' => false, + 'travel_entertainment_auth_data_market' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lodging_check_in_date' => 'lodging.checkInDate', + 'lodging_check_out_date' => 'lodging.checkOutDate', + 'lodging_customer_service_toll_free_number' => 'lodging.customerServiceTollFreeNumber', + 'lodging_fire_safety_act_indicator' => 'lodging.fireSafetyActIndicator', + 'lodging_folio_cash_advances' => 'lodging.folioCashAdvances', + 'lodging_folio_number' => 'lodging.folioNumber', + 'lodging_food_beverage_charges' => 'lodging.foodBeverageCharges', + 'lodging_no_show_indicator' => 'lodging.noShowIndicator', + 'lodging_prepaid_expenses' => 'lodging.prepaidExpenses', + 'lodging_property_phone_number' => 'lodging.propertyPhoneNumber', + 'lodging_room1_number_of_nights' => 'lodging.room1.numberOfNights', + 'lodging_room1_rate' => 'lodging.room1.rate', + 'lodging_room1_tax' => 'lodging.room1.tax', + 'lodging_total_room_tax' => 'lodging.totalRoomTax', + 'lodging_total_tax' => 'lodging.totalTax', + 'travel_entertainment_auth_data_duration' => 'travelEntertainmentAuthData.duration', + 'travel_entertainment_auth_data_market' => 'travelEntertainmentAuthData.market' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lodging_check_in_date' => 'setLodgingCheckInDate', + 'lodging_check_out_date' => 'setLodgingCheckOutDate', + 'lodging_customer_service_toll_free_number' => 'setLodgingCustomerServiceTollFreeNumber', + 'lodging_fire_safety_act_indicator' => 'setLodgingFireSafetyActIndicator', + 'lodging_folio_cash_advances' => 'setLodgingFolioCashAdvances', + 'lodging_folio_number' => 'setLodgingFolioNumber', + 'lodging_food_beverage_charges' => 'setLodgingFoodBeverageCharges', + 'lodging_no_show_indicator' => 'setLodgingNoShowIndicator', + 'lodging_prepaid_expenses' => 'setLodgingPrepaidExpenses', + 'lodging_property_phone_number' => 'setLodgingPropertyPhoneNumber', + 'lodging_room1_number_of_nights' => 'setLodgingRoom1NumberOfNights', + 'lodging_room1_rate' => 'setLodgingRoom1Rate', + 'lodging_room1_tax' => 'setLodgingRoom1Tax', + 'lodging_total_room_tax' => 'setLodgingTotalRoomTax', + 'lodging_total_tax' => 'setLodgingTotalTax', + 'travel_entertainment_auth_data_duration' => 'setTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'setTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lodging_check_in_date' => 'getLodgingCheckInDate', + 'lodging_check_out_date' => 'getLodgingCheckOutDate', + 'lodging_customer_service_toll_free_number' => 'getLodgingCustomerServiceTollFreeNumber', + 'lodging_fire_safety_act_indicator' => 'getLodgingFireSafetyActIndicator', + 'lodging_folio_cash_advances' => 'getLodgingFolioCashAdvances', + 'lodging_folio_number' => 'getLodgingFolioNumber', + 'lodging_food_beverage_charges' => 'getLodgingFoodBeverageCharges', + 'lodging_no_show_indicator' => 'getLodgingNoShowIndicator', + 'lodging_prepaid_expenses' => 'getLodgingPrepaidExpenses', + 'lodging_property_phone_number' => 'getLodgingPropertyPhoneNumber', + 'lodging_room1_number_of_nights' => 'getLodgingRoom1NumberOfNights', + 'lodging_room1_rate' => 'getLodgingRoom1Rate', + 'lodging_room1_tax' => 'getLodgingRoom1Tax', + 'lodging_total_room_tax' => 'getLodgingTotalRoomTax', + 'lodging_total_tax' => 'getLodgingTotalTax', + 'travel_entertainment_auth_data_duration' => 'getTravelEntertainmentAuthDataDuration', + 'travel_entertainment_auth_data_market' => 'getTravelEntertainmentAuthDataMarket' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('lodging_check_in_date', $data ?? [], null); + $this->setIfExists('lodging_check_out_date', $data ?? [], null); + $this->setIfExists('lodging_customer_service_toll_free_number', $data ?? [], null); + $this->setIfExists('lodging_fire_safety_act_indicator', $data ?? [], null); + $this->setIfExists('lodging_folio_cash_advances', $data ?? [], null); + $this->setIfExists('lodging_folio_number', $data ?? [], null); + $this->setIfExists('lodging_food_beverage_charges', $data ?? [], null); + $this->setIfExists('lodging_no_show_indicator', $data ?? [], null); + $this->setIfExists('lodging_prepaid_expenses', $data ?? [], null); + $this->setIfExists('lodging_property_phone_number', $data ?? [], null); + $this->setIfExists('lodging_room1_number_of_nights', $data ?? [], null); + $this->setIfExists('lodging_room1_rate', $data ?? [], null); + $this->setIfExists('lodging_room1_tax', $data ?? [], null); + $this->setIfExists('lodging_total_room_tax', $data ?? [], null); + $this->setIfExists('lodging_total_tax', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_duration', $data ?? [], null); + $this->setIfExists('travel_entertainment_auth_data_market', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lodging_check_in_date + * + * @return string|null + */ + public function getLodgingCheckInDate() + { + return $this->container['lodging_check_in_date']; + } + + /** + * Sets lodging_check_in_date + * + * @param string|null $lodging_check_in_date The arrival date. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setLodgingCheckInDate($lodging_check_in_date) + { + if (is_null($lodging_check_in_date)) { + throw new \InvalidArgumentException('non-nullable lodging_check_in_date cannot be null'); + } + $this->container['lodging_check_in_date'] = $lodging_check_in_date; + + return $this; + } + + /** + * Gets lodging_check_out_date + * + * @return string|null + */ + public function getLodgingCheckOutDate() + { + return $this->container['lodging_check_out_date']; + } + + /** + * Sets lodging_check_out_date + * + * @param string|null $lodging_check_out_date The departure date. * Date format: `yyyyMMdd` + * + * @return self + */ + public function setLodgingCheckOutDate($lodging_check_out_date) + { + if (is_null($lodging_check_out_date)) { + throw new \InvalidArgumentException('non-nullable lodging_check_out_date cannot be null'); + } + $this->container['lodging_check_out_date'] = $lodging_check_out_date; + + return $this; + } + + /** + * Gets lodging_customer_service_toll_free_number + * + * @return string|null + */ + public function getLodgingCustomerServiceTollFreeNumber() + { + return $this->container['lodging_customer_service_toll_free_number']; + } + + /** + * Sets lodging_customer_service_toll_free_number + * + * @param string|null $lodging_customer_service_toll_free_number The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17 + * + * @return self + */ + public function setLodgingCustomerServiceTollFreeNumber($lodging_customer_service_toll_free_number) + { + if (is_null($lodging_customer_service_toll_free_number)) { + throw new \InvalidArgumentException('non-nullable lodging_customer_service_toll_free_number cannot be null'); + } + $this->container['lodging_customer_service_toll_free_number'] = $lodging_customer_service_toll_free_number; + + return $this; + } + + /** + * Gets lodging_fire_safety_act_indicator + * + * @return string|null + */ + public function getLodgingFireSafetyActIndicator() + { + return $this->container['lodging_fire_safety_act_indicator']; + } + + /** + * Sets lodging_fire_safety_act_indicator + * + * @param string|null $lodging_fire_safety_act_indicator Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1 + * + * @return self + */ + public function setLodgingFireSafetyActIndicator($lodging_fire_safety_act_indicator) + { + if (is_null($lodging_fire_safety_act_indicator)) { + throw new \InvalidArgumentException('non-nullable lodging_fire_safety_act_indicator cannot be null'); + } + $this->container['lodging_fire_safety_act_indicator'] = $lodging_fire_safety_act_indicator; + + return $this; + } + + /** + * Gets lodging_folio_cash_advances + * + * @return string|null + */ + public function getLodgingFolioCashAdvances() + { + return $this->container['lodging_folio_cash_advances']; + } + + /** + * Sets lodging_folio_cash_advances + * + * @param string|null $lodging_folio_cash_advances The folio cash advances. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingFolioCashAdvances($lodging_folio_cash_advances) + { + if (is_null($lodging_folio_cash_advances)) { + throw new \InvalidArgumentException('non-nullable lodging_folio_cash_advances cannot be null'); + } + $this->container['lodging_folio_cash_advances'] = $lodging_folio_cash_advances; + + return $this; + } + + /** + * Gets lodging_folio_number + * + * @return string|null + */ + public function getLodgingFolioNumber() + { + return $this->container['lodging_folio_number']; + } + + /** + * Sets lodging_folio_number + * + * @param string|null $lodging_folio_number Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25 + * + * @return self + */ + public function setLodgingFolioNumber($lodging_folio_number) + { + if (is_null($lodging_folio_number)) { + throw new \InvalidArgumentException('non-nullable lodging_folio_number cannot be null'); + } + $this->container['lodging_folio_number'] = $lodging_folio_number; + + return $this; + } + + /** + * Gets lodging_food_beverage_charges + * + * @return string|null + */ + public function getLodgingFoodBeverageCharges() + { + return $this->container['lodging_food_beverage_charges']; + } + + /** + * Sets lodging_food_beverage_charges + * + * @param string|null $lodging_food_beverage_charges Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingFoodBeverageCharges($lodging_food_beverage_charges) + { + if (is_null($lodging_food_beverage_charges)) { + throw new \InvalidArgumentException('non-nullable lodging_food_beverage_charges cannot be null'); + } + $this->container['lodging_food_beverage_charges'] = $lodging_food_beverage_charges; + + return $this; + } + + /** + * Gets lodging_no_show_indicator + * + * @return string|null + */ + public function getLodgingNoShowIndicator() + { + return $this->container['lodging_no_show_indicator']; + } + + /** + * Sets lodging_no_show_indicator + * + * @param string|null $lodging_no_show_indicator Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1 + * + * @return self + */ + public function setLodgingNoShowIndicator($lodging_no_show_indicator) + { + if (is_null($lodging_no_show_indicator)) { + throw new \InvalidArgumentException('non-nullable lodging_no_show_indicator cannot be null'); + } + $this->container['lodging_no_show_indicator'] = $lodging_no_show_indicator; + + return $this; + } + + /** + * Gets lodging_prepaid_expenses + * + * @return string|null + */ + public function getLodgingPrepaidExpenses() + { + return $this->container['lodging_prepaid_expenses']; + } + + /** + * Sets lodging_prepaid_expenses + * + * @param string|null $lodging_prepaid_expenses Prepaid expenses for the booking. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingPrepaidExpenses($lodging_prepaid_expenses) + { + if (is_null($lodging_prepaid_expenses)) { + throw new \InvalidArgumentException('non-nullable lodging_prepaid_expenses cannot be null'); + } + $this->container['lodging_prepaid_expenses'] = $lodging_prepaid_expenses; + + return $this; + } + + /** + * Gets lodging_property_phone_number + * + * @return string|null + */ + public function getLodgingPropertyPhoneNumber() + { + return $this->container['lodging_property_phone_number']; + } + + /** + * Sets lodging_property_phone_number + * + * @param string|null $lodging_property_phone_number Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17 + * + * @return self + */ + public function setLodgingPropertyPhoneNumber($lodging_property_phone_number) + { + if (is_null($lodging_property_phone_number)) { + throw new \InvalidArgumentException('non-nullable lodging_property_phone_number cannot be null'); + } + $this->container['lodging_property_phone_number'] = $lodging_property_phone_number; + + return $this; + } + + /** + * Gets lodging_room1_number_of_nights + * + * @return string|null + */ + public function getLodgingRoom1NumberOfNights() + { + return $this->container['lodging_room1_number_of_nights']; + } + + /** + * Sets lodging_room1_number_of_nights + * + * @param string|null $lodging_room1_number_of_nights Total number of nights the room will be rented. * Format: Numeric * maxLength: 4 + * + * @return self + */ + public function setLodgingRoom1NumberOfNights($lodging_room1_number_of_nights) + { + if (is_null($lodging_room1_number_of_nights)) { + throw new \InvalidArgumentException('non-nullable lodging_room1_number_of_nights cannot be null'); + } + $this->container['lodging_room1_number_of_nights'] = $lodging_room1_number_of_nights; + + return $this; + } + + /** + * Gets lodging_room1_rate + * + * @return string|null + */ + public function getLodgingRoom1Rate() + { + return $this->container['lodging_room1_rate']; + } + + /** + * Sets lodging_room1_rate + * + * @param string|null $lodging_room1_rate The rate of the room. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingRoom1Rate($lodging_room1_rate) + { + if (is_null($lodging_room1_rate)) { + throw new \InvalidArgumentException('non-nullable lodging_room1_rate cannot be null'); + } + $this->container['lodging_room1_rate'] = $lodging_room1_rate; + + return $this; + } + + /** + * Gets lodging_room1_tax + * + * @return string|null + */ + public function getLodgingRoom1Tax() + { + return $this->container['lodging_room1_tax']; + } + + /** + * Sets lodging_room1_tax + * + * @param string|null $lodging_room1_tax The total amount of tax to be paid. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingRoom1Tax($lodging_room1_tax) + { + if (is_null($lodging_room1_tax)) { + throw new \InvalidArgumentException('non-nullable lodging_room1_tax cannot be null'); + } + $this->container['lodging_room1_tax'] = $lodging_room1_tax; + + return $this; + } + + /** + * Gets lodging_total_room_tax + * + * @return string|null + */ + public function getLodgingTotalRoomTax() + { + return $this->container['lodging_total_room_tax']; + } + + /** + * Sets lodging_total_room_tax + * + * @param string|null $lodging_total_room_tax Total room tax amount. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingTotalRoomTax($lodging_total_room_tax) + { + if (is_null($lodging_total_room_tax)) { + throw new \InvalidArgumentException('non-nullable lodging_total_room_tax cannot be null'); + } + $this->container['lodging_total_room_tax'] = $lodging_total_room_tax; + + return $this; + } + + /** + * Gets lodging_total_tax + * + * @return string|null + */ + public function getLodgingTotalTax() + { + return $this->container['lodging_total_tax']; + } + + /** + * Sets lodging_total_tax + * + * @param string|null $lodging_total_tax Total tax amount. * Format: Numeric * maxLength: 12 + * + * @return self + */ + public function setLodgingTotalTax($lodging_total_tax) + { + if (is_null($lodging_total_tax)) { + throw new \InvalidArgumentException('non-nullable lodging_total_tax cannot be null'); + } + $this->container['lodging_total_tax'] = $lodging_total_tax; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_duration + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataDuration() + { + return $this->container['travel_entertainment_auth_data_duration']; + } + + /** + * Sets travel_entertainment_auth_data_duration + * + * @param string|null $travel_entertainment_auth_data_duration Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * + * @return self + */ + public function setTravelEntertainmentAuthDataDuration($travel_entertainment_auth_data_duration) + { + if (is_null($travel_entertainment_auth_data_duration)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_duration cannot be null'); + } + $this->container['travel_entertainment_auth_data_duration'] = $travel_entertainment_auth_data_duration; + + return $this; + } + + /** + * Gets travel_entertainment_auth_data_market + * + * @return string|null + */ + public function getTravelEntertainmentAuthDataMarket() + { + return $this->container['travel_entertainment_auth_data_market']; + } + + /** + * Sets travel_entertainment_auth_data_market + * + * @param string|null $travel_entertainment_auth_data_market Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * + * @return self + */ + public function setTravelEntertainmentAuthDataMarket($travel_entertainment_auth_data_market) + { + if (is_null($travel_entertainment_auth_data_market)) { + throw new \InvalidArgumentException('non-nullable travel_entertainment_auth_data_market cannot be null'); + } + $this->container['travel_entertainment_auth_data_market'] = $travel_entertainment_auth_data_market; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataModifications.php b/src/Adyen/Model/Payments/AdditionalDataModifications.php new file mode 100644 index 000000000..cacdfaba8 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataModifications.php @@ -0,0 +1,385 @@ + + */ +class AdditionalDataModifications implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataModifications'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'installment_payment_data_selected_installment_option' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'installment_payment_data_selected_installment_option' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'installment_payment_data_selected_installment_option' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'installment_payment_data_selected_installment_option' => 'installmentPaymentData.selectedInstallmentOption' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'installment_payment_data_selected_installment_option' => 'setInstallmentPaymentDataSelectedInstallmentOption' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'installment_payment_data_selected_installment_option' => 'getInstallmentPaymentDataSelectedInstallmentOption' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('installment_payment_data_selected_installment_option', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets installment_payment_data_selected_installment_option + * + * @return string|null + */ + public function getInstallmentPaymentDataSelectedInstallmentOption() + { + return $this->container['installment_payment_data_selected_installment_option']; + } + + /** + * Sets installment_payment_data_selected_installment_option + * + * @param string|null $installment_payment_data_selected_installment_option This is the installment option selected by the shopper. It is required only if specified by the user. + * + * @return self + */ + public function setInstallmentPaymentDataSelectedInstallmentOption($installment_payment_data_selected_installment_option) + { + if (is_null($installment_payment_data_selected_installment_option)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_selected_installment_option cannot be null'); + } + $this->container['installment_payment_data_selected_installment_option'] = $installment_payment_data_selected_installment_option; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataOpenInvoice.php b/src/Adyen/Model/Payments/AdditionalDataOpenInvoice.php new file mode 100644 index 000000000..80bce114f --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataOpenInvoice.php @@ -0,0 +1,963 @@ + + */ +class AdditionalDataOpenInvoice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataOpenInvoice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'openinvoicedata_merchant_data' => 'string', + 'openinvoicedata_number_of_lines' => 'string', + 'openinvoicedata_recipient_first_name' => 'string', + 'openinvoicedata_recipient_last_name' => 'string', + 'openinvoicedata_line_item_nr_currency_code' => 'string', + 'openinvoicedata_line_item_nr_description' => 'string', + 'openinvoicedata_line_item_nr_item_amount' => 'string', + 'openinvoicedata_line_item_nr_item_id' => 'string', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'string', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'string', + 'openinvoicedata_line_item_nr_number_of_items' => 'string', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'string', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'string', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'string', + 'openinvoicedata_line_item_nr_shipping_company' => 'string', + 'openinvoicedata_line_item_nr_shipping_method' => 'string', + 'openinvoicedata_line_item_nr_tracking_number' => 'string', + 'openinvoicedata_line_item_nr_tracking_uri' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'openinvoicedata_merchant_data' => null, + 'openinvoicedata_number_of_lines' => null, + 'openinvoicedata_recipient_first_name' => null, + 'openinvoicedata_recipient_last_name' => null, + 'openinvoicedata_line_item_nr_currency_code' => null, + 'openinvoicedata_line_item_nr_description' => null, + 'openinvoicedata_line_item_nr_item_amount' => null, + 'openinvoicedata_line_item_nr_item_id' => null, + 'openinvoicedata_line_item_nr_item_vat_amount' => null, + 'openinvoicedata_line_item_nr_item_vat_percentage' => null, + 'openinvoicedata_line_item_nr_number_of_items' => null, + 'openinvoicedata_line_item_nr_return_shipping_company' => null, + 'openinvoicedata_line_item_nr_return_tracking_number' => null, + 'openinvoicedata_line_item_nr_return_tracking_uri' => null, + 'openinvoicedata_line_item_nr_shipping_company' => null, + 'openinvoicedata_line_item_nr_shipping_method' => null, + 'openinvoicedata_line_item_nr_tracking_number' => null, + 'openinvoicedata_line_item_nr_tracking_uri' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'openinvoicedata_merchant_data' => false, + 'openinvoicedata_number_of_lines' => false, + 'openinvoicedata_recipient_first_name' => false, + 'openinvoicedata_recipient_last_name' => false, + 'openinvoicedata_line_item_nr_currency_code' => false, + 'openinvoicedata_line_item_nr_description' => false, + 'openinvoicedata_line_item_nr_item_amount' => false, + 'openinvoicedata_line_item_nr_item_id' => false, + 'openinvoicedata_line_item_nr_item_vat_amount' => false, + 'openinvoicedata_line_item_nr_item_vat_percentage' => false, + 'openinvoicedata_line_item_nr_number_of_items' => false, + 'openinvoicedata_line_item_nr_return_shipping_company' => false, + 'openinvoicedata_line_item_nr_return_tracking_number' => false, + 'openinvoicedata_line_item_nr_return_tracking_uri' => false, + 'openinvoicedata_line_item_nr_shipping_company' => false, + 'openinvoicedata_line_item_nr_shipping_method' => false, + 'openinvoicedata_line_item_nr_tracking_number' => false, + 'openinvoicedata_line_item_nr_tracking_uri' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'openinvoicedata_merchant_data' => 'openinvoicedata.merchantData', + 'openinvoicedata_number_of_lines' => 'openinvoicedata.numberOfLines', + 'openinvoicedata_recipient_first_name' => 'openinvoicedata.recipientFirstName', + 'openinvoicedata_recipient_last_name' => 'openinvoicedata.recipientLastName', + 'openinvoicedata_line_item_nr_currency_code' => 'openinvoicedataLine[itemNr].currencyCode', + 'openinvoicedata_line_item_nr_description' => 'openinvoicedataLine[itemNr].description', + 'openinvoicedata_line_item_nr_item_amount' => 'openinvoicedataLine[itemNr].itemAmount', + 'openinvoicedata_line_item_nr_item_id' => 'openinvoicedataLine[itemNr].itemId', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'openinvoicedataLine[itemNr].itemVatAmount', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'openinvoicedataLine[itemNr].itemVatPercentage', + 'openinvoicedata_line_item_nr_number_of_items' => 'openinvoicedataLine[itemNr].numberOfItems', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'openinvoicedataLine[itemNr].returnShippingCompany', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'openinvoicedataLine[itemNr].returnTrackingNumber', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'openinvoicedataLine[itemNr].returnTrackingUri', + 'openinvoicedata_line_item_nr_shipping_company' => 'openinvoicedataLine[itemNr].shippingCompany', + 'openinvoicedata_line_item_nr_shipping_method' => 'openinvoicedataLine[itemNr].shippingMethod', + 'openinvoicedata_line_item_nr_tracking_number' => 'openinvoicedataLine[itemNr].trackingNumber', + 'openinvoicedata_line_item_nr_tracking_uri' => 'openinvoicedataLine[itemNr].trackingUri' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'openinvoicedata_merchant_data' => 'setOpeninvoicedataMerchantData', + 'openinvoicedata_number_of_lines' => 'setOpeninvoicedataNumberOfLines', + 'openinvoicedata_recipient_first_name' => 'setOpeninvoicedataRecipientFirstName', + 'openinvoicedata_recipient_last_name' => 'setOpeninvoicedataRecipientLastName', + 'openinvoicedata_line_item_nr_currency_code' => 'setOpeninvoicedataLineItemNrCurrencyCode', + 'openinvoicedata_line_item_nr_description' => 'setOpeninvoicedataLineItemNrDescription', + 'openinvoicedata_line_item_nr_item_amount' => 'setOpeninvoicedataLineItemNrItemAmount', + 'openinvoicedata_line_item_nr_item_id' => 'setOpeninvoicedataLineItemNrItemId', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'setOpeninvoicedataLineItemNrItemVatAmount', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'setOpeninvoicedataLineItemNrItemVatPercentage', + 'openinvoicedata_line_item_nr_number_of_items' => 'setOpeninvoicedataLineItemNrNumberOfItems', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'setOpeninvoicedataLineItemNrReturnShippingCompany', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'setOpeninvoicedataLineItemNrReturnTrackingNumber', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'setOpeninvoicedataLineItemNrReturnTrackingUri', + 'openinvoicedata_line_item_nr_shipping_company' => 'setOpeninvoicedataLineItemNrShippingCompany', + 'openinvoicedata_line_item_nr_shipping_method' => 'setOpeninvoicedataLineItemNrShippingMethod', + 'openinvoicedata_line_item_nr_tracking_number' => 'setOpeninvoicedataLineItemNrTrackingNumber', + 'openinvoicedata_line_item_nr_tracking_uri' => 'setOpeninvoicedataLineItemNrTrackingUri' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'openinvoicedata_merchant_data' => 'getOpeninvoicedataMerchantData', + 'openinvoicedata_number_of_lines' => 'getOpeninvoicedataNumberOfLines', + 'openinvoicedata_recipient_first_name' => 'getOpeninvoicedataRecipientFirstName', + 'openinvoicedata_recipient_last_name' => 'getOpeninvoicedataRecipientLastName', + 'openinvoicedata_line_item_nr_currency_code' => 'getOpeninvoicedataLineItemNrCurrencyCode', + 'openinvoicedata_line_item_nr_description' => 'getOpeninvoicedataLineItemNrDescription', + 'openinvoicedata_line_item_nr_item_amount' => 'getOpeninvoicedataLineItemNrItemAmount', + 'openinvoicedata_line_item_nr_item_id' => 'getOpeninvoicedataLineItemNrItemId', + 'openinvoicedata_line_item_nr_item_vat_amount' => 'getOpeninvoicedataLineItemNrItemVatAmount', + 'openinvoicedata_line_item_nr_item_vat_percentage' => 'getOpeninvoicedataLineItemNrItemVatPercentage', + 'openinvoicedata_line_item_nr_number_of_items' => 'getOpeninvoicedataLineItemNrNumberOfItems', + 'openinvoicedata_line_item_nr_return_shipping_company' => 'getOpeninvoicedataLineItemNrReturnShippingCompany', + 'openinvoicedata_line_item_nr_return_tracking_number' => 'getOpeninvoicedataLineItemNrReturnTrackingNumber', + 'openinvoicedata_line_item_nr_return_tracking_uri' => 'getOpeninvoicedataLineItemNrReturnTrackingUri', + 'openinvoicedata_line_item_nr_shipping_company' => 'getOpeninvoicedataLineItemNrShippingCompany', + 'openinvoicedata_line_item_nr_shipping_method' => 'getOpeninvoicedataLineItemNrShippingMethod', + 'openinvoicedata_line_item_nr_tracking_number' => 'getOpeninvoicedataLineItemNrTrackingNumber', + 'openinvoicedata_line_item_nr_tracking_uri' => 'getOpeninvoicedataLineItemNrTrackingUri' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('openinvoicedata_merchant_data', $data ?? [], null); + $this->setIfExists('openinvoicedata_number_of_lines', $data ?? [], null); + $this->setIfExists('openinvoicedata_recipient_first_name', $data ?? [], null); + $this->setIfExists('openinvoicedata_recipient_last_name', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_currency_code', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_description', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_amount', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_id', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_vat_amount', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_item_vat_percentage', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_number_of_items', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_return_shipping_company', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_return_tracking_number', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_return_tracking_uri', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_shipping_company', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_shipping_method', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_tracking_number', $data ?? [], null); + $this->setIfExists('openinvoicedata_line_item_nr_tracking_uri', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets openinvoicedata_merchant_data + * + * @return string|null + */ + public function getOpeninvoicedataMerchantData() + { + return $this->container['openinvoicedata_merchant_data']; + } + + /** + * Sets openinvoicedata_merchant_data + * + * @param string|null $openinvoicedata_merchant_data Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. + * + * @return self + */ + public function setOpeninvoicedataMerchantData($openinvoicedata_merchant_data) + { + if (is_null($openinvoicedata_merchant_data)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_merchant_data cannot be null'); + } + $this->container['openinvoicedata_merchant_data'] = $openinvoicedata_merchant_data; + + return $this; + } + + /** + * Gets openinvoicedata_number_of_lines + * + * @return string|null + */ + public function getOpeninvoicedataNumberOfLines() + { + return $this->container['openinvoicedata_number_of_lines']; + } + + /** + * Sets openinvoicedata_number_of_lines + * + * @param string|null $openinvoicedata_number_of_lines The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. + * + * @return self + */ + public function setOpeninvoicedataNumberOfLines($openinvoicedata_number_of_lines) + { + if (is_null($openinvoicedata_number_of_lines)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_number_of_lines cannot be null'); + } + $this->container['openinvoicedata_number_of_lines'] = $openinvoicedata_number_of_lines; + + return $this; + } + + /** + * Gets openinvoicedata_recipient_first_name + * + * @return string|null + */ + public function getOpeninvoicedataRecipientFirstName() + { + return $this->container['openinvoicedata_recipient_first_name']; + } + + /** + * Sets openinvoicedata_recipient_first_name + * + * @param string|null $openinvoicedata_recipient_first_name First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. + * + * @return self + */ + public function setOpeninvoicedataRecipientFirstName($openinvoicedata_recipient_first_name) + { + if (is_null($openinvoicedata_recipient_first_name)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_recipient_first_name cannot be null'); + } + $this->container['openinvoicedata_recipient_first_name'] = $openinvoicedata_recipient_first_name; + + return $this; + } + + /** + * Gets openinvoicedata_recipient_last_name + * + * @return string|null + */ + public function getOpeninvoicedataRecipientLastName() + { + return $this->container['openinvoicedata_recipient_last_name']; + } + + /** + * Sets openinvoicedata_recipient_last_name + * + * @param string|null $openinvoicedata_recipient_last_name Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. + * + * @return self + */ + public function setOpeninvoicedataRecipientLastName($openinvoicedata_recipient_last_name) + { + if (is_null($openinvoicedata_recipient_last_name)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_recipient_last_name cannot be null'); + } + $this->container['openinvoicedata_recipient_last_name'] = $openinvoicedata_recipient_last_name; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_currency_code + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrCurrencyCode() + { + return $this->container['openinvoicedata_line_item_nr_currency_code']; + } + + /** + * Sets openinvoicedata_line_item_nr_currency_code + * + * @param string|null $openinvoicedata_line_item_nr_currency_code The three-character ISO currency code. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrCurrencyCode($openinvoicedata_line_item_nr_currency_code) + { + if (is_null($openinvoicedata_line_item_nr_currency_code)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_currency_code cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_currency_code'] = $openinvoicedata_line_item_nr_currency_code; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_description + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrDescription() + { + return $this->container['openinvoicedata_line_item_nr_description']; + } + + /** + * Sets openinvoicedata_line_item_nr_description + * + * @param string|null $openinvoicedata_line_item_nr_description A text description of the product the invoice line refers to. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrDescription($openinvoicedata_line_item_nr_description) + { + if (is_null($openinvoicedata_line_item_nr_description)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_description cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_description'] = $openinvoicedata_line_item_nr_description; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_amount + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemAmount() + { + return $this->container['openinvoicedata_line_item_nr_item_amount']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_amount + * + * @param string|null $openinvoicedata_line_item_nr_item_amount The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemAmount($openinvoicedata_line_item_nr_item_amount) + { + if (is_null($openinvoicedata_line_item_nr_item_amount)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_amount cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_amount'] = $openinvoicedata_line_item_nr_item_amount; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_id + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemId() + { + return $this->container['openinvoicedata_line_item_nr_item_id']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_id + * + * @param string|null $openinvoicedata_line_item_nr_item_id A unique id for this item. Required for RatePay if the description of each item is not unique. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemId($openinvoicedata_line_item_nr_item_id) + { + if (is_null($openinvoicedata_line_item_nr_item_id)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_id cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_id'] = $openinvoicedata_line_item_nr_item_id; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_vat_amount + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemVatAmount() + { + return $this->container['openinvoicedata_line_item_nr_item_vat_amount']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_vat_amount + * + * @param string|null $openinvoicedata_line_item_nr_item_vat_amount The VAT due for one item in the invoice line, represented in minor units. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemVatAmount($openinvoicedata_line_item_nr_item_vat_amount) + { + if (is_null($openinvoicedata_line_item_nr_item_vat_amount)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_vat_amount cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_vat_amount'] = $openinvoicedata_line_item_nr_item_vat_amount; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_item_vat_percentage + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrItemVatPercentage() + { + return $this->container['openinvoicedata_line_item_nr_item_vat_percentage']; + } + + /** + * Sets openinvoicedata_line_item_nr_item_vat_percentage + * + * @param string|null $openinvoicedata_line_item_nr_item_vat_percentage The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrItemVatPercentage($openinvoicedata_line_item_nr_item_vat_percentage) + { + if (is_null($openinvoicedata_line_item_nr_item_vat_percentage)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_item_vat_percentage cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_item_vat_percentage'] = $openinvoicedata_line_item_nr_item_vat_percentage; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_number_of_items + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrNumberOfItems() + { + return $this->container['openinvoicedata_line_item_nr_number_of_items']; + } + + /** + * Sets openinvoicedata_line_item_nr_number_of_items + * + * @param string|null $openinvoicedata_line_item_nr_number_of_items The number of units purchased of a specific product. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrNumberOfItems($openinvoicedata_line_item_nr_number_of_items) + { + if (is_null($openinvoicedata_line_item_nr_number_of_items)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_number_of_items cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_number_of_items'] = $openinvoicedata_line_item_nr_number_of_items; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_return_shipping_company + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrReturnShippingCompany() + { + return $this->container['openinvoicedata_line_item_nr_return_shipping_company']; + } + + /** + * Sets openinvoicedata_line_item_nr_return_shipping_company + * + * @param string|null $openinvoicedata_line_item_nr_return_shipping_company Name of the shipping company handling the the return shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrReturnShippingCompany($openinvoicedata_line_item_nr_return_shipping_company) + { + if (is_null($openinvoicedata_line_item_nr_return_shipping_company)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_return_shipping_company cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_return_shipping_company'] = $openinvoicedata_line_item_nr_return_shipping_company; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_return_tracking_number + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrReturnTrackingNumber() + { + return $this->container['openinvoicedata_line_item_nr_return_tracking_number']; + } + + /** + * Sets openinvoicedata_line_item_nr_return_tracking_number + * + * @param string|null $openinvoicedata_line_item_nr_return_tracking_number The tracking number for the return of the shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrReturnTrackingNumber($openinvoicedata_line_item_nr_return_tracking_number) + { + if (is_null($openinvoicedata_line_item_nr_return_tracking_number)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_return_tracking_number cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_return_tracking_number'] = $openinvoicedata_line_item_nr_return_tracking_number; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_return_tracking_uri + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrReturnTrackingUri() + { + return $this->container['openinvoicedata_line_item_nr_return_tracking_uri']; + } + + /** + * Sets openinvoicedata_line_item_nr_return_tracking_uri + * + * @param string|null $openinvoicedata_line_item_nr_return_tracking_uri URI where the customer can track the return of their shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrReturnTrackingUri($openinvoicedata_line_item_nr_return_tracking_uri) + { + if (is_null($openinvoicedata_line_item_nr_return_tracking_uri)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_return_tracking_uri cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_return_tracking_uri'] = $openinvoicedata_line_item_nr_return_tracking_uri; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_shipping_company + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrShippingCompany() + { + return $this->container['openinvoicedata_line_item_nr_shipping_company']; + } + + /** + * Sets openinvoicedata_line_item_nr_shipping_company + * + * @param string|null $openinvoicedata_line_item_nr_shipping_company Name of the shipping company handling the delivery. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrShippingCompany($openinvoicedata_line_item_nr_shipping_company) + { + if (is_null($openinvoicedata_line_item_nr_shipping_company)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_shipping_company cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_shipping_company'] = $openinvoicedata_line_item_nr_shipping_company; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_shipping_method + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrShippingMethod() + { + return $this->container['openinvoicedata_line_item_nr_shipping_method']; + } + + /** + * Sets openinvoicedata_line_item_nr_shipping_method + * + * @param string|null $openinvoicedata_line_item_nr_shipping_method Shipping method. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrShippingMethod($openinvoicedata_line_item_nr_shipping_method) + { + if (is_null($openinvoicedata_line_item_nr_shipping_method)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_shipping_method cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_shipping_method'] = $openinvoicedata_line_item_nr_shipping_method; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_tracking_number + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrTrackingNumber() + { + return $this->container['openinvoicedata_line_item_nr_tracking_number']; + } + + /** + * Sets openinvoicedata_line_item_nr_tracking_number + * + * @param string|null $openinvoicedata_line_item_nr_tracking_number The tracking number for the shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrTrackingNumber($openinvoicedata_line_item_nr_tracking_number) + { + if (is_null($openinvoicedata_line_item_nr_tracking_number)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_tracking_number cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_tracking_number'] = $openinvoicedata_line_item_nr_tracking_number; + + return $this; + } + + /** + * Gets openinvoicedata_line_item_nr_tracking_uri + * + * @return string|null + */ + public function getOpeninvoicedataLineItemNrTrackingUri() + { + return $this->container['openinvoicedata_line_item_nr_tracking_uri']; + } + + /** + * Sets openinvoicedata_line_item_nr_tracking_uri + * + * @param string|null $openinvoicedata_line_item_nr_tracking_uri URI where the customer can track their shipment. + * + * @return self + */ + public function setOpeninvoicedataLineItemNrTrackingUri($openinvoicedata_line_item_nr_tracking_uri) + { + if (is_null($openinvoicedata_line_item_nr_tracking_uri)) { + throw new \InvalidArgumentException('non-nullable openinvoicedata_line_item_nr_tracking_uri cannot be null'); + } + $this->container['openinvoicedata_line_item_nr_tracking_uri'] = $openinvoicedata_line_item_nr_tracking_uri; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataOpi.php b/src/Adyen/Model/Payments/AdditionalDataOpi.php new file mode 100644 index 000000000..d598e4105 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataOpi.php @@ -0,0 +1,385 @@ + + */ +class AdditionalDataOpi implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataOpi'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'opi_include_trans_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'opi_include_trans_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'opi_include_trans_token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'opi_include_trans_token' => 'opi.includeTransToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'opi_include_trans_token' => 'setOpiIncludeTransToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'opi_include_trans_token' => 'getOpiIncludeTransToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('opi_include_trans_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets opi_include_trans_token + * + * @return string|null + */ + public function getOpiIncludeTransToken() + { + return $this->container['opi_include_trans_token']; + } + + /** + * Sets opi_include_trans_token + * + * @param string|null $opi_include_trans_token Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + * + * @return self + */ + public function setOpiIncludeTransToken($opi_include_trans_token) + { + if (is_null($opi_include_trans_token)) { + throw new \InvalidArgumentException('non-nullable opi_include_trans_token cannot be null'); + } + $this->container['opi_include_trans_token'] = $opi_include_trans_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataRatepay.php b/src/Adyen/Model/Payments/AdditionalDataRatepay.php new file mode 100644 index 000000000..fc5e473f0 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataRatepay.php @@ -0,0 +1,623 @@ + + */ +class AdditionalDataRatepay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRatepay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ratepay_installment_amount' => 'string', + 'ratepay_interest_rate' => 'string', + 'ratepay_last_installment_amount' => 'string', + 'ratepay_payment_firstday' => 'string', + 'ratepaydata_delivery_date' => 'string', + 'ratepaydata_due_date' => 'string', + 'ratepaydata_invoice_date' => 'string', + 'ratepaydata_invoice_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ratepay_installment_amount' => null, + 'ratepay_interest_rate' => null, + 'ratepay_last_installment_amount' => null, + 'ratepay_payment_firstday' => null, + 'ratepaydata_delivery_date' => null, + 'ratepaydata_due_date' => null, + 'ratepaydata_invoice_date' => null, + 'ratepaydata_invoice_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'ratepay_installment_amount' => false, + 'ratepay_interest_rate' => false, + 'ratepay_last_installment_amount' => false, + 'ratepay_payment_firstday' => false, + 'ratepaydata_delivery_date' => false, + 'ratepaydata_due_date' => false, + 'ratepaydata_invoice_date' => false, + 'ratepaydata_invoice_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ratepay_installment_amount' => 'ratepay.installmentAmount', + 'ratepay_interest_rate' => 'ratepay.interestRate', + 'ratepay_last_installment_amount' => 'ratepay.lastInstallmentAmount', + 'ratepay_payment_firstday' => 'ratepay.paymentFirstday', + 'ratepaydata_delivery_date' => 'ratepaydata.deliveryDate', + 'ratepaydata_due_date' => 'ratepaydata.dueDate', + 'ratepaydata_invoice_date' => 'ratepaydata.invoiceDate', + 'ratepaydata_invoice_id' => 'ratepaydata.invoiceId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ratepay_installment_amount' => 'setRatepayInstallmentAmount', + 'ratepay_interest_rate' => 'setRatepayInterestRate', + 'ratepay_last_installment_amount' => 'setRatepayLastInstallmentAmount', + 'ratepay_payment_firstday' => 'setRatepayPaymentFirstday', + 'ratepaydata_delivery_date' => 'setRatepaydataDeliveryDate', + 'ratepaydata_due_date' => 'setRatepaydataDueDate', + 'ratepaydata_invoice_date' => 'setRatepaydataInvoiceDate', + 'ratepaydata_invoice_id' => 'setRatepaydataInvoiceId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ratepay_installment_amount' => 'getRatepayInstallmentAmount', + 'ratepay_interest_rate' => 'getRatepayInterestRate', + 'ratepay_last_installment_amount' => 'getRatepayLastInstallmentAmount', + 'ratepay_payment_firstday' => 'getRatepayPaymentFirstday', + 'ratepaydata_delivery_date' => 'getRatepaydataDeliveryDate', + 'ratepaydata_due_date' => 'getRatepaydataDueDate', + 'ratepaydata_invoice_date' => 'getRatepaydataInvoiceDate', + 'ratepaydata_invoice_id' => 'getRatepaydataInvoiceId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ratepay_installment_amount', $data ?? [], null); + $this->setIfExists('ratepay_interest_rate', $data ?? [], null); + $this->setIfExists('ratepay_last_installment_amount', $data ?? [], null); + $this->setIfExists('ratepay_payment_firstday', $data ?? [], null); + $this->setIfExists('ratepaydata_delivery_date', $data ?? [], null); + $this->setIfExists('ratepaydata_due_date', $data ?? [], null); + $this->setIfExists('ratepaydata_invoice_date', $data ?? [], null); + $this->setIfExists('ratepaydata_invoice_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ratepay_installment_amount + * + * @return string|null + */ + public function getRatepayInstallmentAmount() + { + return $this->container['ratepay_installment_amount']; + } + + /** + * Sets ratepay_installment_amount + * + * @param string|null $ratepay_installment_amount Amount the customer has to pay each month. + * + * @return self + */ + public function setRatepayInstallmentAmount($ratepay_installment_amount) + { + if (is_null($ratepay_installment_amount)) { + throw new \InvalidArgumentException('non-nullable ratepay_installment_amount cannot be null'); + } + $this->container['ratepay_installment_amount'] = $ratepay_installment_amount; + + return $this; + } + + /** + * Gets ratepay_interest_rate + * + * @return string|null + */ + public function getRatepayInterestRate() + { + return $this->container['ratepay_interest_rate']; + } + + /** + * Sets ratepay_interest_rate + * + * @param string|null $ratepay_interest_rate Interest rate of this installment. + * + * @return self + */ + public function setRatepayInterestRate($ratepay_interest_rate) + { + if (is_null($ratepay_interest_rate)) { + throw new \InvalidArgumentException('non-nullable ratepay_interest_rate cannot be null'); + } + $this->container['ratepay_interest_rate'] = $ratepay_interest_rate; + + return $this; + } + + /** + * Gets ratepay_last_installment_amount + * + * @return string|null + */ + public function getRatepayLastInstallmentAmount() + { + return $this->container['ratepay_last_installment_amount']; + } + + /** + * Sets ratepay_last_installment_amount + * + * @param string|null $ratepay_last_installment_amount Amount of the last installment. + * + * @return self + */ + public function setRatepayLastInstallmentAmount($ratepay_last_installment_amount) + { + if (is_null($ratepay_last_installment_amount)) { + throw new \InvalidArgumentException('non-nullable ratepay_last_installment_amount cannot be null'); + } + $this->container['ratepay_last_installment_amount'] = $ratepay_last_installment_amount; + + return $this; + } + + /** + * Gets ratepay_payment_firstday + * + * @return string|null + */ + public function getRatepayPaymentFirstday() + { + return $this->container['ratepay_payment_firstday']; + } + + /** + * Sets ratepay_payment_firstday + * + * @param string|null $ratepay_payment_firstday Calendar day of the first payment. + * + * @return self + */ + public function setRatepayPaymentFirstday($ratepay_payment_firstday) + { + if (is_null($ratepay_payment_firstday)) { + throw new \InvalidArgumentException('non-nullable ratepay_payment_firstday cannot be null'); + } + $this->container['ratepay_payment_firstday'] = $ratepay_payment_firstday; + + return $this; + } + + /** + * Gets ratepaydata_delivery_date + * + * @return string|null + */ + public function getRatepaydataDeliveryDate() + { + return $this->container['ratepaydata_delivery_date']; + } + + /** + * Sets ratepaydata_delivery_date + * + * @param string|null $ratepaydata_delivery_date Date the merchant delivered the goods to the customer. + * + * @return self + */ + public function setRatepaydataDeliveryDate($ratepaydata_delivery_date) + { + if (is_null($ratepaydata_delivery_date)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_delivery_date cannot be null'); + } + $this->container['ratepaydata_delivery_date'] = $ratepaydata_delivery_date; + + return $this; + } + + /** + * Gets ratepaydata_due_date + * + * @return string|null + */ + public function getRatepaydataDueDate() + { + return $this->container['ratepaydata_due_date']; + } + + /** + * Sets ratepaydata_due_date + * + * @param string|null $ratepaydata_due_date Date by which the customer must settle the payment. + * + * @return self + */ + public function setRatepaydataDueDate($ratepaydata_due_date) + { + if (is_null($ratepaydata_due_date)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_due_date cannot be null'); + } + $this->container['ratepaydata_due_date'] = $ratepaydata_due_date; + + return $this; + } + + /** + * Gets ratepaydata_invoice_date + * + * @return string|null + */ + public function getRatepaydataInvoiceDate() + { + return $this->container['ratepaydata_invoice_date']; + } + + /** + * Sets ratepaydata_invoice_date + * + * @param string|null $ratepaydata_invoice_date Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. + * + * @return self + */ + public function setRatepaydataInvoiceDate($ratepaydata_invoice_date) + { + if (is_null($ratepaydata_invoice_date)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_invoice_date cannot be null'); + } + $this->container['ratepaydata_invoice_date'] = $ratepaydata_invoice_date; + + return $this; + } + + /** + * Gets ratepaydata_invoice_id + * + * @return string|null + */ + public function getRatepaydataInvoiceId() + { + return $this->container['ratepaydata_invoice_id']; + } + + /** + * Sets ratepaydata_invoice_id + * + * @param string|null $ratepaydata_invoice_id Identification name or number for the invoice, defined by the merchant. + * + * @return self + */ + public function setRatepaydataInvoiceId($ratepaydata_invoice_id) + { + if (is_null($ratepaydata_invoice_id)) { + throw new \InvalidArgumentException('non-nullable ratepaydata_invoice_id cannot be null'); + } + $this->container['ratepaydata_invoice_id'] = $ratepaydata_invoice_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataRetry.php b/src/Adyen/Model/Payments/AdditionalDataRetry.php new file mode 100644 index 000000000..eece700ee --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataRetry.php @@ -0,0 +1,453 @@ + + */ +class AdditionalDataRetry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRetry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'retry_chain_attempt_number' => 'string', + 'retry_order_attempt_number' => 'string', + 'retry_skip_retry' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'retry_chain_attempt_number' => null, + 'retry_order_attempt_number' => null, + 'retry_skip_retry' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'retry_chain_attempt_number' => false, + 'retry_order_attempt_number' => false, + 'retry_skip_retry' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'retry_chain_attempt_number' => 'retry.chainAttemptNumber', + 'retry_order_attempt_number' => 'retry.orderAttemptNumber', + 'retry_skip_retry' => 'retry.skipRetry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'retry_chain_attempt_number' => 'setRetryChainAttemptNumber', + 'retry_order_attempt_number' => 'setRetryOrderAttemptNumber', + 'retry_skip_retry' => 'setRetrySkipRetry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'retry_chain_attempt_number' => 'getRetryChainAttemptNumber', + 'retry_order_attempt_number' => 'getRetryOrderAttemptNumber', + 'retry_skip_retry' => 'getRetrySkipRetry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('retry_chain_attempt_number', $data ?? [], null); + $this->setIfExists('retry_order_attempt_number', $data ?? [], null); + $this->setIfExists('retry_skip_retry', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets retry_chain_attempt_number + * + * @return string|null + */ + public function getRetryChainAttemptNumber() + { + return $this->container['retry_chain_attempt_number']; + } + + /** + * Sets retry_chain_attempt_number + * + * @param string|null $retry_chain_attempt_number The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + * + * @return self + */ + public function setRetryChainAttemptNumber($retry_chain_attempt_number) + { + if (is_null($retry_chain_attempt_number)) { + throw new \InvalidArgumentException('non-nullable retry_chain_attempt_number cannot be null'); + } + $this->container['retry_chain_attempt_number'] = $retry_chain_attempt_number; + + return $this; + } + + /** + * Gets retry_order_attempt_number + * + * @return string|null + */ + public function getRetryOrderAttemptNumber() + { + return $this->container['retry_order_attempt_number']; + } + + /** + * Sets retry_order_attempt_number + * + * @param string|null $retry_order_attempt_number The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + * + * @return self + */ + public function setRetryOrderAttemptNumber($retry_order_attempt_number) + { + if (is_null($retry_order_attempt_number)) { + throw new \InvalidArgumentException('non-nullable retry_order_attempt_number cannot be null'); + } + $this->container['retry_order_attempt_number'] = $retry_order_attempt_number; + + return $this; + } + + /** + * Gets retry_skip_retry + * + * @return string|null + */ + public function getRetrySkipRetry() + { + return $this->container['retry_skip_retry']; + } + + /** + * Sets retry_skip_retry + * + * @param string|null $retry_skip_retry The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + * + * @return self + */ + public function setRetrySkipRetry($retry_skip_retry) + { + if (is_null($retry_skip_retry)) { + throw new \InvalidArgumentException('non-nullable retry_skip_retry cannot be null'); + } + $this->container['retry_skip_retry'] = $retry_skip_retry; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataRisk.php b/src/Adyen/Model/Payments/AdditionalDataRisk.php new file mode 100644 index 000000000..8782ec051 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataRisk.php @@ -0,0 +1,1065 @@ + + */ +class AdditionalDataRisk implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRisk'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'riskdata__custom_field_name' => 'string', + 'riskdata_basket_item_item_nr_amount_per_item' => 'string', + 'riskdata_basket_item_item_nr_brand' => 'string', + 'riskdata_basket_item_item_nr_category' => 'string', + 'riskdata_basket_item_item_nr_color' => 'string', + 'riskdata_basket_item_item_nr_currency' => 'string', + 'riskdata_basket_item_item_nr_item_id' => 'string', + 'riskdata_basket_item_item_nr_manufacturer' => 'string', + 'riskdata_basket_item_item_nr_product_title' => 'string', + 'riskdata_basket_item_item_nr_quantity' => 'string', + 'riskdata_basket_item_item_nr_receiver_email' => 'string', + 'riskdata_basket_item_item_nr_size' => 'string', + 'riskdata_basket_item_item_nr_sku' => 'string', + 'riskdata_basket_item_item_nr_upc' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'string', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'string', + 'riskdata_risk_profile_reference' => 'string', + 'riskdata_skip_risk' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'riskdata__custom_field_name' => null, + 'riskdata_basket_item_item_nr_amount_per_item' => null, + 'riskdata_basket_item_item_nr_brand' => null, + 'riskdata_basket_item_item_nr_category' => null, + 'riskdata_basket_item_item_nr_color' => null, + 'riskdata_basket_item_item_nr_currency' => null, + 'riskdata_basket_item_item_nr_item_id' => null, + 'riskdata_basket_item_item_nr_manufacturer' => null, + 'riskdata_basket_item_item_nr_product_title' => null, + 'riskdata_basket_item_item_nr_quantity' => null, + 'riskdata_basket_item_item_nr_receiver_email' => null, + 'riskdata_basket_item_item_nr_size' => null, + 'riskdata_basket_item_item_nr_sku' => null, + 'riskdata_basket_item_item_nr_upc' => null, + 'riskdata_promotions_promotion_item_nr_promotion_code' => null, + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => null, + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => null, + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => null, + 'riskdata_promotions_promotion_item_nr_promotion_name' => null, + 'riskdata_risk_profile_reference' => null, + 'riskdata_skip_risk' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'riskdata__custom_field_name' => false, + 'riskdata_basket_item_item_nr_amount_per_item' => false, + 'riskdata_basket_item_item_nr_brand' => false, + 'riskdata_basket_item_item_nr_category' => false, + 'riskdata_basket_item_item_nr_color' => false, + 'riskdata_basket_item_item_nr_currency' => false, + 'riskdata_basket_item_item_nr_item_id' => false, + 'riskdata_basket_item_item_nr_manufacturer' => false, + 'riskdata_basket_item_item_nr_product_title' => false, + 'riskdata_basket_item_item_nr_quantity' => false, + 'riskdata_basket_item_item_nr_receiver_email' => false, + 'riskdata_basket_item_item_nr_size' => false, + 'riskdata_basket_item_item_nr_sku' => false, + 'riskdata_basket_item_item_nr_upc' => false, + 'riskdata_promotions_promotion_item_nr_promotion_code' => false, + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => false, + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => false, + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => false, + 'riskdata_promotions_promotion_item_nr_promotion_name' => false, + 'riskdata_risk_profile_reference' => false, + 'riskdata_skip_risk' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'riskdata__custom_field_name' => 'riskdata.[customFieldName]', + 'riskdata_basket_item_item_nr_amount_per_item' => 'riskdata.basket.item[itemNr].amountPerItem', + 'riskdata_basket_item_item_nr_brand' => 'riskdata.basket.item[itemNr].brand', + 'riskdata_basket_item_item_nr_category' => 'riskdata.basket.item[itemNr].category', + 'riskdata_basket_item_item_nr_color' => 'riskdata.basket.item[itemNr].color', + 'riskdata_basket_item_item_nr_currency' => 'riskdata.basket.item[itemNr].currency', + 'riskdata_basket_item_item_nr_item_id' => 'riskdata.basket.item[itemNr].itemID', + 'riskdata_basket_item_item_nr_manufacturer' => 'riskdata.basket.item[itemNr].manufacturer', + 'riskdata_basket_item_item_nr_product_title' => 'riskdata.basket.item[itemNr].productTitle', + 'riskdata_basket_item_item_nr_quantity' => 'riskdata.basket.item[itemNr].quantity', + 'riskdata_basket_item_item_nr_receiver_email' => 'riskdata.basket.item[itemNr].receiverEmail', + 'riskdata_basket_item_item_nr_size' => 'riskdata.basket.item[itemNr].size', + 'riskdata_basket_item_item_nr_sku' => 'riskdata.basket.item[itemNr].sku', + 'riskdata_basket_item_item_nr_upc' => 'riskdata.basket.item[itemNr].upc', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'riskdata.promotions.promotion[itemNr].promotionCode', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'riskdata.promotions.promotion[itemNr].promotionDiscountAmount', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'riskdata.promotions.promotion[itemNr].promotionDiscountCurrency', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'riskdata.promotions.promotion[itemNr].promotionDiscountPercentage', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'riskdata.promotions.promotion[itemNr].promotionName', + 'riskdata_risk_profile_reference' => 'riskdata.riskProfileReference', + 'riskdata_skip_risk' => 'riskdata.skipRisk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'riskdata__custom_field_name' => 'setRiskdataCustomFieldName', + 'riskdata_basket_item_item_nr_amount_per_item' => 'setRiskdataBasketItemItemNrAmountPerItem', + 'riskdata_basket_item_item_nr_brand' => 'setRiskdataBasketItemItemNrBrand', + 'riskdata_basket_item_item_nr_category' => 'setRiskdataBasketItemItemNrCategory', + 'riskdata_basket_item_item_nr_color' => 'setRiskdataBasketItemItemNrColor', + 'riskdata_basket_item_item_nr_currency' => 'setRiskdataBasketItemItemNrCurrency', + 'riskdata_basket_item_item_nr_item_id' => 'setRiskdataBasketItemItemNrItemId', + 'riskdata_basket_item_item_nr_manufacturer' => 'setRiskdataBasketItemItemNrManufacturer', + 'riskdata_basket_item_item_nr_product_title' => 'setRiskdataBasketItemItemNrProductTitle', + 'riskdata_basket_item_item_nr_quantity' => 'setRiskdataBasketItemItemNrQuantity', + 'riskdata_basket_item_item_nr_receiver_email' => 'setRiskdataBasketItemItemNrReceiverEmail', + 'riskdata_basket_item_item_nr_size' => 'setRiskdataBasketItemItemNrSize', + 'riskdata_basket_item_item_nr_sku' => 'setRiskdataBasketItemItemNrSku', + 'riskdata_basket_item_item_nr_upc' => 'setRiskdataBasketItemItemNrUpc', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'setRiskdataPromotionsPromotionItemNrPromotionCode', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'setRiskdataPromotionsPromotionItemNrPromotionName', + 'riskdata_risk_profile_reference' => 'setRiskdataRiskProfileReference', + 'riskdata_skip_risk' => 'setRiskdataSkipRisk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'riskdata__custom_field_name' => 'getRiskdataCustomFieldName', + 'riskdata_basket_item_item_nr_amount_per_item' => 'getRiskdataBasketItemItemNrAmountPerItem', + 'riskdata_basket_item_item_nr_brand' => 'getRiskdataBasketItemItemNrBrand', + 'riskdata_basket_item_item_nr_category' => 'getRiskdataBasketItemItemNrCategory', + 'riskdata_basket_item_item_nr_color' => 'getRiskdataBasketItemItemNrColor', + 'riskdata_basket_item_item_nr_currency' => 'getRiskdataBasketItemItemNrCurrency', + 'riskdata_basket_item_item_nr_item_id' => 'getRiskdataBasketItemItemNrItemId', + 'riskdata_basket_item_item_nr_manufacturer' => 'getRiskdataBasketItemItemNrManufacturer', + 'riskdata_basket_item_item_nr_product_title' => 'getRiskdataBasketItemItemNrProductTitle', + 'riskdata_basket_item_item_nr_quantity' => 'getRiskdataBasketItemItemNrQuantity', + 'riskdata_basket_item_item_nr_receiver_email' => 'getRiskdataBasketItemItemNrReceiverEmail', + 'riskdata_basket_item_item_nr_size' => 'getRiskdataBasketItemItemNrSize', + 'riskdata_basket_item_item_nr_sku' => 'getRiskdataBasketItemItemNrSku', + 'riskdata_basket_item_item_nr_upc' => 'getRiskdataBasketItemItemNrUpc', + 'riskdata_promotions_promotion_item_nr_promotion_code' => 'getRiskdataPromotionsPromotionItemNrPromotionCode', + 'riskdata_promotions_promotion_item_nr_promotion_discount_amount' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountAmount', + 'riskdata_promotions_promotion_item_nr_promotion_discount_currency' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency', + 'riskdata_promotions_promotion_item_nr_promotion_discount_percentage' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage', + 'riskdata_promotions_promotion_item_nr_promotion_name' => 'getRiskdataPromotionsPromotionItemNrPromotionName', + 'riskdata_risk_profile_reference' => 'getRiskdataRiskProfileReference', + 'riskdata_skip_risk' => 'getRiskdataSkipRisk' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('riskdata__custom_field_name', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_amount_per_item', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_brand', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_category', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_color', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_currency', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_item_id', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_manufacturer', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_product_title', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_quantity', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_receiver_email', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_size', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_sku', $data ?? [], null); + $this->setIfExists('riskdata_basket_item_item_nr_upc', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_code', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_discount_amount', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_discount_currency', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_discount_percentage', $data ?? [], null); + $this->setIfExists('riskdata_promotions_promotion_item_nr_promotion_name', $data ?? [], null); + $this->setIfExists('riskdata_risk_profile_reference', $data ?? [], null); + $this->setIfExists('riskdata_skip_risk', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets riskdata__custom_field_name + * + * @return string|null + */ + public function getRiskdataCustomFieldName() + { + return $this->container['riskdata__custom_field_name']; + } + + /** + * Sets riskdata__custom_field_name + * + * @param string|null $riskdata__custom_field_name The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). + * + * @return self + */ + public function setRiskdataCustomFieldName($riskdata__custom_field_name) + { + if (is_null($riskdata__custom_field_name)) { + throw new \InvalidArgumentException('non-nullable riskdata__custom_field_name cannot be null'); + } + $this->container['riskdata__custom_field_name'] = $riskdata__custom_field_name; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_amount_per_item + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrAmountPerItem() + { + return $this->container['riskdata_basket_item_item_nr_amount_per_item']; + } + + /** + * Sets riskdata_basket_item_item_nr_amount_per_item + * + * @param string|null $riskdata_basket_item_item_nr_amount_per_item The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setRiskdataBasketItemItemNrAmountPerItem($riskdata_basket_item_item_nr_amount_per_item) + { + if (is_null($riskdata_basket_item_item_nr_amount_per_item)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_amount_per_item cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_amount_per_item'] = $riskdata_basket_item_item_nr_amount_per_item; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_brand + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrBrand() + { + return $this->container['riskdata_basket_item_item_nr_brand']; + } + + /** + * Sets riskdata_basket_item_item_nr_brand + * + * @param string|null $riskdata_basket_item_item_nr_brand Brand of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrBrand($riskdata_basket_item_item_nr_brand) + { + if (is_null($riskdata_basket_item_item_nr_brand)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_brand cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_brand'] = $riskdata_basket_item_item_nr_brand; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_category + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrCategory() + { + return $this->container['riskdata_basket_item_item_nr_category']; + } + + /** + * Sets riskdata_basket_item_item_nr_category + * + * @param string|null $riskdata_basket_item_item_nr_category Category of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrCategory($riskdata_basket_item_item_nr_category) + { + if (is_null($riskdata_basket_item_item_nr_category)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_category cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_category'] = $riskdata_basket_item_item_nr_category; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_color + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrColor() + { + return $this->container['riskdata_basket_item_item_nr_color']; + } + + /** + * Sets riskdata_basket_item_item_nr_color + * + * @param string|null $riskdata_basket_item_item_nr_color Color of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrColor($riskdata_basket_item_item_nr_color) + { + if (is_null($riskdata_basket_item_item_nr_color)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_color cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_color'] = $riskdata_basket_item_item_nr_color; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_currency + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrCurrency() + { + return $this->container['riskdata_basket_item_item_nr_currency']; + } + + /** + * Sets riskdata_basket_item_item_nr_currency + * + * @param string|null $riskdata_basket_item_item_nr_currency The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + * + * @return self + */ + public function setRiskdataBasketItemItemNrCurrency($riskdata_basket_item_item_nr_currency) + { + if (is_null($riskdata_basket_item_item_nr_currency)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_currency cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_currency'] = $riskdata_basket_item_item_nr_currency; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_item_id + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrItemId() + { + return $this->container['riskdata_basket_item_item_nr_item_id']; + } + + /** + * Sets riskdata_basket_item_item_nr_item_id + * + * @param string|null $riskdata_basket_item_item_nr_item_id ID of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrItemId($riskdata_basket_item_item_nr_item_id) + { + if (is_null($riskdata_basket_item_item_nr_item_id)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_item_id cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_item_id'] = $riskdata_basket_item_item_nr_item_id; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_manufacturer + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrManufacturer() + { + return $this->container['riskdata_basket_item_item_nr_manufacturer']; + } + + /** + * Sets riskdata_basket_item_item_nr_manufacturer + * + * @param string|null $riskdata_basket_item_item_nr_manufacturer Manufacturer of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrManufacturer($riskdata_basket_item_item_nr_manufacturer) + { + if (is_null($riskdata_basket_item_item_nr_manufacturer)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_manufacturer cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_manufacturer'] = $riskdata_basket_item_item_nr_manufacturer; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_product_title + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrProductTitle() + { + return $this->container['riskdata_basket_item_item_nr_product_title']; + } + + /** + * Sets riskdata_basket_item_item_nr_product_title + * + * @param string|null $riskdata_basket_item_item_nr_product_title A text description of the product the invoice line refers to. + * + * @return self + */ + public function setRiskdataBasketItemItemNrProductTitle($riskdata_basket_item_item_nr_product_title) + { + if (is_null($riskdata_basket_item_item_nr_product_title)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_product_title cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_product_title'] = $riskdata_basket_item_item_nr_product_title; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_quantity + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrQuantity() + { + return $this->container['riskdata_basket_item_item_nr_quantity']; + } + + /** + * Sets riskdata_basket_item_item_nr_quantity + * + * @param string|null $riskdata_basket_item_item_nr_quantity Quantity of the item purchased. + * + * @return self + */ + public function setRiskdataBasketItemItemNrQuantity($riskdata_basket_item_item_nr_quantity) + { + if (is_null($riskdata_basket_item_item_nr_quantity)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_quantity cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_quantity'] = $riskdata_basket_item_item_nr_quantity; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_receiver_email + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrReceiverEmail() + { + return $this->container['riskdata_basket_item_item_nr_receiver_email']; + } + + /** + * Sets riskdata_basket_item_item_nr_receiver_email + * + * @param string|null $riskdata_basket_item_item_nr_receiver_email Email associated with the given product in the basket (usually in electronic gift cards). + * + * @return self + */ + public function setRiskdataBasketItemItemNrReceiverEmail($riskdata_basket_item_item_nr_receiver_email) + { + if (is_null($riskdata_basket_item_item_nr_receiver_email)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_receiver_email cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_receiver_email'] = $riskdata_basket_item_item_nr_receiver_email; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_size + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrSize() + { + return $this->container['riskdata_basket_item_item_nr_size']; + } + + /** + * Sets riskdata_basket_item_item_nr_size + * + * @param string|null $riskdata_basket_item_item_nr_size Size of the item. + * + * @return self + */ + public function setRiskdataBasketItemItemNrSize($riskdata_basket_item_item_nr_size) + { + if (is_null($riskdata_basket_item_item_nr_size)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_size cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_size'] = $riskdata_basket_item_item_nr_size; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_sku + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrSku() + { + return $this->container['riskdata_basket_item_item_nr_sku']; + } + + /** + * Sets riskdata_basket_item_item_nr_sku + * + * @param string|null $riskdata_basket_item_item_nr_sku [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). + * + * @return self + */ + public function setRiskdataBasketItemItemNrSku($riskdata_basket_item_item_nr_sku) + { + if (is_null($riskdata_basket_item_item_nr_sku)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_sku cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_sku'] = $riskdata_basket_item_item_nr_sku; + + return $this; + } + + /** + * Gets riskdata_basket_item_item_nr_upc + * + * @return string|null + */ + public function getRiskdataBasketItemItemNrUpc() + { + return $this->container['riskdata_basket_item_item_nr_upc']; + } + + /** + * Sets riskdata_basket_item_item_nr_upc + * + * @param string|null $riskdata_basket_item_item_nr_upc [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). + * + * @return self + */ + public function setRiskdataBasketItemItemNrUpc($riskdata_basket_item_item_nr_upc) + { + if (is_null($riskdata_basket_item_item_nr_upc)) { + throw new \InvalidArgumentException('non-nullable riskdata_basket_item_item_nr_upc cannot be null'); + } + $this->container['riskdata_basket_item_item_nr_upc'] = $riskdata_basket_item_item_nr_upc; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_code + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionCode() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_code']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_code + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_code Code of the promotion. + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionCode($riskdata_promotions_promotion_item_nr_promotion_code) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_code)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_code cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_code'] = $riskdata_promotions_promotion_item_nr_promotion_code; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_discount_amount + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionDiscountAmount() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_amount']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_discount_amount + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_discount_amount The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount($riskdata_promotions_promotion_item_nr_promotion_discount_amount) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_discount_amount)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_discount_amount cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_amount'] = $riskdata_promotions_promotion_item_nr_promotion_discount_amount; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_discount_currency + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_currency']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_discount_currency + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_discount_currency The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency($riskdata_promotions_promotion_item_nr_promotion_discount_currency) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_discount_currency)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_discount_currency cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_currency'] = $riskdata_promotions_promotion_item_nr_promotion_discount_currency; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_discount_percentage + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_percentage']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_discount_percentage + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_discount_percentage Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage($riskdata_promotions_promotion_item_nr_promotion_discount_percentage) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_discount_percentage)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_discount_percentage cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_discount_percentage'] = $riskdata_promotions_promotion_item_nr_promotion_discount_percentage; + + return $this; + } + + /** + * Gets riskdata_promotions_promotion_item_nr_promotion_name + * + * @return string|null + */ + public function getRiskdataPromotionsPromotionItemNrPromotionName() + { + return $this->container['riskdata_promotions_promotion_item_nr_promotion_name']; + } + + /** + * Sets riskdata_promotions_promotion_item_nr_promotion_name + * + * @param string|null $riskdata_promotions_promotion_item_nr_promotion_name Name of the promotion. + * + * @return self + */ + public function setRiskdataPromotionsPromotionItemNrPromotionName($riskdata_promotions_promotion_item_nr_promotion_name) + { + if (is_null($riskdata_promotions_promotion_item_nr_promotion_name)) { + throw new \InvalidArgumentException('non-nullable riskdata_promotions_promotion_item_nr_promotion_name cannot be null'); + } + $this->container['riskdata_promotions_promotion_item_nr_promotion_name'] = $riskdata_promotions_promotion_item_nr_promotion_name; + + return $this; + } + + /** + * Gets riskdata_risk_profile_reference + * + * @return string|null + */ + public function getRiskdataRiskProfileReference() + { + return $this->container['riskdata_risk_profile_reference']; + } + + /** + * Sets riskdata_risk_profile_reference + * + * @param string|null $riskdata_risk_profile_reference Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). + * + * @return self + */ + public function setRiskdataRiskProfileReference($riskdata_risk_profile_reference) + { + if (is_null($riskdata_risk_profile_reference)) { + throw new \InvalidArgumentException('non-nullable riskdata_risk_profile_reference cannot be null'); + } + $this->container['riskdata_risk_profile_reference'] = $riskdata_risk_profile_reference; + + return $this; + } + + /** + * Gets riskdata_skip_risk + * + * @return string|null + */ + public function getRiskdataSkipRisk() + { + return $this->container['riskdata_skip_risk']; + } + + /** + * Sets riskdata_skip_risk + * + * @param string|null $riskdata_skip_risk If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. + * + * @return self + */ + public function setRiskdataSkipRisk($riskdata_skip_risk) + { + if (is_null($riskdata_skip_risk)) { + throw new \InvalidArgumentException('non-nullable riskdata_skip_risk cannot be null'); + } + $this->container['riskdata_skip_risk'] = $riskdata_skip_risk; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataRiskStandalone.php b/src/Adyen/Model/Payments/AdditionalDataRiskStandalone.php new file mode 100644 index 000000000..2cd68dd71 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataRiskStandalone.php @@ -0,0 +1,861 @@ + + */ +class AdditionalDataRiskStandalone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataRiskStandalone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pay_pal_country_code' => 'string', + 'pay_pal_email_id' => 'string', + 'pay_pal_first_name' => 'string', + 'pay_pal_last_name' => 'string', + 'pay_pal_payer_id' => 'string', + 'pay_pal_phone' => 'string', + 'pay_pal_protection_eligibility' => 'string', + 'pay_pal_transaction_id' => 'string', + 'avs_result_raw' => 'string', + 'bin' => 'string', + 'cvc_result_raw' => 'string', + 'risk_token' => 'string', + 'three_d_authenticated' => 'string', + 'three_d_offered' => 'string', + 'token_data_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pay_pal_country_code' => null, + 'pay_pal_email_id' => null, + 'pay_pal_first_name' => null, + 'pay_pal_last_name' => null, + 'pay_pal_payer_id' => null, + 'pay_pal_phone' => null, + 'pay_pal_protection_eligibility' => null, + 'pay_pal_transaction_id' => null, + 'avs_result_raw' => null, + 'bin' => null, + 'cvc_result_raw' => null, + 'risk_token' => null, + 'three_d_authenticated' => null, + 'three_d_offered' => null, + 'token_data_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'pay_pal_country_code' => false, + 'pay_pal_email_id' => false, + 'pay_pal_first_name' => false, + 'pay_pal_last_name' => false, + 'pay_pal_payer_id' => false, + 'pay_pal_phone' => false, + 'pay_pal_protection_eligibility' => false, + 'pay_pal_transaction_id' => false, + 'avs_result_raw' => false, + 'bin' => false, + 'cvc_result_raw' => false, + 'risk_token' => false, + 'three_d_authenticated' => false, + 'three_d_offered' => false, + 'token_data_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pay_pal_country_code' => 'PayPal.CountryCode', + 'pay_pal_email_id' => 'PayPal.EmailId', + 'pay_pal_first_name' => 'PayPal.FirstName', + 'pay_pal_last_name' => 'PayPal.LastName', + 'pay_pal_payer_id' => 'PayPal.PayerId', + 'pay_pal_phone' => 'PayPal.Phone', + 'pay_pal_protection_eligibility' => 'PayPal.ProtectionEligibility', + 'pay_pal_transaction_id' => 'PayPal.TransactionId', + 'avs_result_raw' => 'avsResultRaw', + 'bin' => 'bin', + 'cvc_result_raw' => 'cvcResultRaw', + 'risk_token' => 'riskToken', + 'three_d_authenticated' => 'threeDAuthenticated', + 'three_d_offered' => 'threeDOffered', + 'token_data_type' => 'tokenDataType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pay_pal_country_code' => 'setPayPalCountryCode', + 'pay_pal_email_id' => 'setPayPalEmailId', + 'pay_pal_first_name' => 'setPayPalFirstName', + 'pay_pal_last_name' => 'setPayPalLastName', + 'pay_pal_payer_id' => 'setPayPalPayerId', + 'pay_pal_phone' => 'setPayPalPhone', + 'pay_pal_protection_eligibility' => 'setPayPalProtectionEligibility', + 'pay_pal_transaction_id' => 'setPayPalTransactionId', + 'avs_result_raw' => 'setAvsResultRaw', + 'bin' => 'setBin', + 'cvc_result_raw' => 'setCvcResultRaw', + 'risk_token' => 'setRiskToken', + 'three_d_authenticated' => 'setThreeDAuthenticated', + 'three_d_offered' => 'setThreeDOffered', + 'token_data_type' => 'setTokenDataType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pay_pal_country_code' => 'getPayPalCountryCode', + 'pay_pal_email_id' => 'getPayPalEmailId', + 'pay_pal_first_name' => 'getPayPalFirstName', + 'pay_pal_last_name' => 'getPayPalLastName', + 'pay_pal_payer_id' => 'getPayPalPayerId', + 'pay_pal_phone' => 'getPayPalPhone', + 'pay_pal_protection_eligibility' => 'getPayPalProtectionEligibility', + 'pay_pal_transaction_id' => 'getPayPalTransactionId', + 'avs_result_raw' => 'getAvsResultRaw', + 'bin' => 'getBin', + 'cvc_result_raw' => 'getCvcResultRaw', + 'risk_token' => 'getRiskToken', + 'three_d_authenticated' => 'getThreeDAuthenticated', + 'three_d_offered' => 'getThreeDOffered', + 'token_data_type' => 'getTokenDataType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('pay_pal_country_code', $data ?? [], null); + $this->setIfExists('pay_pal_email_id', $data ?? [], null); + $this->setIfExists('pay_pal_first_name', $data ?? [], null); + $this->setIfExists('pay_pal_last_name', $data ?? [], null); + $this->setIfExists('pay_pal_payer_id', $data ?? [], null); + $this->setIfExists('pay_pal_phone', $data ?? [], null); + $this->setIfExists('pay_pal_protection_eligibility', $data ?? [], null); + $this->setIfExists('pay_pal_transaction_id', $data ?? [], null); + $this->setIfExists('avs_result_raw', $data ?? [], null); + $this->setIfExists('bin', $data ?? [], null); + $this->setIfExists('cvc_result_raw', $data ?? [], null); + $this->setIfExists('risk_token', $data ?? [], null); + $this->setIfExists('three_d_authenticated', $data ?? [], null); + $this->setIfExists('three_d_offered', $data ?? [], null); + $this->setIfExists('token_data_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pay_pal_country_code + * + * @return string|null + */ + public function getPayPalCountryCode() + { + return $this->container['pay_pal_country_code']; + } + + /** + * Sets pay_pal_country_code + * + * @param string|null $pay_pal_country_code Shopper's country of residence in the form of ISO standard 3166 2-character country codes. + * + * @return self + */ + public function setPayPalCountryCode($pay_pal_country_code) + { + if (is_null($pay_pal_country_code)) { + throw new \InvalidArgumentException('non-nullable pay_pal_country_code cannot be null'); + } + $this->container['pay_pal_country_code'] = $pay_pal_country_code; + + return $this; + } + + /** + * Gets pay_pal_email_id + * + * @return string|null + */ + public function getPayPalEmailId() + { + return $this->container['pay_pal_email_id']; + } + + /** + * Sets pay_pal_email_id + * + * @param string|null $pay_pal_email_id Shopper's email. + * + * @return self + */ + public function setPayPalEmailId($pay_pal_email_id) + { + if (is_null($pay_pal_email_id)) { + throw new \InvalidArgumentException('non-nullable pay_pal_email_id cannot be null'); + } + $this->container['pay_pal_email_id'] = $pay_pal_email_id; + + return $this; + } + + /** + * Gets pay_pal_first_name + * + * @return string|null + */ + public function getPayPalFirstName() + { + return $this->container['pay_pal_first_name']; + } + + /** + * Sets pay_pal_first_name + * + * @param string|null $pay_pal_first_name Shopper's first name. + * + * @return self + */ + public function setPayPalFirstName($pay_pal_first_name) + { + if (is_null($pay_pal_first_name)) { + throw new \InvalidArgumentException('non-nullable pay_pal_first_name cannot be null'); + } + $this->container['pay_pal_first_name'] = $pay_pal_first_name; + + return $this; + } + + /** + * Gets pay_pal_last_name + * + * @return string|null + */ + public function getPayPalLastName() + { + return $this->container['pay_pal_last_name']; + } + + /** + * Sets pay_pal_last_name + * + * @param string|null $pay_pal_last_name Shopper's last name. + * + * @return self + */ + public function setPayPalLastName($pay_pal_last_name) + { + if (is_null($pay_pal_last_name)) { + throw new \InvalidArgumentException('non-nullable pay_pal_last_name cannot be null'); + } + $this->container['pay_pal_last_name'] = $pay_pal_last_name; + + return $this; + } + + /** + * Gets pay_pal_payer_id + * + * @return string|null + */ + public function getPayPalPayerId() + { + return $this->container['pay_pal_payer_id']; + } + + /** + * Sets pay_pal_payer_id + * + * @param string|null $pay_pal_payer_id Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. + * + * @return self + */ + public function setPayPalPayerId($pay_pal_payer_id) + { + if (is_null($pay_pal_payer_id)) { + throw new \InvalidArgumentException('non-nullable pay_pal_payer_id cannot be null'); + } + $this->container['pay_pal_payer_id'] = $pay_pal_payer_id; + + return $this; + } + + /** + * Gets pay_pal_phone + * + * @return string|null + */ + public function getPayPalPhone() + { + return $this->container['pay_pal_phone']; + } + + /** + * Sets pay_pal_phone + * + * @param string|null $pay_pal_phone Shopper's phone number. + * + * @return self + */ + public function setPayPalPhone($pay_pal_phone) + { + if (is_null($pay_pal_phone)) { + throw new \InvalidArgumentException('non-nullable pay_pal_phone cannot be null'); + } + $this->container['pay_pal_phone'] = $pay_pal_phone; + + return $this; + } + + /** + * Gets pay_pal_protection_eligibility + * + * @return string|null + */ + public function getPayPalProtectionEligibility() + { + return $this->container['pay_pal_protection_eligibility']; + } + + /** + * Sets pay_pal_protection_eligibility + * + * @param string|null $pay_pal_protection_eligibility Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. + * + * @return self + */ + public function setPayPalProtectionEligibility($pay_pal_protection_eligibility) + { + if (is_null($pay_pal_protection_eligibility)) { + throw new \InvalidArgumentException('non-nullable pay_pal_protection_eligibility cannot be null'); + } + $this->container['pay_pal_protection_eligibility'] = $pay_pal_protection_eligibility; + + return $this; + } + + /** + * Gets pay_pal_transaction_id + * + * @return string|null + */ + public function getPayPalTransactionId() + { + return $this->container['pay_pal_transaction_id']; + } + + /** + * Sets pay_pal_transaction_id + * + * @param string|null $pay_pal_transaction_id Unique transaction ID of the payment. + * + * @return self + */ + public function setPayPalTransactionId($pay_pal_transaction_id) + { + if (is_null($pay_pal_transaction_id)) { + throw new \InvalidArgumentException('non-nullable pay_pal_transaction_id cannot be null'); + } + $this->container['pay_pal_transaction_id'] = $pay_pal_transaction_id; + + return $this; + } + + /** + * Gets avs_result_raw + * + * @return string|null + */ + public function getAvsResultRaw() + { + return $this->container['avs_result_raw']; + } + + /** + * Sets avs_result_raw + * + * @param string|null $avs_result_raw Raw AVS result received from the acquirer, where available. Example: D + * + * @return self + */ + public function setAvsResultRaw($avs_result_raw) + { + if (is_null($avs_result_raw)) { + throw new \InvalidArgumentException('non-nullable avs_result_raw cannot be null'); + } + $this->container['avs_result_raw'] = $avs_result_raw; + + return $this; + } + + /** + * Gets bin + * + * @return string|null + */ + public function getBin() + { + return $this->container['bin']; + } + + /** + * Sets bin + * + * @param string|null $bin The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/risk-management/standalone-risk#tokenised-pan-request). + * + * @return self + */ + public function setBin($bin) + { + if (is_null($bin)) { + throw new \InvalidArgumentException('non-nullable bin cannot be null'); + } + $this->container['bin'] = $bin; + + return $this; + } + + /** + * Gets cvc_result_raw + * + * @return string|null + */ + public function getCvcResultRaw() + { + return $this->container['cvc_result_raw']; + } + + /** + * Sets cvc_result_raw + * + * @param string|null $cvc_result_raw Raw CVC result received from the acquirer, where available. Example: 1 + * + * @return self + */ + public function setCvcResultRaw($cvc_result_raw) + { + if (is_null($cvc_result_raw)) { + throw new \InvalidArgumentException('non-nullable cvc_result_raw cannot be null'); + } + $this->container['cvc_result_raw'] = $cvc_result_raw; + + return $this; + } + + /** + * Gets risk_token + * + * @return string|null + */ + public function getRiskToken() + { + return $this->container['risk_token']; + } + + /** + * Sets risk_token + * + * @param string|null $risk_token Unique identifier or token for the shopper's card details. + * + * @return self + */ + public function setRiskToken($risk_token) + { + if (is_null($risk_token)) { + throw new \InvalidArgumentException('non-nullable risk_token cannot be null'); + } + $this->container['risk_token'] = $risk_token; + + return $this; + } + + /** + * Gets three_d_authenticated + * + * @return string|null + */ + public function getThreeDAuthenticated() + { + return $this->container['three_d_authenticated']; + } + + /** + * Sets three_d_authenticated + * + * @param string|null $three_d_authenticated A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + * + * @return self + */ + public function setThreeDAuthenticated($three_d_authenticated) + { + if (is_null($three_d_authenticated)) { + throw new \InvalidArgumentException('non-nullable three_d_authenticated cannot be null'); + } + $this->container['three_d_authenticated'] = $three_d_authenticated; + + return $this; + } + + /** + * Gets three_d_offered + * + * @return string|null + */ + public function getThreeDOffered() + { + return $this->container['three_d_offered']; + } + + /** + * Sets three_d_offered + * + * @param string|null $three_d_offered A Boolean value indicating whether 3DS was offered for this payment. Example: true + * + * @return self + */ + public function setThreeDOffered($three_d_offered) + { + if (is_null($three_d_offered)) { + throw new \InvalidArgumentException('non-nullable three_d_offered cannot be null'); + } + $this->container['three_d_offered'] = $three_d_offered; + + return $this; + } + + /** + * Gets token_data_type + * + * @return string|null + */ + public function getTokenDataType() + { + return $this->container['token_data_type']; + } + + /** + * Sets token_data_type + * + * @param string|null $token_data_type Required for PayPal payments only. The only supported value is: **paypal**. + * + * @return self + */ + public function setTokenDataType($token_data_type) + { + if (is_null($token_data_type)) { + throw new \InvalidArgumentException('non-nullable token_data_type cannot be null'); + } + $this->container['token_data_type'] = $token_data_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataSubMerchant.php b/src/Adyen/Model/Payments/AdditionalDataSubMerchant.php new file mode 100644 index 000000000..d527226df --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataSubMerchant.php @@ -0,0 +1,691 @@ + + */ +class AdditionalDataSubMerchant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataSubMerchant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sub_merchant_number_of_sub_sellers' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'string', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sub_merchant_number_of_sub_sellers' => null, + 'sub_merchant_sub_seller_sub_seller_nr_city' => null, + 'sub_merchant_sub_seller_sub_seller_nr_country' => null, + 'sub_merchant_sub_seller_sub_seller_nr_id' => null, + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => null, + 'sub_merchant_sub_seller_sub_seller_nr_name' => null, + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => null, + 'sub_merchant_sub_seller_sub_seller_nr_state' => null, + 'sub_merchant_sub_seller_sub_seller_nr_street' => null, + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sub_merchant_number_of_sub_sellers' => false, + 'sub_merchant_sub_seller_sub_seller_nr_city' => false, + 'sub_merchant_sub_seller_sub_seller_nr_country' => false, + 'sub_merchant_sub_seller_sub_seller_nr_id' => false, + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => false, + 'sub_merchant_sub_seller_sub_seller_nr_name' => false, + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => false, + 'sub_merchant_sub_seller_sub_seller_nr_state' => false, + 'sub_merchant_sub_seller_sub_seller_nr_street' => false, + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sub_merchant_number_of_sub_sellers' => 'subMerchant.numberOfSubSellers', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'subMerchant.subSeller[subSellerNr].city', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'subMerchant.subSeller[subSellerNr].country', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'subMerchant.subSeller[subSellerNr].id', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'subMerchant.subSeller[subSellerNr].mcc', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'subMerchant.subSeller[subSellerNr].name', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'subMerchant.subSeller[subSellerNr].postalCode', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'subMerchant.subSeller[subSellerNr].state', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'subMerchant.subSeller[subSellerNr].street', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'subMerchant.subSeller[subSellerNr].taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sub_merchant_number_of_sub_sellers' => 'setSubMerchantNumberOfSubSellers', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'setSubMerchantSubSellerSubSellerNrCity', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'setSubMerchantSubSellerSubSellerNrCountry', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'setSubMerchantSubSellerSubSellerNrId', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'setSubMerchantSubSellerSubSellerNrMcc', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'setSubMerchantSubSellerSubSellerNrName', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'setSubMerchantSubSellerSubSellerNrPostalCode', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'setSubMerchantSubSellerSubSellerNrState', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'setSubMerchantSubSellerSubSellerNrStreet', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'setSubMerchantSubSellerSubSellerNrTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sub_merchant_number_of_sub_sellers' => 'getSubMerchantNumberOfSubSellers', + 'sub_merchant_sub_seller_sub_seller_nr_city' => 'getSubMerchantSubSellerSubSellerNrCity', + 'sub_merchant_sub_seller_sub_seller_nr_country' => 'getSubMerchantSubSellerSubSellerNrCountry', + 'sub_merchant_sub_seller_sub_seller_nr_id' => 'getSubMerchantSubSellerSubSellerNrId', + 'sub_merchant_sub_seller_sub_seller_nr_mcc' => 'getSubMerchantSubSellerSubSellerNrMcc', + 'sub_merchant_sub_seller_sub_seller_nr_name' => 'getSubMerchantSubSellerSubSellerNrName', + 'sub_merchant_sub_seller_sub_seller_nr_postal_code' => 'getSubMerchantSubSellerSubSellerNrPostalCode', + 'sub_merchant_sub_seller_sub_seller_nr_state' => 'getSubMerchantSubSellerSubSellerNrState', + 'sub_merchant_sub_seller_sub_seller_nr_street' => 'getSubMerchantSubSellerSubSellerNrStreet', + 'sub_merchant_sub_seller_sub_seller_nr_tax_id' => 'getSubMerchantSubSellerSubSellerNrTaxId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('sub_merchant_number_of_sub_sellers', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_city', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_country', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_id', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_mcc', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_name', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_postal_code', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_state', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_street', $data ?? [], null); + $this->setIfExists('sub_merchant_sub_seller_sub_seller_nr_tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sub_merchant_number_of_sub_sellers + * + * @return string|null + */ + public function getSubMerchantNumberOfSubSellers() + { + return $this->container['sub_merchant_number_of_sub_sellers']; + } + + /** + * Sets sub_merchant_number_of_sub_sellers + * + * @param string|null $sub_merchant_number_of_sub_sellers Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. + * + * @return self + */ + public function setSubMerchantNumberOfSubSellers($sub_merchant_number_of_sub_sellers) + { + if (is_null($sub_merchant_number_of_sub_sellers)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_number_of_sub_sellers cannot be null'); + } + $this->container['sub_merchant_number_of_sub_sellers'] = $sub_merchant_number_of_sub_sellers; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_city + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrCity() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_city']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_city + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_city Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrCity($sub_merchant_sub_seller_sub_seller_nr_city) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_city)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_city cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_city'] = $sub_merchant_sub_seller_sub_seller_nr_city; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_country + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrCountry() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_country']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_country + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_country Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrCountry($sub_merchant_sub_seller_sub_seller_nr_country) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_country)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_country cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_country'] = $sub_merchant_sub_seller_sub_seller_nr_country; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_id + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrId() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_id']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_id + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_id Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrId($sub_merchant_sub_seller_sub_seller_nr_id) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_id cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_id'] = $sub_merchant_sub_seller_sub_seller_nr_id; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_mcc + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrMcc() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_mcc']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_mcc + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_mcc Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrMcc($sub_merchant_sub_seller_sub_seller_nr_mcc) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_mcc)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_mcc cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_mcc'] = $sub_merchant_sub_seller_sub_seller_nr_mcc; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_name + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrName() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_name']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_name + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_name Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrName($sub_merchant_sub_seller_sub_seller_nr_name) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_name)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_name cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_name'] = $sub_merchant_sub_seller_sub_seller_nr_name; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_postal_code + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrPostalCode() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_postal_code']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_postal_code + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_postal_code Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrPostalCode($sub_merchant_sub_seller_sub_seller_nr_postal_code) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_postal_code)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_postal_code cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_postal_code'] = $sub_merchant_sub_seller_sub_seller_nr_postal_code; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_state + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrState() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_state']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_state + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_state Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrState($sub_merchant_sub_seller_sub_seller_nr_state) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_state)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_state cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_state'] = $sub_merchant_sub_seller_sub_seller_nr_state; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_street + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrStreet() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_street']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_street + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_street Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrStreet($sub_merchant_sub_seller_sub_seller_nr_street) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_street)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_street cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_street'] = $sub_merchant_sub_seller_sub_seller_nr_street; + + return $this; + } + + /** + * Gets sub_merchant_sub_seller_sub_seller_nr_tax_id + * + * @return string|null + */ + public function getSubMerchantSubSellerSubSellerNrTaxId() + { + return $this->container['sub_merchant_sub_seller_sub_seller_nr_tax_id']; + } + + /** + * Sets sub_merchant_sub_seller_sub_seller_nr_tax_id + * + * @param string|null $sub_merchant_sub_seller_sub_seller_nr_tax_id Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + * + * @return self + */ + public function setSubMerchantSubSellerSubSellerNrTaxId($sub_merchant_sub_seller_sub_seller_nr_tax_id) + { + if (is_null($sub_merchant_sub_seller_sub_seller_nr_tax_id)) { + throw new \InvalidArgumentException('non-nullable sub_merchant_sub_seller_sub_seller_nr_tax_id cannot be null'); + } + $this->container['sub_merchant_sub_seller_sub_seller_nr_tax_id'] = $sub_merchant_sub_seller_sub_seller_nr_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 + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php b/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php new file mode 100644 index 000000000..7b7b589e0 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataTemporaryServices.php @@ -0,0 +1,657 @@ + + */ +class AdditionalDataTemporaryServices implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataTemporaryServices'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enhanced_scheme_data_customer_reference' => 'string', + 'enhanced_scheme_data_employee_name' => 'string', + 'enhanced_scheme_data_job_description' => 'string', + 'enhanced_scheme_data_regular_hours_rate' => 'string', + 'enhanced_scheme_data_regular_hours_worked' => 'string', + 'enhanced_scheme_data_request_name' => 'string', + 'enhanced_scheme_data_temp_start_date' => 'string', + 'enhanced_scheme_data_temp_week_ending' => 'string', + 'enhanced_scheme_data_total_tax_amount' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enhanced_scheme_data_customer_reference' => null, + 'enhanced_scheme_data_employee_name' => null, + 'enhanced_scheme_data_job_description' => null, + 'enhanced_scheme_data_regular_hours_rate' => null, + 'enhanced_scheme_data_regular_hours_worked' => null, + 'enhanced_scheme_data_request_name' => null, + 'enhanced_scheme_data_temp_start_date' => null, + 'enhanced_scheme_data_temp_week_ending' => null, + 'enhanced_scheme_data_total_tax_amount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enhanced_scheme_data_customer_reference' => false, + 'enhanced_scheme_data_employee_name' => false, + 'enhanced_scheme_data_job_description' => false, + 'enhanced_scheme_data_regular_hours_rate' => false, + 'enhanced_scheme_data_regular_hours_worked' => false, + 'enhanced_scheme_data_request_name' => false, + 'enhanced_scheme_data_temp_start_date' => false, + 'enhanced_scheme_data_temp_week_ending' => false, + 'enhanced_scheme_data_total_tax_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enhanced_scheme_data_customer_reference' => 'enhancedSchemeData.customerReference', + 'enhanced_scheme_data_employee_name' => 'enhancedSchemeData.employeeName', + 'enhanced_scheme_data_job_description' => 'enhancedSchemeData.jobDescription', + 'enhanced_scheme_data_regular_hours_rate' => 'enhancedSchemeData.regularHoursRate', + 'enhanced_scheme_data_regular_hours_worked' => 'enhancedSchemeData.regularHoursWorked', + 'enhanced_scheme_data_request_name' => 'enhancedSchemeData.requestName', + 'enhanced_scheme_data_temp_start_date' => 'enhancedSchemeData.tempStartDate', + 'enhanced_scheme_data_temp_week_ending' => 'enhancedSchemeData.tempWeekEnding', + 'enhanced_scheme_data_total_tax_amount' => 'enhancedSchemeData.totalTaxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enhanced_scheme_data_customer_reference' => 'setEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_employee_name' => 'setEnhancedSchemeDataEmployeeName', + 'enhanced_scheme_data_job_description' => 'setEnhancedSchemeDataJobDescription', + 'enhanced_scheme_data_regular_hours_rate' => 'setEnhancedSchemeDataRegularHoursRate', + 'enhanced_scheme_data_regular_hours_worked' => 'setEnhancedSchemeDataRegularHoursWorked', + 'enhanced_scheme_data_request_name' => 'setEnhancedSchemeDataRequestName', + 'enhanced_scheme_data_temp_start_date' => 'setEnhancedSchemeDataTempStartDate', + 'enhanced_scheme_data_temp_week_ending' => 'setEnhancedSchemeDataTempWeekEnding', + 'enhanced_scheme_data_total_tax_amount' => 'setEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enhanced_scheme_data_customer_reference' => 'getEnhancedSchemeDataCustomerReference', + 'enhanced_scheme_data_employee_name' => 'getEnhancedSchemeDataEmployeeName', + 'enhanced_scheme_data_job_description' => 'getEnhancedSchemeDataJobDescription', + 'enhanced_scheme_data_regular_hours_rate' => 'getEnhancedSchemeDataRegularHoursRate', + 'enhanced_scheme_data_regular_hours_worked' => 'getEnhancedSchemeDataRegularHoursWorked', + 'enhanced_scheme_data_request_name' => 'getEnhancedSchemeDataRequestName', + 'enhanced_scheme_data_temp_start_date' => 'getEnhancedSchemeDataTempStartDate', + 'enhanced_scheme_data_temp_week_ending' => 'getEnhancedSchemeDataTempWeekEnding', + 'enhanced_scheme_data_total_tax_amount' => 'getEnhancedSchemeDataTotalTaxAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enhanced_scheme_data_customer_reference', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_employee_name', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_job_description', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_regular_hours_rate', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_regular_hours_worked', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_request_name', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_temp_start_date', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_temp_week_ending', $data ?? [], null); + $this->setIfExists('enhanced_scheme_data_total_tax_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enhanced_scheme_data_customer_reference + * + * @return string|null + */ + public function getEnhancedSchemeDataCustomerReference() + { + return $this->container['enhanced_scheme_data_customer_reference']; + } + + /** + * Sets enhanced_scheme_data_customer_reference + * + * @param string|null $enhanced_scheme_data_customer_reference Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + * + * @return self + */ + public function setEnhancedSchemeDataCustomerReference($enhanced_scheme_data_customer_reference) + { + if (is_null($enhanced_scheme_data_customer_reference)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_customer_reference cannot be null'); + } + $this->container['enhanced_scheme_data_customer_reference'] = $enhanced_scheme_data_customer_reference; + + return $this; + } + + /** + * Gets enhanced_scheme_data_employee_name + * + * @return string|null + */ + public function getEnhancedSchemeDataEmployeeName() + { + return $this->container['enhanced_scheme_data_employee_name']; + } + + /** + * Sets enhanced_scheme_data_employee_name + * + * @param string|null $enhanced_scheme_data_employee_name Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 + * + * @return self + */ + public function setEnhancedSchemeDataEmployeeName($enhanced_scheme_data_employee_name) + { + if (is_null($enhanced_scheme_data_employee_name)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_employee_name cannot be null'); + } + $this->container['enhanced_scheme_data_employee_name'] = $enhanced_scheme_data_employee_name; + + return $this; + } + + /** + * Gets enhanced_scheme_data_job_description + * + * @return string|null + */ + public function getEnhancedSchemeDataJobDescription() + { + return $this->container['enhanced_scheme_data_job_description']; + } + + /** + * Sets enhanced_scheme_data_job_description + * + * @param string|null $enhanced_scheme_data_job_description Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 + * + * @return self + */ + public function setEnhancedSchemeDataJobDescription($enhanced_scheme_data_job_description) + { + if (is_null($enhanced_scheme_data_job_description)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_job_description cannot be null'); + } + $this->container['enhanced_scheme_data_job_description'] = $enhanced_scheme_data_job_description; + + return $this; + } + + /** + * Gets enhanced_scheme_data_regular_hours_rate + * + * @return string|null + */ + public function getEnhancedSchemeDataRegularHoursRate() + { + return $this->container['enhanced_scheme_data_regular_hours_rate']; + } + + /** + * Sets enhanced_scheme_data_regular_hours_rate + * + * @param string|null $enhanced_scheme_data_regular_hours_rate Amount paid per regular hours worked, minor units. * maxLength: 7 + * + * @return self + */ + public function setEnhancedSchemeDataRegularHoursRate($enhanced_scheme_data_regular_hours_rate) + { + if (is_null($enhanced_scheme_data_regular_hours_rate)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_regular_hours_rate cannot be null'); + } + $this->container['enhanced_scheme_data_regular_hours_rate'] = $enhanced_scheme_data_regular_hours_rate; + + return $this; + } + + /** + * Gets enhanced_scheme_data_regular_hours_worked + * + * @return string|null + */ + public function getEnhancedSchemeDataRegularHoursWorked() + { + return $this->container['enhanced_scheme_data_regular_hours_worked']; + } + + /** + * Sets enhanced_scheme_data_regular_hours_worked + * + * @param string|null $enhanced_scheme_data_regular_hours_worked Amount of time worked during a normal operation for the task or job. * maxLength: 7 + * + * @return self + */ + public function setEnhancedSchemeDataRegularHoursWorked($enhanced_scheme_data_regular_hours_worked) + { + if (is_null($enhanced_scheme_data_regular_hours_worked)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_regular_hours_worked cannot be null'); + } + $this->container['enhanced_scheme_data_regular_hours_worked'] = $enhanced_scheme_data_regular_hours_worked; + + return $this; + } + + /** + * Gets enhanced_scheme_data_request_name + * + * @return string|null + */ + public function getEnhancedSchemeDataRequestName() + { + return $this->container['enhanced_scheme_data_request_name']; + } + + /** + * Sets enhanced_scheme_data_request_name + * + * @param string|null $enhanced_scheme_data_request_name Name of the individual requesting temporary services. * maxLength: 40 + * + * @return self + */ + public function setEnhancedSchemeDataRequestName($enhanced_scheme_data_request_name) + { + if (is_null($enhanced_scheme_data_request_name)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_request_name cannot be null'); + } + $this->container['enhanced_scheme_data_request_name'] = $enhanced_scheme_data_request_name; + + return $this; + } + + /** + * Gets enhanced_scheme_data_temp_start_date + * + * @return string|null + */ + public function getEnhancedSchemeDataTempStartDate() + { + return $this->container['enhanced_scheme_data_temp_start_date']; + } + + /** + * Sets enhanced_scheme_data_temp_start_date + * + * @param string|null $enhanced_scheme_data_temp_start_date Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 + * + * @return self + */ + public function setEnhancedSchemeDataTempStartDate($enhanced_scheme_data_temp_start_date) + { + if (is_null($enhanced_scheme_data_temp_start_date)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_temp_start_date cannot be null'); + } + $this->container['enhanced_scheme_data_temp_start_date'] = $enhanced_scheme_data_temp_start_date; + + return $this; + } + + /** + * Gets enhanced_scheme_data_temp_week_ending + * + * @return string|null + */ + public function getEnhancedSchemeDataTempWeekEnding() + { + return $this->container['enhanced_scheme_data_temp_week_ending']; + } + + /** + * Sets enhanced_scheme_data_temp_week_ending + * + * @param string|null $enhanced_scheme_data_temp_week_ending Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 + * + * @return self + */ + public function setEnhancedSchemeDataTempWeekEnding($enhanced_scheme_data_temp_week_ending) + { + if (is_null($enhanced_scheme_data_temp_week_ending)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_temp_week_ending cannot be null'); + } + $this->container['enhanced_scheme_data_temp_week_ending'] = $enhanced_scheme_data_temp_week_ending; + + return $this; + } + + /** + * Gets enhanced_scheme_data_total_tax_amount + * + * @return string|null + */ + public function getEnhancedSchemeDataTotalTaxAmount() + { + return $this->container['enhanced_scheme_data_total_tax_amount']; + } + + /** + * Sets enhanced_scheme_data_total_tax_amount + * + * @param string|null $enhanced_scheme_data_total_tax_amount Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 + * + * @return self + */ + public function setEnhancedSchemeDataTotalTaxAmount($enhanced_scheme_data_total_tax_amount) + { + if (is_null($enhanced_scheme_data_total_tax_amount)) { + throw new \InvalidArgumentException('non-nullable enhanced_scheme_data_total_tax_amount cannot be null'); + } + $this->container['enhanced_scheme_data_total_tax_amount'] = $enhanced_scheme_data_total_tax_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdditionalDataWallets.php b/src/Adyen/Model/Payments/AdditionalDataWallets.php new file mode 100644 index 000000000..9c715ab99 --- /dev/null +++ b/src/Adyen/Model/Payments/AdditionalDataWallets.php @@ -0,0 +1,555 @@ + + */ +class AdditionalDataWallets implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalDataWallets'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'androidpay_token' => 'string', + 'masterpass_transaction_id' => 'string', + 'payment_token' => 'string', + 'paywithgoogle_token' => 'string', + 'samsungpay_token' => 'string', + 'visacheckout_call_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'androidpay_token' => null, + 'masterpass_transaction_id' => null, + 'payment_token' => null, + 'paywithgoogle_token' => null, + 'samsungpay_token' => null, + 'visacheckout_call_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'androidpay_token' => false, + 'masterpass_transaction_id' => false, + 'payment_token' => false, + 'paywithgoogle_token' => false, + 'samsungpay_token' => false, + 'visacheckout_call_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'androidpay_token' => 'androidpay.token', + 'masterpass_transaction_id' => 'masterpass.transactionId', + 'payment_token' => 'payment.token', + 'paywithgoogle_token' => 'paywithgoogle.token', + 'samsungpay_token' => 'samsungpay.token', + 'visacheckout_call_id' => 'visacheckout.callId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'androidpay_token' => 'setAndroidpayToken', + 'masterpass_transaction_id' => 'setMasterpassTransactionId', + 'payment_token' => 'setPaymentToken', + 'paywithgoogle_token' => 'setPaywithgoogleToken', + 'samsungpay_token' => 'setSamsungpayToken', + 'visacheckout_call_id' => 'setVisacheckoutCallId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'androidpay_token' => 'getAndroidpayToken', + 'masterpass_transaction_id' => 'getMasterpassTransactionId', + 'payment_token' => 'getPaymentToken', + 'paywithgoogle_token' => 'getPaywithgoogleToken', + 'samsungpay_token' => 'getSamsungpayToken', + 'visacheckout_call_id' => 'getVisacheckoutCallId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('androidpay_token', $data ?? [], null); + $this->setIfExists('masterpass_transaction_id', $data ?? [], null); + $this->setIfExists('payment_token', $data ?? [], null); + $this->setIfExists('paywithgoogle_token', $data ?? [], null); + $this->setIfExists('samsungpay_token', $data ?? [], null); + $this->setIfExists('visacheckout_call_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets androidpay_token + * + * @return string|null + */ + public function getAndroidpayToken() + { + return $this->container['androidpay_token']; + } + + /** + * Sets androidpay_token + * + * @param string|null $androidpay_token The Android Pay token retrieved from the SDK. + * + * @return self + */ + public function setAndroidpayToken($androidpay_token) + { + if (is_null($androidpay_token)) { + throw new \InvalidArgumentException('non-nullable androidpay_token cannot be null'); + } + $this->container['androidpay_token'] = $androidpay_token; + + return $this; + } + + /** + * Gets masterpass_transaction_id + * + * @return string|null + */ + public function getMasterpassTransactionId() + { + return $this->container['masterpass_transaction_id']; + } + + /** + * Sets masterpass_transaction_id + * + * @param string|null $masterpass_transaction_id The Mastercard Masterpass Transaction ID retrieved from the SDK. + * + * @return self + */ + public function setMasterpassTransactionId($masterpass_transaction_id) + { + if (is_null($masterpass_transaction_id)) { + throw new \InvalidArgumentException('non-nullable masterpass_transaction_id cannot be null'); + } + $this->container['masterpass_transaction_id'] = $masterpass_transaction_id; + + return $this; + } + + /** + * Gets payment_token + * + * @return string|null + */ + public function getPaymentToken() + { + return $this->container['payment_token']; + } + + /** + * Sets payment_token + * + * @param string|null $payment_token The Apple Pay token retrieved from the SDK. + * + * @return self + */ + public function setPaymentToken($payment_token) + { + if (is_null($payment_token)) { + throw new \InvalidArgumentException('non-nullable payment_token cannot be null'); + } + $this->container['payment_token'] = $payment_token; + + return $this; + } + + /** + * Gets paywithgoogle_token + * + * @return string|null + */ + public function getPaywithgoogleToken() + { + return $this->container['paywithgoogle_token']; + } + + /** + * Sets paywithgoogle_token + * + * @param string|null $paywithgoogle_token The Google Pay token retrieved from the SDK. + * + * @return self + */ + public function setPaywithgoogleToken($paywithgoogle_token) + { + if (is_null($paywithgoogle_token)) { + throw new \InvalidArgumentException('non-nullable paywithgoogle_token cannot be null'); + } + $this->container['paywithgoogle_token'] = $paywithgoogle_token; + + return $this; + } + + /** + * Gets samsungpay_token + * + * @return string|null + */ + public function getSamsungpayToken() + { + return $this->container['samsungpay_token']; + } + + /** + * Sets samsungpay_token + * + * @param string|null $samsungpay_token The Samsung Pay token retrieved from the SDK. + * + * @return self + */ + public function setSamsungpayToken($samsungpay_token) + { + if (is_null($samsungpay_token)) { + throw new \InvalidArgumentException('non-nullable samsungpay_token cannot be null'); + } + $this->container['samsungpay_token'] = $samsungpay_token; + + return $this; + } + + /** + * Gets visacheckout_call_id + * + * @return string|null + */ + public function getVisacheckoutCallId() + { + return $this->container['visacheckout_call_id']; + } + + /** + * Sets visacheckout_call_id + * + * @param string|null $visacheckout_call_id The Visa Checkout Call ID retrieved from the SDK. + * + * @return self + */ + public function setVisacheckoutCallId($visacheckout_call_id) + { + if (is_null($visacheckout_call_id)) { + throw new \InvalidArgumentException('non-nullable visacheckout_call_id cannot be null'); + } + $this->container['visacheckout_call_id'] = $visacheckout_call_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Address.php b/src/Adyen/Model/Payments/Address.php new file mode 100644 index 000000000..098f1ffac --- /dev/null +++ b/src/Adyen/Model/Payments/Address.php @@ -0,0 +1,570 @@ + + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'house_number_or_name' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string', + 'street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'house_number_or_name' => null, + 'postal_code' => null, + 'state_or_province' => null, + 'street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'house_number_or_name' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'house_number_or_name' => 'houseNumberOrName', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince', + 'street' => 'street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'house_number_or_name' => 'setHouseNumberOrName', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince', + 'street' => 'setStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'house_number_or_name' => 'getHouseNumberOrName', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince', + 'street' => 'getStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('house_number_or_name', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ($this->container['house_number_or_name'] === null) { + $invalidProperties[] = "'house_number_or_name' can't be null"; + } + if ($this->container['postal_code'] === null) { + $invalidProperties[] = "'postal_code' can't be null"; + } + if ($this->container['street'] === null) { + $invalidProperties[] = "'street' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city The name of the city. Maximum length: 3000 characters. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets house_number_or_name + * + * @return string + */ + public function getHouseNumberOrName() + { + return $this->container['house_number_or_name']; + } + + /** + * Sets house_number_or_name + * + * @param string $house_number_or_name The number or name of the house. Maximum length: 3000 characters. + * + * @return self + */ + public function setHouseNumberOrName($house_number_or_name) + { + if (is_null($house_number_or_name)) { + throw new \InvalidArgumentException('non-nullable house_number_or_name cannot be null'); + } + $this->container['house_number_or_name'] = $house_number_or_name; + + return $this; + } + + /** + * Gets postal_code + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string $postal_code A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + throw new \InvalidArgumentException('non-nullable street cannot be null'); + } + $this->container['street'] = $street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AdjustAuthorisationRequest.php b/src/Adyen/Model/Payments/AdjustAuthorisationRequest.php new file mode 100644 index 000000000..531ae370d --- /dev/null +++ b/src/Adyen/Model/Payments/AdjustAuthorisationRequest.php @@ -0,0 +1,734 @@ + + */ +class AdjustAuthorisationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdjustAuthorisationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'merchant_account' => 'string', + 'modification_amount' => '\Adyen\Model\Payments\Amount', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'original_merchant_reference' => 'string', + 'original_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'tender_reference' => 'string', + 'unique_terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'merchant_account' => null, + 'modification_amount' => null, + 'mpi_data' => null, + 'original_merchant_reference' => null, + 'original_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null, + 'splits' => null, + 'tender_reference' => null, + 'unique_terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'merchant_account' => false, + 'modification_amount' => false, + 'mpi_data' => false, + 'original_merchant_reference' => false, + 'original_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false, + 'splits' => false, + 'tender_reference' => false, + 'unique_terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'merchant_account' => 'merchantAccount', + 'modification_amount' => 'modificationAmount', + 'mpi_data' => 'mpiData', + 'original_merchant_reference' => 'originalMerchantReference', + 'original_reference' => 'originalReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference', + 'splits' => 'splits', + 'tender_reference' => 'tenderReference', + 'unique_terminal_id' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'merchant_account' => 'setMerchantAccount', + 'modification_amount' => 'setModificationAmount', + 'mpi_data' => 'setMpiData', + 'original_merchant_reference' => 'setOriginalMerchantReference', + 'original_reference' => 'setOriginalReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'tender_reference' => 'setTenderReference', + 'unique_terminal_id' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'merchant_account' => 'getMerchantAccount', + 'modification_amount' => 'getModificationAmount', + 'mpi_data' => 'getMpiData', + 'original_merchant_reference' => 'getOriginalMerchantReference', + 'original_reference' => 'getOriginalReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'tender_reference' => 'getTenderReference', + 'unique_terminal_id' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('modification_amount', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('original_merchant_reference', $data ?? [], null); + $this->setIfExists('original_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('tender_reference', $data ?? [], null); + $this->setIfExists('unique_terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['modification_amount'] === null) { + $invalidProperties[] = "'modification_amount' can't be null"; + } + if ($this->container['original_reference'] === null) { + $invalidProperties[] = "'original_reference' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets modification_amount + * + * @return \Adyen\Model\Payments\Amount + */ + public function getModificationAmount() + { + return $this->container['modification_amount']; + } + + /** + * Sets modification_amount + * + * @param \Adyen\Model\Payments\Amount $modification_amount modification_amount + * + * @return self + */ + public function setModificationAmount($modification_amount) + { + if (is_null($modification_amount)) { + throw new \InvalidArgumentException('non-nullable modification_amount cannot be null'); + } + $this->container['modification_amount'] = $modification_amount; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets original_merchant_reference + * + * @return string|null + */ + public function getOriginalMerchantReference() + { + return $this->container['original_merchant_reference']; + } + + /** + * Sets original_merchant_reference + * + * @param string|null $original_merchant_reference The original merchant reference to cancel. + * + * @return self + */ + public function setOriginalMerchantReference($original_merchant_reference) + { + if (is_null($original_merchant_reference)) { + throw new \InvalidArgumentException('non-nullable original_merchant_reference cannot be null'); + } + $this->container['original_merchant_reference'] = $original_merchant_reference; + + return $this; + } + + /** + * Gets original_reference + * + * @return string + */ + public function getOriginalReference() + { + return $this->container['original_reference']; + } + + /** + * Sets original_reference + * + * @param string $original_reference The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + * + * @return self + */ + public function setOriginalReference($original_reference) + { + if (is_null($original_reference)) { + throw new \InvalidArgumentException('non-nullable original_reference cannot be null'); + } + $this->container['original_reference'] = $original_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets tender_reference + * + * @return string|null + */ + public function getTenderReference() + { + return $this->container['tender_reference']; + } + + /** + * Sets tender_reference + * + * @param string|null $tender_reference The transaction reference provided by the PED. For point-of-sale integrations only. + * + * @return self + */ + public function setTenderReference($tender_reference) + { + if (is_null($tender_reference)) { + throw new \InvalidArgumentException('non-nullable tender_reference cannot be null'); + } + $this->container['tender_reference'] = $tender_reference; + + return $this; + } + + /** + * Gets unique_terminal_id + * + * @return string|null + */ + public function getUniqueTerminalId() + { + return $this->container['unique_terminal_id']; + } + + /** + * Sets unique_terminal_id + * + * @param string|null $unique_terminal_id Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + * + * @return self + */ + public function setUniqueTerminalId($unique_terminal_id) + { + if (is_null($unique_terminal_id)) { + throw new \InvalidArgumentException('non-nullable unique_terminal_id cannot be null'); + } + $this->container['unique_terminal_id'] = $unique_terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Amount.php b/src/Adyen/Model/Payments/Amount.php new file mode 100644 index 000000000..29033c19b --- /dev/null +++ b/src/Adyen/Model/Payments/Amount.php @@ -0,0 +1,425 @@ + + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ApplicationInfo.php b/src/Adyen/Model/Payments/ApplicationInfo.php new file mode 100644 index 000000000..92961c0cf --- /dev/null +++ b/src/Adyen/Model/Payments/ApplicationInfo.php @@ -0,0 +1,555 @@ + + */ +class ApplicationInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApplicationInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'adyen_library' => '\Adyen\Model\Payments\CommonField', + 'adyen_payment_source' => '\Adyen\Model\Payments\CommonField', + 'external_platform' => '\Adyen\Model\Payments\ExternalPlatform', + 'merchant_application' => '\Adyen\Model\Payments\CommonField', + 'merchant_device' => '\Adyen\Model\Payments\MerchantDevice', + 'shopper_interaction_device' => '\Adyen\Model\Payments\ShopperInteractionDevice' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'adyen_library' => null, + 'adyen_payment_source' => null, + 'external_platform' => null, + 'merchant_application' => null, + 'merchant_device' => null, + 'shopper_interaction_device' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'adyen_library' => false, + 'adyen_payment_source' => false, + 'external_platform' => false, + 'merchant_application' => false, + 'merchant_device' => false, + 'shopper_interaction_device' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'adyen_library' => 'adyenLibrary', + 'adyen_payment_source' => 'adyenPaymentSource', + 'external_platform' => 'externalPlatform', + 'merchant_application' => 'merchantApplication', + 'merchant_device' => 'merchantDevice', + 'shopper_interaction_device' => 'shopperInteractionDevice' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'adyen_library' => 'setAdyenLibrary', + 'adyen_payment_source' => 'setAdyenPaymentSource', + 'external_platform' => 'setExternalPlatform', + 'merchant_application' => 'setMerchantApplication', + 'merchant_device' => 'setMerchantDevice', + 'shopper_interaction_device' => 'setShopperInteractionDevice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'adyen_library' => 'getAdyenLibrary', + 'adyen_payment_source' => 'getAdyenPaymentSource', + 'external_platform' => 'getExternalPlatform', + 'merchant_application' => 'getMerchantApplication', + 'merchant_device' => 'getMerchantDevice', + 'shopper_interaction_device' => 'getShopperInteractionDevice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('adyen_library', $data ?? [], null); + $this->setIfExists('adyen_payment_source', $data ?? [], null); + $this->setIfExists('external_platform', $data ?? [], null); + $this->setIfExists('merchant_application', $data ?? [], null); + $this->setIfExists('merchant_device', $data ?? [], null); + $this->setIfExists('shopper_interaction_device', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets adyen_library + * + * @return \Adyen\Model\Payments\CommonField|null + */ + public function getAdyenLibrary() + { + return $this->container['adyen_library']; + } + + /** + * Sets adyen_library + * + * @param \Adyen\Model\Payments\CommonField|null $adyen_library adyen_library + * + * @return self + */ + public function setAdyenLibrary($adyen_library) + { + if (is_null($adyen_library)) { + throw new \InvalidArgumentException('non-nullable adyen_library cannot be null'); + } + $this->container['adyen_library'] = $adyen_library; + + return $this; + } + + /** + * Gets adyen_payment_source + * + * @return \Adyen\Model\Payments\CommonField|null + */ + public function getAdyenPaymentSource() + { + return $this->container['adyen_payment_source']; + } + + /** + * Sets adyen_payment_source + * + * @param \Adyen\Model\Payments\CommonField|null $adyen_payment_source adyen_payment_source + * + * @return self + */ + public function setAdyenPaymentSource($adyen_payment_source) + { + if (is_null($adyen_payment_source)) { + throw new \InvalidArgumentException('non-nullable adyen_payment_source cannot be null'); + } + $this->container['adyen_payment_source'] = $adyen_payment_source; + + return $this; + } + + /** + * Gets external_platform + * + * @return \Adyen\Model\Payments\ExternalPlatform|null + */ + public function getExternalPlatform() + { + return $this->container['external_platform']; + } + + /** + * Sets external_platform + * + * @param \Adyen\Model\Payments\ExternalPlatform|null $external_platform external_platform + * + * @return self + */ + public function setExternalPlatform($external_platform) + { + if (is_null($external_platform)) { + throw new \InvalidArgumentException('non-nullable external_platform cannot be null'); + } + $this->container['external_platform'] = $external_platform; + + return $this; + } + + /** + * Gets merchant_application + * + * @return \Adyen\Model\Payments\CommonField|null + */ + public function getMerchantApplication() + { + return $this->container['merchant_application']; + } + + /** + * Sets merchant_application + * + * @param \Adyen\Model\Payments\CommonField|null $merchant_application merchant_application + * + * @return self + */ + public function setMerchantApplication($merchant_application) + { + if (is_null($merchant_application)) { + throw new \InvalidArgumentException('non-nullable merchant_application cannot be null'); + } + $this->container['merchant_application'] = $merchant_application; + + return $this; + } + + /** + * Gets merchant_device + * + * @return \Adyen\Model\Payments\MerchantDevice|null + */ + public function getMerchantDevice() + { + return $this->container['merchant_device']; + } + + /** + * Sets merchant_device + * + * @param \Adyen\Model\Payments\MerchantDevice|null $merchant_device merchant_device + * + * @return self + */ + public function setMerchantDevice($merchant_device) + { + if (is_null($merchant_device)) { + throw new \InvalidArgumentException('non-nullable merchant_device cannot be null'); + } + $this->container['merchant_device'] = $merchant_device; + + return $this; + } + + /** + * Gets shopper_interaction_device + * + * @return \Adyen\Model\Payments\ShopperInteractionDevice|null + */ + public function getShopperInteractionDevice() + { + return $this->container['shopper_interaction_device']; + } + + /** + * Sets shopper_interaction_device + * + * @param \Adyen\Model\Payments\ShopperInteractionDevice|null $shopper_interaction_device shopper_interaction_device + * + * @return self + */ + public function setShopperInteractionDevice($shopper_interaction_device) + { + if (is_null($shopper_interaction_device)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction_device cannot be null'); + } + $this->container['shopper_interaction_device'] = $shopper_interaction_device; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AuthenticationResultRequest.php b/src/Adyen/Model/Payments/AuthenticationResultRequest.php new file mode 100644 index 000000000..24c0de24d --- /dev/null +++ b/src/Adyen/Model/Payments/AuthenticationResultRequest.php @@ -0,0 +1,425 @@ + + */ +class AuthenticationResultRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationResultRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'psp_reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'psp_reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'psp_reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'psp_reference' => 'pspReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'psp_reference' => 'setPspReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'psp_reference' => 'getPspReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' 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 merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which the authentication was processed. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference The pspReference identifier for the transaction. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/AuthenticationResultResponse.php b/src/Adyen/Model/Payments/AuthenticationResultResponse.php new file mode 100644 index 000000000..f8ee994f7 --- /dev/null +++ b/src/Adyen/Model/Payments/AuthenticationResultResponse.php @@ -0,0 +1,419 @@ + + */ +class AuthenticationResultResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationResultResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'three_ds1_result' => '\Adyen\Model\Payments\ThreeDS1Result', + 'three_ds2_result' => '\Adyen\Model\Payments\ThreeDS2Result' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'three_ds1_result' => null, + 'three_ds2_result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'three_ds1_result' => false, + 'three_ds2_result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'three_ds1_result' => 'threeDS1Result', + 'three_ds2_result' => 'threeDS2Result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'three_ds1_result' => 'setThreeDs1Result', + 'three_ds2_result' => 'setThreeDs2Result' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'three_ds1_result' => 'getThreeDs1Result', + 'three_ds2_result' => 'getThreeDs2Result' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('three_ds1_result', $data ?? [], null); + $this->setIfExists('three_ds2_result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets three_ds1_result + * + * @return \Adyen\Model\Payments\ThreeDS1Result|null + */ + public function getThreeDs1Result() + { + return $this->container['three_ds1_result']; + } + + /** + * Sets three_ds1_result + * + * @param \Adyen\Model\Payments\ThreeDS1Result|null $three_ds1_result three_ds1_result + * + * @return self + */ + public function setThreeDs1Result($three_ds1_result) + { + if (is_null($three_ds1_result)) { + throw new \InvalidArgumentException('non-nullable three_ds1_result cannot be null'); + } + $this->container['three_ds1_result'] = $three_ds1_result; + + return $this; + } + + /** + * Gets three_ds2_result + * + * @return \Adyen\Model\Payments\ThreeDS2Result|null + */ + public function getThreeDs2Result() + { + return $this->container['three_ds2_result']; + } + + /** + * Sets three_ds2_result + * + * @param \Adyen\Model\Payments\ThreeDS2Result|null $three_ds2_result three_ds2_result + * + * @return self + */ + public function setThreeDs2Result($three_ds2_result) + { + if (is_null($three_ds2_result)) { + throw new \InvalidArgumentException('non-nullable three_ds2_result cannot be null'); + } + $this->container['three_ds2_result'] = $three_ds2_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 + ); + } +} diff --git a/src/Adyen/Model/Payments/BankAccount.php b/src/Adyen/Model/Payments/BankAccount.php new file mode 100644 index 000000000..002a72bd3 --- /dev/null +++ b/src/Adyen/Model/Payments/BankAccount.php @@ -0,0 +1,657 @@ + + */ +class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank_account_number' => 'string', + 'bank_city' => 'string', + 'bank_location_id' => 'string', + 'bank_name' => 'string', + 'bic' => 'string', + 'country_code' => 'string', + 'iban' => 'string', + 'owner_name' => 'string', + 'tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank_account_number' => null, + 'bank_city' => null, + 'bank_location_id' => null, + 'bank_name' => null, + 'bic' => null, + 'country_code' => null, + 'iban' => null, + 'owner_name' => null, + 'tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank_account_number' => false, + 'bank_city' => false, + 'bank_location_id' => false, + 'bank_name' => false, + 'bic' => false, + 'country_code' => false, + 'iban' => false, + 'owner_name' => false, + 'tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bank_account_number' => 'bankAccountNumber', + 'bank_city' => 'bankCity', + 'bank_location_id' => 'bankLocationId', + 'bank_name' => 'bankName', + 'bic' => 'bic', + 'country_code' => 'countryCode', + 'iban' => 'iban', + 'owner_name' => 'ownerName', + 'tax_id' => 'taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank_account_number' => 'setBankAccountNumber', + 'bank_city' => 'setBankCity', + 'bank_location_id' => 'setBankLocationId', + 'bank_name' => 'setBankName', + 'bic' => 'setBic', + 'country_code' => 'setCountryCode', + 'iban' => 'setIban', + 'owner_name' => 'setOwnerName', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank_account_number' => 'getBankAccountNumber', + 'bank_city' => 'getBankCity', + 'bank_location_id' => 'getBankLocationId', + 'bank_name' => 'getBankName', + 'bic' => 'getBic', + 'country_code' => 'getCountryCode', + 'iban' => 'getIban', + 'owner_name' => 'getOwnerName', + '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->setIfExists('bank_account_number', $data ?? [], null); + $this->setIfExists('bank_city', $data ?? [], null); + $this->setIfExists('bank_location_id', $data ?? [], null); + $this->setIfExists('bank_name', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank_account_number + * + * @return string|null + */ + public function getBankAccountNumber() + { + return $this->container['bank_account_number']; + } + + /** + * Sets bank_account_number + * + * @param string|null $bank_account_number The bank account number (without separators). + * + * @return self + */ + public function setBankAccountNumber($bank_account_number) + { + if (is_null($bank_account_number)) { + throw new \InvalidArgumentException('non-nullable bank_account_number cannot be null'); + } + $this->container['bank_account_number'] = $bank_account_number; + + return $this; + } + + /** + * Gets bank_city + * + * @return string|null + */ + public function getBankCity() + { + return $this->container['bank_city']; + } + + /** + * Sets bank_city + * + * @param string|null $bank_city The bank city. + * + * @return self + */ + public function setBankCity($bank_city) + { + if (is_null($bank_city)) { + throw new \InvalidArgumentException('non-nullable bank_city cannot be null'); + } + $this->container['bank_city'] = $bank_city; + + return $this; + } + + /** + * Gets bank_location_id + * + * @return string|null + */ + public function getBankLocationId() + { + return $this->container['bank_location_id']; + } + + /** + * Sets bank_location_id + * + * @param string|null $bank_location_id The location id of the bank. The field value is `nil` in most cases. + * + * @return self + */ + public function setBankLocationId($bank_location_id) + { + if (is_null($bank_location_id)) { + throw new \InvalidArgumentException('non-nullable bank_location_id cannot be null'); + } + $this->container['bank_location_id'] = $bank_location_id; + + return $this; + } + + /** + * Gets bank_name + * + * @return string|null + */ + public function getBankName() + { + return $this->container['bank_name']; + } + + /** + * Sets bank_name + * + * @param string|null $bank_name The name of the bank. + * + * @return self + */ + public function setBankName($bank_name) + { + if (is_null($bank_name)) { + throw new \InvalidArgumentException('non-nullable bank_name cannot be null'); + } + $this->container['bank_name'] = $bank_name; + + return $this; + } + + /** + * Gets bic + * + * @return string|null + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string|null $bic The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets tax_id + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param string|null $tax_id The bank account holder's tax ID. + * + * @return self + */ + public function setTaxId($tax_id) + { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } + $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 + ); + } +} diff --git a/src/Adyen/Model/Payments/BrowserInfo.php b/src/Adyen/Model/Payments/BrowserInfo.php new file mode 100644 index 000000000..402042c20 --- /dev/null +++ b/src/Adyen/Model/Payments/BrowserInfo.php @@ -0,0 +1,673 @@ + + */ +class BrowserInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BrowserInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accept_header' => 'string', + 'color_depth' => 'int', + 'java_enabled' => 'bool', + 'java_script_enabled' => 'bool', + 'language' => 'string', + 'screen_height' => 'int', + 'screen_width' => 'int', + 'time_zone_offset' => 'int', + 'user_agent' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accept_header' => null, + 'color_depth' => 'int32', + 'java_enabled' => null, + 'java_script_enabled' => null, + 'language' => null, + 'screen_height' => 'int32', + 'screen_width' => 'int32', + 'time_zone_offset' => 'int32', + 'user_agent' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accept_header' => false, + 'color_depth' => true, + 'java_enabled' => false, + 'java_script_enabled' => false, + 'language' => false, + 'screen_height' => true, + 'screen_width' => true, + 'time_zone_offset' => true, + 'user_agent' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accept_header' => 'acceptHeader', + 'color_depth' => 'colorDepth', + 'java_enabled' => 'javaEnabled', + 'java_script_enabled' => 'javaScriptEnabled', + 'language' => 'language', + 'screen_height' => 'screenHeight', + 'screen_width' => 'screenWidth', + 'time_zone_offset' => 'timeZoneOffset', + 'user_agent' => 'userAgent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accept_header' => 'setAcceptHeader', + 'color_depth' => 'setColorDepth', + 'java_enabled' => 'setJavaEnabled', + 'java_script_enabled' => 'setJavaScriptEnabled', + 'language' => 'setLanguage', + 'screen_height' => 'setScreenHeight', + 'screen_width' => 'setScreenWidth', + 'time_zone_offset' => 'setTimeZoneOffset', + 'user_agent' => 'setUserAgent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accept_header' => 'getAcceptHeader', + 'color_depth' => 'getColorDepth', + 'java_enabled' => 'getJavaEnabled', + 'java_script_enabled' => 'getJavaScriptEnabled', + 'language' => 'getLanguage', + 'screen_height' => 'getScreenHeight', + 'screen_width' => 'getScreenWidth', + 'time_zone_offset' => 'getTimeZoneOffset', + 'user_agent' => 'getUserAgent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accept_header', $data ?? [], null); + $this->setIfExists('color_depth', $data ?? [], null); + $this->setIfExists('java_enabled', $data ?? [], null); + $this->setIfExists('java_script_enabled', $data ?? [], true); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('screen_height', $data ?? [], null); + $this->setIfExists('screen_width', $data ?? [], null); + $this->setIfExists('time_zone_offset', $data ?? [], null); + $this->setIfExists('user_agent', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['accept_header'] === null) { + $invalidProperties[] = "'accept_header' can't be null"; + } + if ($this->container['color_depth'] === null) { + $invalidProperties[] = "'color_depth' can't be null"; + } + if ($this->container['java_enabled'] === null) { + $invalidProperties[] = "'java_enabled' can't be null"; + } + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' 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_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 accept_header + * + * @return string + */ + public function getAcceptHeader() + { + return $this->container['accept_header']; + } + + /** + * Sets accept_header + * + * @param string $accept_header The accept header value of the shopper's browser. + * + * @return self + */ + public function setAcceptHeader($accept_header) + { + if (is_null($accept_header)) { + throw new \InvalidArgumentException('non-nullable accept_header cannot be null'); + } + $this->container['accept_header'] = $accept_header; + + return $this; + } + + /** + * Gets color_depth + * + * @return int + */ + public function getColorDepth() + { + return $this->container['color_depth']; + } + + /** + * Sets color_depth + * + * @param int $color_depth The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. + * + * @return self + */ + public function setColorDepth($color_depth) + { + // Do nothing for nullable integers + $this->container['color_depth'] = $color_depth; + + return $this; + } + + /** + * Gets java_enabled + * + * @return bool + */ + public function getJavaEnabled() + { + return $this->container['java_enabled']; + } + + /** + * Sets java_enabled + * + * @param bool $java_enabled Boolean value indicating if the shopper's browser is able to execute Java. + * + * @return self + */ + public function setJavaEnabled($java_enabled) + { + if (is_null($java_enabled)) { + throw new \InvalidArgumentException('non-nullable java_enabled cannot be null'); + } + $this->container['java_enabled'] = $java_enabled; + + return $this; + } + + /** + * Gets java_script_enabled + * + * @return bool|null + */ + public function getJavaScriptEnabled() + { + return $this->container['java_script_enabled']; + } + + /** + * Sets java_script_enabled + * + * @param bool|null $java_script_enabled Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + * + * @return self + */ + public function setJavaScriptEnabled($java_script_enabled) + { + if (is_null($java_script_enabled)) { + throw new \InvalidArgumentException('non-nullable java_script_enabled cannot be null'); + } + $this->container['java_script_enabled'] = $java_script_enabled; + + return $this; + } + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets screen_height + * + * @return int + */ + public function getScreenHeight() + { + return $this->container['screen_height']; + } + + /** + * Sets screen_height + * + * @param int $screen_height The total height of the shopper's device screen in pixels. + * + * @return self + */ + public function setScreenHeight($screen_height) + { + // Do nothing for nullable integers + $this->container['screen_height'] = $screen_height; + + return $this; + } + + /** + * Gets screen_width + * + * @return int + */ + public function getScreenWidth() + { + return $this->container['screen_width']; + } + + /** + * Sets screen_width + * + * @param int $screen_width The total width of the shopper's device screen in pixels. + * + * @return self + */ + public function setScreenWidth($screen_width) + { + // Do nothing for nullable integers + $this->container['screen_width'] = $screen_width; + + return $this; + } + + /** + * Gets time_zone_offset + * + * @return int + */ + public function getTimeZoneOffset() + { + return $this->container['time_zone_offset']; + } + + /** + * Sets time_zone_offset + * + * @param int $time_zone_offset Time difference between UTC time and the shopper's browser local time, in minutes. + * + * @return self + */ + public function setTimeZoneOffset($time_zone_offset) + { + // Do nothing for nullable integers + $this->container['time_zone_offset'] = $time_zone_offset; + + 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 value of the shopper's browser. + * + * @return self + */ + public function setUserAgent($user_agent) + { + if (is_null($user_agent)) { + throw new \InvalidArgumentException('non-nullable user_agent cannot be null'); + } + $this->container['user_agent'] = $user_agent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/CancelOrRefundRequest.php b/src/Adyen/Model/Payments/CancelOrRefundRequest.php new file mode 100644 index 000000000..3bc209dca --- /dev/null +++ b/src/Adyen/Model/Payments/CancelOrRefundRequest.php @@ -0,0 +1,663 @@ + + */ +class CancelOrRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CancelOrRefundRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'merchant_account' => 'string', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'original_merchant_reference' => 'string', + 'original_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string', + 'tender_reference' => 'string', + 'unique_terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'merchant_account' => null, + 'mpi_data' => null, + 'original_merchant_reference' => null, + 'original_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null, + 'tender_reference' => null, + 'unique_terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'merchant_account' => false, + 'mpi_data' => false, + 'original_merchant_reference' => false, + 'original_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false, + 'tender_reference' => false, + 'unique_terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'merchant_account' => 'merchantAccount', + 'mpi_data' => 'mpiData', + 'original_merchant_reference' => 'originalMerchantReference', + 'original_reference' => 'originalReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference', + 'tender_reference' => 'tenderReference', + 'unique_terminal_id' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'merchant_account' => 'setMerchantAccount', + 'mpi_data' => 'setMpiData', + 'original_merchant_reference' => 'setOriginalMerchantReference', + 'original_reference' => 'setOriginalReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference', + 'tender_reference' => 'setTenderReference', + 'unique_terminal_id' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'merchant_account' => 'getMerchantAccount', + 'mpi_data' => 'getMpiData', + 'original_merchant_reference' => 'getOriginalMerchantReference', + 'original_reference' => 'getOriginalReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference', + 'tender_reference' => 'getTenderReference', + 'unique_terminal_id' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('original_merchant_reference', $data ?? [], null); + $this->setIfExists('original_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('tender_reference', $data ?? [], null); + $this->setIfExists('unique_terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['original_reference'] === null) { + $invalidProperties[] = "'original_reference' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets original_merchant_reference + * + * @return string|null + */ + public function getOriginalMerchantReference() + { + return $this->container['original_merchant_reference']; + } + + /** + * Sets original_merchant_reference + * + * @param string|null $original_merchant_reference The original merchant reference to cancel. + * + * @return self + */ + public function setOriginalMerchantReference($original_merchant_reference) + { + if (is_null($original_merchant_reference)) { + throw new \InvalidArgumentException('non-nullable original_merchant_reference cannot be null'); + } + $this->container['original_merchant_reference'] = $original_merchant_reference; + + return $this; + } + + /** + * Gets original_reference + * + * @return string + */ + public function getOriginalReference() + { + return $this->container['original_reference']; + } + + /** + * Sets original_reference + * + * @param string $original_reference The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + * + * @return self + */ + public function setOriginalReference($original_reference) + { + if (is_null($original_reference)) { + throw new \InvalidArgumentException('non-nullable original_reference cannot be null'); + } + $this->container['original_reference'] = $original_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets tender_reference + * + * @return string|null + */ + public function getTenderReference() + { + return $this->container['tender_reference']; + } + + /** + * Sets tender_reference + * + * @param string|null $tender_reference The transaction reference provided by the PED. For point-of-sale integrations only. + * + * @return self + */ + public function setTenderReference($tender_reference) + { + if (is_null($tender_reference)) { + throw new \InvalidArgumentException('non-nullable tender_reference cannot be null'); + } + $this->container['tender_reference'] = $tender_reference; + + return $this; + } + + /** + * Gets unique_terminal_id + * + * @return string|null + */ + public function getUniqueTerminalId() + { + return $this->container['unique_terminal_id']; + } + + /** + * Sets unique_terminal_id + * + * @param string|null $unique_terminal_id Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + * + * @return self + */ + public function setUniqueTerminalId($unique_terminal_id) + { + if (is_null($unique_terminal_id)) { + throw new \InvalidArgumentException('non-nullable unique_terminal_id cannot be null'); + } + $this->container['unique_terminal_id'] = $unique_terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/CancelRequest.php b/src/Adyen/Model/Payments/CancelRequest.php new file mode 100644 index 000000000..517acac76 --- /dev/null +++ b/src/Adyen/Model/Payments/CancelRequest.php @@ -0,0 +1,697 @@ + + */ +class CancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CancelRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'merchant_account' => 'string', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'original_merchant_reference' => 'string', + 'original_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'tender_reference' => 'string', + 'unique_terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'merchant_account' => null, + 'mpi_data' => null, + 'original_merchant_reference' => null, + 'original_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null, + 'splits' => null, + 'tender_reference' => null, + 'unique_terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'merchant_account' => false, + 'mpi_data' => false, + 'original_merchant_reference' => false, + 'original_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false, + 'splits' => false, + 'tender_reference' => false, + 'unique_terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'merchant_account' => 'merchantAccount', + 'mpi_data' => 'mpiData', + 'original_merchant_reference' => 'originalMerchantReference', + 'original_reference' => 'originalReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference', + 'splits' => 'splits', + 'tender_reference' => 'tenderReference', + 'unique_terminal_id' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'merchant_account' => 'setMerchantAccount', + 'mpi_data' => 'setMpiData', + 'original_merchant_reference' => 'setOriginalMerchantReference', + 'original_reference' => 'setOriginalReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'tender_reference' => 'setTenderReference', + 'unique_terminal_id' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'merchant_account' => 'getMerchantAccount', + 'mpi_data' => 'getMpiData', + 'original_merchant_reference' => 'getOriginalMerchantReference', + 'original_reference' => 'getOriginalReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'tender_reference' => 'getTenderReference', + 'unique_terminal_id' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('original_merchant_reference', $data ?? [], null); + $this->setIfExists('original_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('tender_reference', $data ?? [], null); + $this->setIfExists('unique_terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['original_reference'] === null) { + $invalidProperties[] = "'original_reference' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets original_merchant_reference + * + * @return string|null + */ + public function getOriginalMerchantReference() + { + return $this->container['original_merchant_reference']; + } + + /** + * Sets original_merchant_reference + * + * @param string|null $original_merchant_reference The original merchant reference to cancel. + * + * @return self + */ + public function setOriginalMerchantReference($original_merchant_reference) + { + if (is_null($original_merchant_reference)) { + throw new \InvalidArgumentException('non-nullable original_merchant_reference cannot be null'); + } + $this->container['original_merchant_reference'] = $original_merchant_reference; + + return $this; + } + + /** + * Gets original_reference + * + * @return string + */ + public function getOriginalReference() + { + return $this->container['original_reference']; + } + + /** + * Sets original_reference + * + * @param string $original_reference The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + * + * @return self + */ + public function setOriginalReference($original_reference) + { + if (is_null($original_reference)) { + throw new \InvalidArgumentException('non-nullable original_reference cannot be null'); + } + $this->container['original_reference'] = $original_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets tender_reference + * + * @return string|null + */ + public function getTenderReference() + { + return $this->container['tender_reference']; + } + + /** + * Sets tender_reference + * + * @param string|null $tender_reference The transaction reference provided by the PED. For point-of-sale integrations only. + * + * @return self + */ + public function setTenderReference($tender_reference) + { + if (is_null($tender_reference)) { + throw new \InvalidArgumentException('non-nullable tender_reference cannot be null'); + } + $this->container['tender_reference'] = $tender_reference; + + return $this; + } + + /** + * Gets unique_terminal_id + * + * @return string|null + */ + public function getUniqueTerminalId() + { + return $this->container['unique_terminal_id']; + } + + /** + * Sets unique_terminal_id + * + * @param string|null $unique_terminal_id Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + * + * @return self + */ + public function setUniqueTerminalId($unique_terminal_id) + { + if (is_null($unique_terminal_id)) { + throw new \InvalidArgumentException('non-nullable unique_terminal_id cannot be null'); + } + $this->container['unique_terminal_id'] = $unique_terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/CaptureRequest.php b/src/Adyen/Model/Payments/CaptureRequest.php new file mode 100644 index 000000000..7cf0da988 --- /dev/null +++ b/src/Adyen/Model/Payments/CaptureRequest.php @@ -0,0 +1,734 @@ + + */ +class CaptureRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CaptureRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'merchant_account' => 'string', + 'modification_amount' => '\Adyen\Model\Payments\Amount', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'original_merchant_reference' => 'string', + 'original_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'tender_reference' => 'string', + 'unique_terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'merchant_account' => null, + 'modification_amount' => null, + 'mpi_data' => null, + 'original_merchant_reference' => null, + 'original_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null, + 'splits' => null, + 'tender_reference' => null, + 'unique_terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'merchant_account' => false, + 'modification_amount' => false, + 'mpi_data' => false, + 'original_merchant_reference' => false, + 'original_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false, + 'splits' => false, + 'tender_reference' => false, + 'unique_terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'merchant_account' => 'merchantAccount', + 'modification_amount' => 'modificationAmount', + 'mpi_data' => 'mpiData', + 'original_merchant_reference' => 'originalMerchantReference', + 'original_reference' => 'originalReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference', + 'splits' => 'splits', + 'tender_reference' => 'tenderReference', + 'unique_terminal_id' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'merchant_account' => 'setMerchantAccount', + 'modification_amount' => 'setModificationAmount', + 'mpi_data' => 'setMpiData', + 'original_merchant_reference' => 'setOriginalMerchantReference', + 'original_reference' => 'setOriginalReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'tender_reference' => 'setTenderReference', + 'unique_terminal_id' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'merchant_account' => 'getMerchantAccount', + 'modification_amount' => 'getModificationAmount', + 'mpi_data' => 'getMpiData', + 'original_merchant_reference' => 'getOriginalMerchantReference', + 'original_reference' => 'getOriginalReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'tender_reference' => 'getTenderReference', + 'unique_terminal_id' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('modification_amount', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('original_merchant_reference', $data ?? [], null); + $this->setIfExists('original_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('tender_reference', $data ?? [], null); + $this->setIfExists('unique_terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['modification_amount'] === null) { + $invalidProperties[] = "'modification_amount' can't be null"; + } + if ($this->container['original_reference'] === null) { + $invalidProperties[] = "'original_reference' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets modification_amount + * + * @return \Adyen\Model\Payments\Amount + */ + public function getModificationAmount() + { + return $this->container['modification_amount']; + } + + /** + * Sets modification_amount + * + * @param \Adyen\Model\Payments\Amount $modification_amount modification_amount + * + * @return self + */ + public function setModificationAmount($modification_amount) + { + if (is_null($modification_amount)) { + throw new \InvalidArgumentException('non-nullable modification_amount cannot be null'); + } + $this->container['modification_amount'] = $modification_amount; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets original_merchant_reference + * + * @return string|null + */ + public function getOriginalMerchantReference() + { + return $this->container['original_merchant_reference']; + } + + /** + * Sets original_merchant_reference + * + * @param string|null $original_merchant_reference The original merchant reference to cancel. + * + * @return self + */ + public function setOriginalMerchantReference($original_merchant_reference) + { + if (is_null($original_merchant_reference)) { + throw new \InvalidArgumentException('non-nullable original_merchant_reference cannot be null'); + } + $this->container['original_merchant_reference'] = $original_merchant_reference; + + return $this; + } + + /** + * Gets original_reference + * + * @return string + */ + public function getOriginalReference() + { + return $this->container['original_reference']; + } + + /** + * Sets original_reference + * + * @param string $original_reference The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + * + * @return self + */ + public function setOriginalReference($original_reference) + { + if (is_null($original_reference)) { + throw new \InvalidArgumentException('non-nullable original_reference cannot be null'); + } + $this->container['original_reference'] = $original_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets tender_reference + * + * @return string|null + */ + public function getTenderReference() + { + return $this->container['tender_reference']; + } + + /** + * Sets tender_reference + * + * @param string|null $tender_reference The transaction reference provided by the PED. For point-of-sale integrations only. + * + * @return self + */ + public function setTenderReference($tender_reference) + { + if (is_null($tender_reference)) { + throw new \InvalidArgumentException('non-nullable tender_reference cannot be null'); + } + $this->container['tender_reference'] = $tender_reference; + + return $this; + } + + /** + * Gets unique_terminal_id + * + * @return string|null + */ + public function getUniqueTerminalId() + { + return $this->container['unique_terminal_id']; + } + + /** + * Sets unique_terminal_id + * + * @param string|null $unique_terminal_id Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + * + * @return self + */ + public function setUniqueTerminalId($unique_terminal_id) + { + if (is_null($unique_terminal_id)) { + throw new \InvalidArgumentException('non-nullable unique_terminal_id cannot be null'); + } + $this->container['unique_terminal_id'] = $unique_terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Card.php b/src/Adyen/Model/Payments/Card.php new file mode 100644 index 000000000..475e77dd2 --- /dev/null +++ b/src/Adyen/Model/Payments/Card.php @@ -0,0 +1,629 @@ + + */ +class Card implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Card'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cvc' => 'string', + 'expiry_month' => 'string', + 'expiry_year' => 'string', + 'holder_name' => 'string', + 'issue_number' => 'string', + 'number' => 'string', + 'start_month' => 'string', + 'start_year' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cvc' => null, + 'expiry_month' => null, + 'expiry_year' => null, + 'holder_name' => null, + 'issue_number' => null, + 'number' => null, + 'start_month' => null, + 'start_year' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cvc' => false, + 'expiry_month' => false, + 'expiry_year' => false, + 'holder_name' => false, + 'issue_number' => false, + 'number' => false, + 'start_month' => false, + 'start_year' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cvc' => 'cvc', + 'expiry_month' => 'expiryMonth', + 'expiry_year' => 'expiryYear', + 'holder_name' => 'holderName', + 'issue_number' => 'issueNumber', + 'number' => 'number', + 'start_month' => 'startMonth', + 'start_year' => 'startYear' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cvc' => 'setCvc', + 'expiry_month' => 'setExpiryMonth', + 'expiry_year' => 'setExpiryYear', + 'holder_name' => 'setHolderName', + 'issue_number' => 'setIssueNumber', + 'number' => 'setNumber', + 'start_month' => 'setStartMonth', + 'start_year' => 'setStartYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cvc' => 'getCvc', + 'expiry_month' => 'getExpiryMonth', + 'expiry_year' => 'getExpiryYear', + 'holder_name' => 'getHolderName', + 'issue_number' => 'getIssueNumber', + 'number' => 'getNumber', + 'start_month' => 'getStartMonth', + 'start_year' => 'getStartYear' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cvc', $data ?? [], null); + $this->setIfExists('expiry_month', $data ?? [], null); + $this->setIfExists('expiry_year', $data ?? [], null); + $this->setIfExists('holder_name', $data ?? [], null); + $this->setIfExists('issue_number', $data ?? [], null); + $this->setIfExists('number', $data ?? [], null); + $this->setIfExists('start_month', $data ?? [], null); + $this->setIfExists('start_year', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['expiry_year'] === null) { + $invalidProperties[] = "'expiry_year' can't be null"; + } + if ($this->container['holder_name'] === null) { + $invalidProperties[] = "'holder_name' 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 cvc + * + * @return string|null + */ + public function getCvc() + { + return $this->container['cvc']; + } + + /** + * Sets cvc + * + * @param string|null $cvc The [card verification code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. + * + * @return self + */ + public function setCvc($cvc) + { + if (is_null($cvc)) { + throw new \InvalidArgumentException('non-nullable cvc cannot be null'); + } + $this->container['cvc'] = $cvc; + + return $this; + } + + /** + * Gets expiry_month + * + * @return string|null + */ + public function getExpiryMonth() + { + return $this->container['expiry_month']; + } + + /** + * Sets expiry_month + * + * @param string|null $expiry_month The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November + * + * @return self + */ + public function setExpiryMonth($expiry_month) + { + if (is_null($expiry_month)) { + throw new \InvalidArgumentException('non-nullable expiry_month cannot be null'); + } + $this->container['expiry_month'] = $expiry_month; + + return $this; + } + + /** + * Gets expiry_year + * + * @return string + */ + public function getExpiryYear() + { + return $this->container['expiry_year']; + } + + /** + * Sets expiry_year + * + * @param string $expiry_year The card expiry year. Format: 4 digits. For example: 2020 + * + * @return self + */ + public function setExpiryYear($expiry_year) + { + if (is_null($expiry_year)) { + throw new \InvalidArgumentException('non-nullable expiry_year cannot be null'); + } + $this->container['expiry_year'] = $expiry_year; + + return $this; + } + + /** + * Gets holder_name + * + * @return string + */ + public function getHolderName() + { + return $this->container['holder_name']; + } + + /** + * Sets holder_name + * + * @param string $holder_name The name of the cardholder, as printed on the card. + * + * @return self + */ + public function setHolderName($holder_name) + { + if (is_null($holder_name)) { + throw new \InvalidArgumentException('non-nullable holder_name cannot be null'); + } + $this->container['holder_name'] = $holder_name; + + return $this; + } + + /** + * Gets issue_number + * + * @return string|null + */ + public function getIssueNumber() + { + return $this->container['issue_number']; + } + + /** + * Sets issue_number + * + * @param string|null $issue_number The issue number of the card (for some UK debit cards only). + * + * @return self + */ + public function setIssueNumber($issue_number) + { + if (is_null($issue_number)) { + throw new \InvalidArgumentException('non-nullable issue_number cannot be null'); + } + $this->container['issue_number'] = $issue_number; + + return $this; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. + * + * @return self + */ + public function setNumber($number) + { + if (is_null($number)) { + throw new \InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets start_month + * + * @return string|null + */ + public function getStartMonth() + { + return $this->container['start_month']; + } + + /** + * Sets start_month + * + * @param string|null $start_month The month component of the start date (for some UK debit cards only). + * + * @return self + */ + public function setStartMonth($start_month) + { + if (is_null($start_month)) { + throw new \InvalidArgumentException('non-nullable start_month cannot be null'); + } + $this->container['start_month'] = $start_month; + + return $this; + } + + /** + * Gets start_year + * + * @return string|null + */ + public function getStartYear() + { + return $this->container['start_year']; + } + + /** + * Sets start_year + * + * @param string|null $start_year The year component of the start date (for some UK debit cards only). + * + * @return self + */ + public function setStartYear($start_year) + { + if (is_null($start_year)) { + throw new \InvalidArgumentException('non-nullable start_year cannot be null'); + } + $this->container['start_year'] = $start_year; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/CommonField.php b/src/Adyen/Model/Payments/CommonField.php new file mode 100644 index 000000000..ccc1be173 --- /dev/null +++ b/src/Adyen/Model/Payments/CommonField.php @@ -0,0 +1,419 @@ + + */ +class CommonField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CommonField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the field. For example, Name of External Platform. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version Version of the field. For example, Version of External Platform. + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/DeviceRenderOptions.php b/src/Adyen/Model/Payments/DeviceRenderOptions.php new file mode 100644 index 000000000..22738f73e --- /dev/null +++ b/src/Adyen/Model/Payments/DeviceRenderOptions.php @@ -0,0 +1,483 @@ + + */ +class DeviceRenderOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeviceRenderOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sdk_interface' => 'string', + 'sdk_ui_type' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sdk_interface' => null, + 'sdk_ui_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sdk_interface' => false, + 'sdk_ui_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sdk_interface' => 'sdkInterface', + 'sdk_ui_type' => 'sdkUiType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sdk_interface' => 'setSdkInterface', + 'sdk_ui_type' => 'setSdkUiType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sdk_interface' => 'getSdkInterface', + 'sdk_ui_type' => 'getSdkUiType' + ]; + + /** + * 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 SDK_INTERFACE_NATIVE = 'native'; + public const SDK_INTERFACE_HTML = 'html'; + public const SDK_INTERFACE_BOTH = 'both'; + public const SDK_UI_TYPE_MULTI_SELECT = 'multiSelect'; + public const SDK_UI_TYPE_OTHER_HTML = 'otherHtml'; + public const SDK_UI_TYPE_OUT_OF_BAND = 'outOfBand'; + public const SDK_UI_TYPE_SINGLE_SELECT = 'singleSelect'; + public const SDK_UI_TYPE_TEXT = 'text'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSdkInterfaceAllowableValues() + { + return [ + self::SDK_INTERFACE_NATIVE, + self::SDK_INTERFACE_HTML, + self::SDK_INTERFACE_BOTH, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSdkUiTypeAllowableValues() + { + return [ + self::SDK_UI_TYPE_MULTI_SELECT, + self::SDK_UI_TYPE_OTHER_HTML, + self::SDK_UI_TYPE_OUT_OF_BAND, + self::SDK_UI_TYPE_SINGLE_SELECT, + self::SDK_UI_TYPE_TEXT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('sdk_interface', $data ?? [], 'both'); + $this->setIfExists('sdk_ui_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSdkInterfaceAllowableValues(); + if (!is_null($this->container['sdk_interface']) && !in_array($this->container['sdk_interface'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'sdk_interface', must be one of '%s'", + $this->container['sdk_interface'], + 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 sdk_interface + * + * @return string|null + */ + public function getSdkInterface() + { + return $this->container['sdk_interface']; + } + + /** + * Sets sdk_interface + * + * @param string|null $sdk_interface Supported SDK interface types. Allowed values: * native * html * both + * + * @return self + */ + public function setSdkInterface($sdk_interface) + { + if (is_null($sdk_interface)) { + throw new \InvalidArgumentException('non-nullable sdk_interface cannot be null'); + } + $allowedValues = $this->getSdkInterfaceAllowableValues(); + if (!in_array($sdk_interface, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'sdk_interface', must be one of '%s'", + $sdk_interface, + implode("', '", $allowedValues) + ) + ); + } + $this->container['sdk_interface'] = $sdk_interface; + + return $this; + } + + /** + * Gets sdk_ui_type + * + * @return string[]|null + */ + public function getSdkUiType() + { + return $this->container['sdk_ui_type']; + } + + /** + * Sets sdk_ui_type + * + * @param string[]|null $sdk_ui_type UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + * + * @return self + */ + public function setSdkUiType($sdk_ui_type) + { + if (is_null($sdk_ui_type)) { + throw new \InvalidArgumentException('non-nullable sdk_ui_type cannot be null'); + } + $allowedValues = $this->getSdkUiTypeAllowableValues(); + if (array_diff($sdk_ui_type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'sdk_ui_type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['sdk_ui_type'] = $sdk_ui_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/DonationRequest.php b/src/Adyen/Model/Payments/DonationRequest.php new file mode 100644 index 000000000..841419a89 --- /dev/null +++ b/src/Adyen/Model/Payments/DonationRequest.php @@ -0,0 +1,564 @@ + + */ +class DonationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DonationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'donation_account' => 'string', + 'merchant_account' => 'string', + 'modification_amount' => '\Adyen\Model\Payments\Amount', + 'original_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'donation_account' => null, + 'merchant_account' => null, + 'modification_amount' => null, + 'original_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'donation_account' => false, + 'merchant_account' => false, + 'modification_amount' => false, + 'original_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'donation_account' => 'donationAccount', + 'merchant_account' => 'merchantAccount', + 'modification_amount' => 'modificationAmount', + 'original_reference' => 'originalReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'donation_account' => 'setDonationAccount', + 'merchant_account' => 'setMerchantAccount', + 'modification_amount' => 'setModificationAmount', + 'original_reference' => 'setOriginalReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'donation_account' => 'getDonationAccount', + 'merchant_account' => 'getMerchantAccount', + 'modification_amount' => 'getModificationAmount', + 'original_reference' => 'getOriginalReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('donation_account', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('modification_amount', $data ?? [], null); + $this->setIfExists('original_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['donation_account'] === null) { + $invalidProperties[] = "'donation_account' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['modification_amount'] === null) { + $invalidProperties[] = "'modification_amount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets donation_account + * + * @return string + */ + public function getDonationAccount() + { + return $this->container['donation_account']; + } + + /** + * Sets donation_account + * + * @param string $donation_account The Adyen account name of the charity. + * + * @return self + */ + public function setDonationAccount($donation_account) + { + if (is_null($donation_account)) { + throw new \InvalidArgumentException('non-nullable donation_account cannot be null'); + } + $this->container['donation_account'] = $donation_account; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets modification_amount + * + * @return \Adyen\Model\Payments\Amount + */ + public function getModificationAmount() + { + return $this->container['modification_amount']; + } + + /** + * Sets modification_amount + * + * @param \Adyen\Model\Payments\Amount $modification_amount modification_amount + * + * @return self + */ + public function setModificationAmount($modification_amount) + { + if (is_null($modification_amount)) { + throw new \InvalidArgumentException('non-nullable modification_amount cannot be null'); + } + $this->container['modification_amount'] = $modification_amount; + + return $this; + } + + /** + * Gets original_reference + * + * @return string|null + */ + public function getOriginalReference() + { + return $this->container['original_reference']; + } + + /** + * Sets original_reference + * + * @param string|null $original_reference The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + * + * @return self + */ + public function setOriginalReference($original_reference) + { + if (is_null($original_reference)) { + throw new \InvalidArgumentException('non-nullable original_reference cannot be null'); + } + $this->container['original_reference'] = $original_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ExternalPlatform.php b/src/Adyen/Model/Payments/ExternalPlatform.php new file mode 100644 index 000000000..72b9ae066 --- /dev/null +++ b/src/Adyen/Model/Payments/ExternalPlatform.php @@ -0,0 +1,453 @@ + + */ +class ExternalPlatform implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExternalPlatform'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'integrator' => 'string', + 'name' => 'string', + 'version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'integrator' => null, + 'name' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'integrator' => false, + 'name' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'integrator' => 'integrator', + 'name' => 'name', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'integrator' => 'setIntegrator', + 'name' => 'setName', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'integrator' => 'getIntegrator', + 'name' => 'getName', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('integrator', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets integrator + * + * @return string|null + */ + public function getIntegrator() + { + return $this->container['integrator']; + } + + /** + * Sets integrator + * + * @param string|null $integrator External platform integrator. + * + * @return self + */ + public function setIntegrator($integrator) + { + if (is_null($integrator)) { + throw new \InvalidArgumentException('non-nullable integrator cannot be null'); + } + $this->container['integrator'] = $integrator; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the field. For example, Name of External Platform. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version Version of the field. For example, Version of External Platform. + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ForexQuote.php b/src/Adyen/Model/Payments/ForexQuote.php new file mode 100644 index 000000000..0f8976da4 --- /dev/null +++ b/src/Adyen/Model/Payments/ForexQuote.php @@ -0,0 +1,763 @@ + + */ +class ForexQuote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForexQuote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account' => 'string', + 'account_type' => 'string', + 'base_amount' => '\Adyen\Model\Payments\Amount', + 'base_points' => 'int', + 'buy' => '\Adyen\Model\Payments\Amount', + 'interbank' => '\Adyen\Model\Payments\Amount', + 'reference' => 'string', + 'sell' => '\Adyen\Model\Payments\Amount', + 'signature' => 'string', + 'source' => 'string', + 'type' => 'string', + 'valid_till' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account' => null, + 'account_type' => null, + 'base_amount' => null, + 'base_points' => 'int32', + 'buy' => null, + 'interbank' => null, + 'reference' => null, + 'sell' => null, + 'signature' => null, + 'source' => null, + 'type' => null, + 'valid_till' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account' => false, + 'account_type' => false, + 'base_amount' => false, + 'base_points' => true, + 'buy' => false, + 'interbank' => false, + 'reference' => false, + 'sell' => false, + 'signature' => false, + 'source' => false, + 'type' => false, + 'valid_till' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'account_type' => 'accountType', + 'base_amount' => 'baseAmount', + 'base_points' => 'basePoints', + 'buy' => 'buy', + 'interbank' => 'interbank', + 'reference' => 'reference', + 'sell' => 'sell', + 'signature' => 'signature', + 'source' => 'source', + 'type' => 'type', + 'valid_till' => 'validTill' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'account_type' => 'setAccountType', + 'base_amount' => 'setBaseAmount', + 'base_points' => 'setBasePoints', + 'buy' => 'setBuy', + 'interbank' => 'setInterbank', + 'reference' => 'setReference', + 'sell' => 'setSell', + 'signature' => 'setSignature', + 'source' => 'setSource', + 'type' => 'setType', + 'valid_till' => 'setValidTill' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'account_type' => 'getAccountType', + 'base_amount' => 'getBaseAmount', + 'base_points' => 'getBasePoints', + 'buy' => 'getBuy', + 'interbank' => 'getInterbank', + 'reference' => 'getReference', + 'sell' => 'getSell', + 'signature' => 'getSignature', + 'source' => 'getSource', + 'type' => 'getType', + 'valid_till' => 'getValidTill' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('account_type', $data ?? [], null); + $this->setIfExists('base_amount', $data ?? [], null); + $this->setIfExists('base_points', $data ?? [], null); + $this->setIfExists('buy', $data ?? [], null); + $this->setIfExists('interbank', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('sell', $data ?? [], null); + $this->setIfExists('signature', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('valid_till', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['base_points'] === null) { + $invalidProperties[] = "'base_points' can't be null"; + } + if ($this->container['valid_till'] === null) { + $invalidProperties[] = "'valid_till' 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 account + * + * @return string|null + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param string|null $account The account name. + * + * @return self + */ + public function setAccount($account) + { + if (is_null($account)) { + throw new \InvalidArgumentException('non-nullable account cannot be null'); + } + $this->container['account'] = $account; + + return $this; + } + + /** + * Gets account_type + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['account_type']; + } + + /** + * Sets account_type + * + * @param string|null $account_type The account type. + * + * @return self + */ + public function setAccountType($account_type) + { + if (is_null($account_type)) { + throw new \InvalidArgumentException('non-nullable account_type cannot be null'); + } + $this->container['account_type'] = $account_type; + + return $this; + } + + /** + * Gets base_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getBaseAmount() + { + return $this->container['base_amount']; + } + + /** + * Sets base_amount + * + * @param \Adyen\Model\Payments\Amount|null $base_amount base_amount + * + * @return self + */ + public function setBaseAmount($base_amount) + { + if (is_null($base_amount)) { + throw new \InvalidArgumentException('non-nullable base_amount cannot be null'); + } + $this->container['base_amount'] = $base_amount; + + return $this; + } + + /** + * Gets base_points + * + * @return int + */ + public function getBasePoints() + { + return $this->container['base_points']; + } + + /** + * Sets base_points + * + * @param int $base_points The base points. + * + * @return self + */ + public function setBasePoints($base_points) + { + // Do nothing for nullable integers + $this->container['base_points'] = $base_points; + + return $this; + } + + /** + * Gets buy + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getBuy() + { + return $this->container['buy']; + } + + /** + * Sets buy + * + * @param \Adyen\Model\Payments\Amount|null $buy buy + * + * @return self + */ + public function setBuy($buy) + { + if (is_null($buy)) { + throw new \InvalidArgumentException('non-nullable buy cannot be null'); + } + $this->container['buy'] = $buy; + + return $this; + } + + /** + * Gets interbank + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getInterbank() + { + return $this->container['interbank']; + } + + /** + * Sets interbank + * + * @param \Adyen\Model\Payments\Amount|null $interbank interbank + * + * @return self + */ + public function setInterbank($interbank) + { + if (is_null($interbank)) { + throw new \InvalidArgumentException('non-nullable interbank cannot be null'); + } + $this->container['interbank'] = $interbank; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference assigned to the forex quote request. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets sell + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getSell() + { + return $this->container['sell']; + } + + /** + * Sets sell + * + * @param \Adyen\Model\Payments\Amount|null $sell sell + * + * @return self + */ + public function setSell($sell) + { + if (is_null($sell)) { + throw new \InvalidArgumentException('non-nullable sell cannot be null'); + } + $this->container['sell'] = $sell; + + return $this; + } + + /** + * Gets signature + * + * @return string|null + */ + public function getSignature() + { + return $this->container['signature']; + } + + /** + * Sets signature + * + * @param string|null $signature The signature to validate the integrity. + * + * @return self + */ + public function setSignature($signature) + { + if (is_null($signature)) { + throw new \InvalidArgumentException('non-nullable signature cannot be null'); + } + $this->container['signature'] = $signature; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source The source of the forex quote. + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of forex. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets valid_till + * + * @return \DateTime + */ + public function getValidTill() + { + return $this->container['valid_till']; + } + + /** + * Sets valid_till + * + * @param \DateTime $valid_till The date until which the forex quote is valid. + * + * @return self + */ + public function setValidTill($valid_till) + { + if (is_null($valid_till)) { + throw new \InvalidArgumentException('non-nullable valid_till cannot be null'); + } + $this->container['valid_till'] = $valid_till; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/FraudCheckResult.php b/src/Adyen/Model/Payments/FraudCheckResult.php new file mode 100644 index 000000000..4ec55938e --- /dev/null +++ b/src/Adyen/Model/Payments/FraudCheckResult.php @@ -0,0 +1,458 @@ + + */ +class FraudCheckResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FraudCheckResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_score' => 'int', + 'check_id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_score' => 'int32', + 'check_id' => 'int32', + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_score' => true, + 'check_id' => true, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_score' => 'accountScore', + 'check_id' => 'checkId', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_score' => 'setAccountScore', + 'check_id' => 'setCheckId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_score' => 'getAccountScore', + 'check_id' => 'getCheckId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_score', $data ?? [], null); + $this->setIfExists('check_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_score'] === null) { + $invalidProperties[] = "'account_score' can't be null"; + } + if ($this->container['check_id'] === null) { + $invalidProperties[] = "'check_id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 account_score + * + * @return int + */ + public function getAccountScore() + { + return $this->container['account_score']; + } + + /** + * Sets account_score + * + * @param int $account_score The fraud score generated by the risk check. + * + * @return self + */ + public function setAccountScore($account_score) + { + // Do nothing for nullable integers + $this->container['account_score'] = $account_score; + + return $this; + } + + /** + * Gets check_id + * + * @return int + */ + public function getCheckId() + { + return $this->container['check_id']; + } + + /** + * Sets check_id + * + * @param int $check_id The ID of the risk check. + * + * @return self + */ + public function setCheckId($check_id) + { + // Do nothing for nullable integers + $this->container['check_id'] = $check_id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the risk check. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/FraudResult.php b/src/Adyen/Model/Payments/FraudResult.php new file mode 100644 index 000000000..74fe97725 --- /dev/null +++ b/src/Adyen/Model/Payments/FraudResult.php @@ -0,0 +1,420 @@ + + */ +class FraudResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FraudResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_score' => 'int', + 'results' => '\Adyen\Model\Payments\FraudCheckResult[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_score' => 'int32', + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_score' => true, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_score' => 'accountScore', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_score' => 'setAccountScore', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_score' => 'getAccountScore', + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_score', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['account_score'] === null) { + $invalidProperties[] = "'account_score' 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 account_score + * + * @return int + */ + public function getAccountScore() + { + return $this->container['account_score']; + } + + /** + * Sets account_score + * + * @param int $account_score The total fraud score generated by the risk checks. + * + * @return self + */ + public function setAccountScore($account_score) + { + // Do nothing for nullable integers + $this->container['account_score'] = $account_score; + + return $this; + } + + /** + * Gets results + * + * @return \Adyen\Model\Payments\FraudCheckResult[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \Adyen\Model\Payments\FraudCheckResult[]|null $results The result of the individual risk checks. + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/FundDestination.php b/src/Adyen/Model/Payments/FundDestination.php new file mode 100644 index 000000000..fa37b0601 --- /dev/null +++ b/src/Adyen/Model/Payments/FundDestination.php @@ -0,0 +1,657 @@ + + */ +class FundDestination implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FundDestination'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'billing_address' => '\Adyen\Model\Payments\Address', + 'card' => '\Adyen\Model\Payments\Card', + 'selected_recurring_detail_reference' => 'string', + 'shopper_email' => 'string', + 'shopper_name' => '\Adyen\Model\Payments\Name', + 'shopper_reference' => 'string', + 'sub_merchant' => '\Adyen\Model\Payments\SubMerchant', + 'telephone_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'billing_address' => null, + 'card' => null, + 'selected_recurring_detail_reference' => null, + 'shopper_email' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'sub_merchant' => null, + 'telephone_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'billing_address' => false, + 'card' => false, + 'selected_recurring_detail_reference' => false, + 'shopper_email' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'sub_merchant' => false, + 'telephone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'billing_address' => 'billingAddress', + 'card' => 'card', + 'selected_recurring_detail_reference' => 'selectedRecurringDetailReference', + 'shopper_email' => 'shopperEmail', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'sub_merchant' => 'subMerchant', + 'telephone_number' => 'telephoneNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'billing_address' => 'setBillingAddress', + 'card' => 'setCard', + 'selected_recurring_detail_reference' => 'setSelectedRecurringDetailReference', + 'shopper_email' => 'setShopperEmail', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'sub_merchant' => 'setSubMerchant', + 'telephone_number' => 'setTelephoneNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'billing_address' => 'getBillingAddress', + 'card' => 'getCard', + 'selected_recurring_detail_reference' => 'getSelectedRecurringDetailReference', + 'shopper_email' => 'getShopperEmail', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'sub_merchant' => 'getSubMerchant', + 'telephone_number' => 'getTelephoneNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('selected_recurring_detail_reference', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('sub_merchant', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data a map of name/value pairs for passing in additional/industry-specific data + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Payments\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\Payments\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\Payments\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets selected_recurring_detail_reference + * + * @return string|null + */ + public function getSelectedRecurringDetailReference() + { + return $this->container['selected_recurring_detail_reference']; + } + + /** + * Sets selected_recurring_detail_reference + * + * @param string|null $selected_recurring_detail_reference The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + * + * @return self + */ + public function setSelectedRecurringDetailReference($selected_recurring_detail_reference) + { + if (is_null($selected_recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable selected_recurring_detail_reference cannot be null'); + } + $this->container['selected_recurring_detail_reference'] = $selected_recurring_detail_reference; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email the email address of the person + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Payments\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Payments\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets sub_merchant + * + * @return \Adyen\Model\Payments\SubMerchant|null + */ + public function getSubMerchant() + { + return $this->container['sub_merchant']; + } + + /** + * Sets sub_merchant + * + * @param \Adyen\Model\Payments\SubMerchant|null $sub_merchant sub_merchant + * + * @return self + */ + public function setSubMerchant($sub_merchant) + { + if (is_null($sub_merchant)) { + throw new \InvalidArgumentException('non-nullable sub_merchant cannot be null'); + } + $this->container['sub_merchant'] = $sub_merchant; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number the telephone number of the person + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/FundSource.php b/src/Adyen/Model/Payments/FundSource.php new file mode 100644 index 000000000..85bf2a037 --- /dev/null +++ b/src/Adyen/Model/Payments/FundSource.php @@ -0,0 +1,555 @@ + + */ +class FundSource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FundSource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'billing_address' => '\Adyen\Model\Payments\Address', + 'card' => '\Adyen\Model\Payments\Card', + 'shopper_email' => 'string', + 'shopper_name' => '\Adyen\Model\Payments\Name', + 'telephone_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'billing_address' => null, + 'card' => null, + 'shopper_email' => null, + 'shopper_name' => null, + 'telephone_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'billing_address' => false, + 'card' => false, + 'shopper_email' => false, + 'shopper_name' => false, + 'telephone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'billing_address' => 'billingAddress', + 'card' => 'card', + 'shopper_email' => 'shopperEmail', + 'shopper_name' => 'shopperName', + 'telephone_number' => 'telephoneNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'billing_address' => 'setBillingAddress', + 'card' => 'setCard', + 'shopper_email' => 'setShopperEmail', + 'shopper_name' => 'setShopperName', + 'telephone_number' => 'setTelephoneNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'billing_address' => 'getBillingAddress', + 'card' => 'getCard', + 'shopper_email' => 'getShopperEmail', + 'shopper_name' => 'getShopperName', + 'telephone_number' => 'getTelephoneNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data A map of name-value pairs for passing additional or industry-specific data. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Payments\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\Payments\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\Payments\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email Email address of the person. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Payments\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Payments\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number Phone number of the person + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Installments.php b/src/Adyen/Model/Payments/Installments.php new file mode 100644 index 000000000..586055460 --- /dev/null +++ b/src/Adyen/Model/Payments/Installments.php @@ -0,0 +1,453 @@ + + */ +class Installments implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Installments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plan' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plan' => null, + 'value' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'plan' => false, + 'value' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plan' => 'plan', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plan' => 'setPlan', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plan' => 'getPlan', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const PLAN_REGULAR = 'regular'; + public const PLAN_REVOLVING = 'revolving'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPlanAllowableValues() + { + return [ + self::PLAN_REGULAR, + self::PLAN_REVOLVING, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('plan', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getPlanAllowableValues(); + if (!is_null($this->container['plan']) && !in_array($this->container['plan'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'plan', must be one of '%s'", + $this->container['plan'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plan + * + * @return string|null + */ + public function getPlan() + { + return $this->container['plan']; + } + + /** + * Sets plan + * + * @param string|null $plan The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + * + * @return self + */ + public function setPlan($plan) + { + if (is_null($plan)) { + throw new \InvalidArgumentException('non-nullable plan cannot be null'); + } + $allowedValues = $this->getPlanAllowableValues(); + if (!in_array($plan, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'plan', must be one of '%s'", + $plan, + implode("', '", $allowedValues) + ) + ); + } + $this->container['plan'] = $plan; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. + * + * @return self + */ + public function setValue($value) + { + // Do nothing for nullable integers + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Mandate.php b/src/Adyen/Model/Payments/Mandate.php new file mode 100644 index 000000000..cb3b1b888 --- /dev/null +++ b/src/Adyen/Model/Payments/Mandate.php @@ -0,0 +1,745 @@ + + */ +class Mandate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Mandate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => 'string', + 'amount_rule' => 'string', + 'billing_attempts_rule' => 'string', + 'billing_day' => 'string', + 'ends_at' => 'string', + 'frequency' => 'string', + 'remarks' => 'string', + 'starts_at' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'amount_rule' => null, + 'billing_attempts_rule' => null, + 'billing_day' => null, + 'ends_at' => null, + 'frequency' => null, + 'remarks' => null, + 'starts_at' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'amount_rule' => false, + 'billing_attempts_rule' => false, + 'billing_day' => false, + 'ends_at' => false, + 'frequency' => false, + 'remarks' => false, + 'starts_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'amount_rule' => 'amountRule', + 'billing_attempts_rule' => 'billingAttemptsRule', + 'billing_day' => 'billingDay', + 'ends_at' => 'endsAt', + 'frequency' => 'frequency', + 'remarks' => 'remarks', + 'starts_at' => 'startsAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'amount_rule' => 'setAmountRule', + 'billing_attempts_rule' => 'setBillingAttemptsRule', + 'billing_day' => 'setBillingDay', + 'ends_at' => 'setEndsAt', + 'frequency' => 'setFrequency', + 'remarks' => 'setRemarks', + 'starts_at' => 'setStartsAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'amount_rule' => 'getAmountRule', + 'billing_attempts_rule' => 'getBillingAttemptsRule', + 'billing_day' => 'getBillingDay', + 'ends_at' => 'getEndsAt', + 'frequency' => 'getFrequency', + 'remarks' => 'getRemarks', + 'starts_at' => 'getStartsAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const AMOUNT_RULE_MAX = 'max'; + public const AMOUNT_RULE_EXACT = 'exact'; + public const BILLING_ATTEMPTS_RULE_ON = 'on'; + public const BILLING_ATTEMPTS_RULE_BEFORE = 'before'; + public const BILLING_ATTEMPTS_RULE_AFTER = 'after'; + public const FREQUENCY_ADHOC = 'adhoc'; + public const FREQUENCY_DAILY = 'daily'; + public const FREQUENCY_WEEKLY = 'weekly'; + public const FREQUENCY_BI_WEEKLY = 'biWeekly'; + public const FREQUENCY_MONTHLY = 'monthly'; + public const FREQUENCY_QUARTERLY = 'quarterly'; + public const FREQUENCY_HALF_YEARLY = 'halfYearly'; + public const FREQUENCY_YEARLY = 'yearly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAmountRuleAllowableValues() + { + return [ + self::AMOUNT_RULE_MAX, + self::AMOUNT_RULE_EXACT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBillingAttemptsRuleAllowableValues() + { + return [ + self::BILLING_ATTEMPTS_RULE_ON, + self::BILLING_ATTEMPTS_RULE_BEFORE, + self::BILLING_ATTEMPTS_RULE_AFTER, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFrequencyAllowableValues() + { + return [ + self::FREQUENCY_ADHOC, + self::FREQUENCY_DAILY, + self::FREQUENCY_WEEKLY, + self::FREQUENCY_BI_WEEKLY, + self::FREQUENCY_MONTHLY, + self::FREQUENCY_QUARTERLY, + self::FREQUENCY_HALF_YEARLY, + self::FREQUENCY_YEARLY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('amount_rule', $data ?? [], null); + $this->setIfExists('billing_attempts_rule', $data ?? [], null); + $this->setIfExists('billing_day', $data ?? [], null); + $this->setIfExists('ends_at', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('remarks', $data ?? [], null); + $this->setIfExists('starts_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getAmountRuleAllowableValues(); + if (!is_null($this->container['amount_rule']) && !in_array($this->container['amount_rule'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'amount_rule', must be one of '%s'", + $this->container['amount_rule'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getBillingAttemptsRuleAllowableValues(); + if (!is_null($this->container['billing_attempts_rule']) && !in_array($this->container['billing_attempts_rule'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'billing_attempts_rule', must be one of '%s'", + $this->container['billing_attempts_rule'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['ends_at'] === null) { + $invalidProperties[] = "'ends_at' can't be null"; + } + if ($this->container['frequency'] === null) { + $invalidProperties[] = "'frequency' can't be null"; + } + $allowedValues = $this->getFrequencyAllowableValues(); + if (!is_null($this->container['frequency']) && !in_array($this->container['frequency'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'frequency', must be one of '%s'", + $this->container['frequency'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return string + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string $amount The billing amount (in minor units) of the recurring transactions. + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets amount_rule + * + * @return string|null + */ + public function getAmountRule() + { + return $this->container['amount_rule']; + } + + /** + * Sets amount_rule + * + * @param string|null $amount_rule The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + * + * @return self + */ + public function setAmountRule($amount_rule) + { + if (is_null($amount_rule)) { + throw new \InvalidArgumentException('non-nullable amount_rule cannot be null'); + } + $allowedValues = $this->getAmountRuleAllowableValues(); + if (!in_array($amount_rule, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'amount_rule', must be one of '%s'", + $amount_rule, + implode("', '", $allowedValues) + ) + ); + } + $this->container['amount_rule'] = $amount_rule; + + return $this; + } + + /** + * Gets billing_attempts_rule + * + * @return string|null + */ + public function getBillingAttemptsRule() + { + return $this->container['billing_attempts_rule']; + } + + /** + * Sets billing_attempts_rule + * + * @param string|null $billing_attempts_rule The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + * + * @return self + */ + public function setBillingAttemptsRule($billing_attempts_rule) + { + if (is_null($billing_attempts_rule)) { + throw new \InvalidArgumentException('non-nullable billing_attempts_rule cannot be null'); + } + $allowedValues = $this->getBillingAttemptsRuleAllowableValues(); + if (!in_array($billing_attempts_rule, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'billing_attempts_rule', must be one of '%s'", + $billing_attempts_rule, + implode("', '", $allowedValues) + ) + ); + } + $this->container['billing_attempts_rule'] = $billing_attempts_rule; + + return $this; + } + + /** + * Gets billing_day + * + * @return string|null + */ + public function getBillingDay() + { + return $this->container['billing_day']; + } + + /** + * Sets billing_day + * + * @param string|null $billing_day The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. + * + * @return self + */ + public function setBillingDay($billing_day) + { + if (is_null($billing_day)) { + throw new \InvalidArgumentException('non-nullable billing_day cannot be null'); + } + $this->container['billing_day'] = $billing_day; + + return $this; + } + + /** + * Gets ends_at + * + * @return string + */ + public function getEndsAt() + { + return $this->container['ends_at']; + } + + /** + * Sets ends_at + * + * @param string $ends_at End date of the billing plan, in YYYY-MM-DD format. + * + * @return self + */ + public function setEndsAt($ends_at) + { + if (is_null($ends_at)) { + throw new \InvalidArgumentException('non-nullable ends_at cannot be null'); + } + $this->container['ends_at'] = $ends_at; + + return $this; + } + + /** + * Gets frequency + * + * @return string + */ + public function getFrequency() + { + return $this->container['frequency']; + } + + /** + * Sets frequency + * + * @param string $frequency The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. + * + * @return self + */ + public function setFrequency($frequency) + { + if (is_null($frequency)) { + throw new \InvalidArgumentException('non-nullable frequency cannot be null'); + } + $allowedValues = $this->getFrequencyAllowableValues(); + if (!in_array($frequency, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'frequency', must be one of '%s'", + $frequency, + implode("', '", $allowedValues) + ) + ); + } + $this->container['frequency'] = $frequency; + + return $this; + } + + /** + * Gets remarks + * + * @return string|null + */ + public function getRemarks() + { + return $this->container['remarks']; + } + + /** + * Sets remarks + * + * @param string|null $remarks The message shown by UPI to the shopper on the approval screen. + * + * @return self + */ + public function setRemarks($remarks) + { + if (is_null($remarks)) { + throw new \InvalidArgumentException('non-nullable remarks cannot be null'); + } + $this->container['remarks'] = $remarks; + + return $this; + } + + /** + * Gets starts_at + * + * @return string|null + */ + public function getStartsAt() + { + return $this->container['starts_at']; + } + + /** + * Sets starts_at + * + * @param string|null $starts_at Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. + * + * @return self + */ + public function setStartsAt($starts_at) + { + if (is_null($starts_at)) { + throw new \InvalidArgumentException('non-nullable starts_at cannot be null'); + } + $this->container['starts_at'] = $starts_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 + ); + } +} diff --git a/src/Adyen/Model/Payments/MerchantDevice.php b/src/Adyen/Model/Payments/MerchantDevice.php new file mode 100644 index 000000000..041308c44 --- /dev/null +++ b/src/Adyen/Model/Payments/MerchantDevice.php @@ -0,0 +1,453 @@ + + */ +class MerchantDevice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantDevice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'os' => 'string', + 'os_version' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'os' => null, + 'os_version' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'os' => false, + 'os_version' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'os' => 'os', + 'os_version' => 'osVersion', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'os' => 'setOs', + 'os_version' => 'setOsVersion', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'os' => 'getOs', + 'os_version' => 'getOsVersion', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('os', $data ?? [], null); + $this->setIfExists('os_version', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets os + * + * @return string|null + */ + public function getOs() + { + return $this->container['os']; + } + + /** + * Sets os + * + * @param string|null $os Operating system running on the merchant device. + * + * @return self + */ + public function setOs($os) + { + if (is_null($os)) { + throw new \InvalidArgumentException('non-nullable os cannot be null'); + } + $this->container['os'] = $os; + + return $this; + } + + /** + * Gets os_version + * + * @return string|null + */ + public function getOsVersion() + { + return $this->container['os_version']; + } + + /** + * Sets os_version + * + * @param string|null $os_version Version of the operating system on the merchant device. + * + * @return self + */ + public function setOsVersion($os_version) + { + if (is_null($os_version)) { + throw new \InvalidArgumentException('non-nullable os_version cannot be null'); + } + $this->container['os_version'] = $os_version; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Merchant device reference. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/MerchantRiskIndicator.php b/src/Adyen/Model/Payments/MerchantRiskIndicator.php new file mode 100644 index 000000000..135345233 --- /dev/null +++ b/src/Adyen/Model/Payments/MerchantRiskIndicator.php @@ -0,0 +1,907 @@ + + */ +class MerchantRiskIndicator implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantRiskIndicator'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address_match' => 'bool', + 'delivery_address_indicator' => 'string', + 'delivery_email' => 'string', + 'delivery_email_address' => 'string', + 'delivery_timeframe' => 'string', + 'gift_card_amount' => '\Adyen\Model\Payments\Amount', + 'gift_card_count' => 'int', + 'gift_card_curr' => 'string', + 'pre_order_date' => '\DateTime', + 'pre_order_purchase' => 'bool', + 'pre_order_purchase_ind' => 'string', + 'reorder_items' => 'bool', + 'reorder_items_ind' => 'string', + 'ship_indicator' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address_match' => null, + 'delivery_address_indicator' => null, + 'delivery_email' => null, + 'delivery_email_address' => null, + 'delivery_timeframe' => null, + 'gift_card_amount' => null, + 'gift_card_count' => 'int32', + 'gift_card_curr' => null, + 'pre_order_date' => 'date-time', + 'pre_order_purchase' => null, + 'pre_order_purchase_ind' => null, + 'reorder_items' => null, + 'reorder_items_ind' => null, + 'ship_indicator' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address_match' => false, + 'delivery_address_indicator' => false, + 'delivery_email' => false, + 'delivery_email_address' => false, + 'delivery_timeframe' => false, + 'gift_card_amount' => false, + 'gift_card_count' => true, + 'gift_card_curr' => false, + 'pre_order_date' => false, + 'pre_order_purchase' => false, + 'pre_order_purchase_ind' => false, + 'reorder_items' => false, + 'reorder_items_ind' => false, + 'ship_indicator' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address_match' => 'addressMatch', + 'delivery_address_indicator' => 'deliveryAddressIndicator', + 'delivery_email' => 'deliveryEmail', + 'delivery_email_address' => 'deliveryEmailAddress', + 'delivery_timeframe' => 'deliveryTimeframe', + 'gift_card_amount' => 'giftCardAmount', + 'gift_card_count' => 'giftCardCount', + 'gift_card_curr' => 'giftCardCurr', + 'pre_order_date' => 'preOrderDate', + 'pre_order_purchase' => 'preOrderPurchase', + 'pre_order_purchase_ind' => 'preOrderPurchaseInd', + 'reorder_items' => 'reorderItems', + 'reorder_items_ind' => 'reorderItemsInd', + 'ship_indicator' => 'shipIndicator' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address_match' => 'setAddressMatch', + 'delivery_address_indicator' => 'setDeliveryAddressIndicator', + 'delivery_email' => 'setDeliveryEmail', + 'delivery_email_address' => 'setDeliveryEmailAddress', + 'delivery_timeframe' => 'setDeliveryTimeframe', + 'gift_card_amount' => 'setGiftCardAmount', + 'gift_card_count' => 'setGiftCardCount', + 'gift_card_curr' => 'setGiftCardCurr', + 'pre_order_date' => 'setPreOrderDate', + 'pre_order_purchase' => 'setPreOrderPurchase', + 'pre_order_purchase_ind' => 'setPreOrderPurchaseInd', + 'reorder_items' => 'setReorderItems', + 'reorder_items_ind' => 'setReorderItemsInd', + 'ship_indicator' => 'setShipIndicator' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address_match' => 'getAddressMatch', + 'delivery_address_indicator' => 'getDeliveryAddressIndicator', + 'delivery_email' => 'getDeliveryEmail', + 'delivery_email_address' => 'getDeliveryEmailAddress', + 'delivery_timeframe' => 'getDeliveryTimeframe', + 'gift_card_amount' => 'getGiftCardAmount', + 'gift_card_count' => 'getGiftCardCount', + 'gift_card_curr' => 'getGiftCardCurr', + 'pre_order_date' => 'getPreOrderDate', + 'pre_order_purchase' => 'getPreOrderPurchase', + 'pre_order_purchase_ind' => 'getPreOrderPurchaseInd', + 'reorder_items' => 'getReorderItems', + 'reorder_items_ind' => 'getReorderItemsInd', + 'ship_indicator' => 'getShipIndicator' + ]; + + /** + * 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 DELIVERY_ADDRESS_INDICATOR_SHIP_TO_BILLING_ADDRESS = 'shipToBillingAddress'; + public const DELIVERY_ADDRESS_INDICATOR_SHIP_TO_VERIFIED_ADDRESS = 'shipToVerifiedAddress'; + public const DELIVERY_ADDRESS_INDICATOR_SHIP_TO_NEW_ADDRESS = 'shipToNewAddress'; + public const DELIVERY_ADDRESS_INDICATOR_SHIP_TO_STORE = 'shipToStore'; + public const DELIVERY_ADDRESS_INDICATOR_DIGITAL_GOODS = 'digitalGoods'; + public const DELIVERY_ADDRESS_INDICATOR_GOODS_NOT_SHIPPED = 'goodsNotShipped'; + public const DELIVERY_ADDRESS_INDICATOR_OTHER = 'other'; + public const DELIVERY_TIMEFRAME_ELECTRONIC_DELIVERY = 'electronicDelivery'; + public const DELIVERY_TIMEFRAME_SAME_DAY_SHIPPING = 'sameDayShipping'; + public const DELIVERY_TIMEFRAME_OVERNIGHT_SHIPPING = 'overnightShipping'; + public const DELIVERY_TIMEFRAME_TWO_OR_MORE_DAYS_SHIPPING = 'twoOrMoreDaysShipping'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeliveryAddressIndicatorAllowableValues() + { + return [ + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_BILLING_ADDRESS, + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_VERIFIED_ADDRESS, + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_NEW_ADDRESS, + self::DELIVERY_ADDRESS_INDICATOR_SHIP_TO_STORE, + self::DELIVERY_ADDRESS_INDICATOR_DIGITAL_GOODS, + self::DELIVERY_ADDRESS_INDICATOR_GOODS_NOT_SHIPPED, + self::DELIVERY_ADDRESS_INDICATOR_OTHER, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDeliveryTimeframeAllowableValues() + { + return [ + self::DELIVERY_TIMEFRAME_ELECTRONIC_DELIVERY, + self::DELIVERY_TIMEFRAME_SAME_DAY_SHIPPING, + self::DELIVERY_TIMEFRAME_OVERNIGHT_SHIPPING, + self::DELIVERY_TIMEFRAME_TWO_OR_MORE_DAYS_SHIPPING, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address_match', $data ?? [], null); + $this->setIfExists('delivery_address_indicator', $data ?? [], null); + $this->setIfExists('delivery_email', $data ?? [], null); + $this->setIfExists('delivery_email_address', $data ?? [], null); + $this->setIfExists('delivery_timeframe', $data ?? [], null); + $this->setIfExists('gift_card_amount', $data ?? [], null); + $this->setIfExists('gift_card_count', $data ?? [], null); + $this->setIfExists('gift_card_curr', $data ?? [], null); + $this->setIfExists('pre_order_date', $data ?? [], null); + $this->setIfExists('pre_order_purchase', $data ?? [], null); + $this->setIfExists('pre_order_purchase_ind', $data ?? [], null); + $this->setIfExists('reorder_items', $data ?? [], null); + $this->setIfExists('reorder_items_ind', $data ?? [], null); + $this->setIfExists('ship_indicator', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getDeliveryAddressIndicatorAllowableValues(); + if (!is_null($this->container['delivery_address_indicator']) && !in_array($this->container['delivery_address_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'delivery_address_indicator', must be one of '%s'", + $this->container['delivery_address_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDeliveryTimeframeAllowableValues(); + if (!is_null($this->container['delivery_timeframe']) && !in_array($this->container['delivery_timeframe'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'delivery_timeframe', must be one of '%s'", + $this->container['delivery_timeframe'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address_match + * + * @return bool|null + */ + public function getAddressMatch() + { + return $this->container['address_match']; + } + + /** + * Sets address_match + * + * @param bool|null $address_match Whether the chosen delivery address is identical to the billing address. + * + * @return self + */ + public function setAddressMatch($address_match) + { + if (is_null($address_match)) { + throw new \InvalidArgumentException('non-nullable address_match cannot be null'); + } + $this->container['address_match'] = $address_match; + + return $this; + } + + /** + * Gets delivery_address_indicator + * + * @return string|null + */ + public function getDeliveryAddressIndicator() + { + return $this->container['delivery_address_indicator']; + } + + /** + * Sets delivery_address_indicator + * + * @param string|null $delivery_address_indicator Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` + * + * @return self + */ + public function setDeliveryAddressIndicator($delivery_address_indicator) + { + if (is_null($delivery_address_indicator)) { + throw new \InvalidArgumentException('non-nullable delivery_address_indicator cannot be null'); + } + $allowedValues = $this->getDeliveryAddressIndicatorAllowableValues(); + if (!in_array($delivery_address_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'delivery_address_indicator', must be one of '%s'", + $delivery_address_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['delivery_address_indicator'] = $delivery_address_indicator; + + return $this; + } + + /** + * Gets delivery_email + * + * @return string|null + * @deprecated + */ + public function getDeliveryEmail() + { + return $this->container['delivery_email']; + } + + /** + * Sets delivery_email + * + * @param string|null $delivery_email The delivery email address (for digital goods). + * + * @return self + * @deprecated + */ + public function setDeliveryEmail($delivery_email) + { + if (is_null($delivery_email)) { + throw new \InvalidArgumentException('non-nullable delivery_email cannot be null'); + } + $this->container['delivery_email'] = $delivery_email; + + return $this; + } + + /** + * Gets delivery_email_address + * + * @return string|null + */ + public function getDeliveryEmailAddress() + { + return $this->container['delivery_email_address']; + } + + /** + * Sets delivery_email_address + * + * @param string|null $delivery_email_address For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. + * + * @return self + */ + public function setDeliveryEmailAddress($delivery_email_address) + { + if (is_null($delivery_email_address)) { + throw new \InvalidArgumentException('non-nullable delivery_email_address cannot be null'); + } + $this->container['delivery_email_address'] = $delivery_email_address; + + return $this; + } + + /** + * Gets delivery_timeframe + * + * @return string|null + */ + public function getDeliveryTimeframe() + { + return $this->container['delivery_timeframe']; + } + + /** + * Sets delivery_timeframe + * + * @param string|null $delivery_timeframe The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` + * + * @return self + */ + public function setDeliveryTimeframe($delivery_timeframe) + { + if (is_null($delivery_timeframe)) { + throw new \InvalidArgumentException('non-nullable delivery_timeframe cannot be null'); + } + $allowedValues = $this->getDeliveryTimeframeAllowableValues(); + if (!in_array($delivery_timeframe, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'delivery_timeframe', must be one of '%s'", + $delivery_timeframe, + implode("', '", $allowedValues) + ) + ); + } + $this->container['delivery_timeframe'] = $delivery_timeframe; + + return $this; + } + + /** + * Gets gift_card_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getGiftCardAmount() + { + return $this->container['gift_card_amount']; + } + + /** + * Sets gift_card_amount + * + * @param \Adyen\Model\Payments\Amount|null $gift_card_amount gift_card_amount + * + * @return self + */ + public function setGiftCardAmount($gift_card_amount) + { + if (is_null($gift_card_amount)) { + throw new \InvalidArgumentException('non-nullable gift_card_amount cannot be null'); + } + $this->container['gift_card_amount'] = $gift_card_amount; + + return $this; + } + + /** + * Gets gift_card_count + * + * @return int|null + */ + public function getGiftCardCount() + { + return $this->container['gift_card_count']; + } + + /** + * Sets gift_card_count + * + * @param int|null $gift_card_count For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. + * + * @return self + */ + public function setGiftCardCount($gift_card_count) + { + // Do nothing for nullable integers + $this->container['gift_card_count'] = $gift_card_count; + + return $this; + } + + /** + * Gets gift_card_curr + * + * @return string|null + */ + public function getGiftCardCurr() + { + return $this->container['gift_card_curr']; + } + + /** + * Sets gift_card_curr + * + * @param string|null $gift_card_curr For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. + * + * @return self + */ + public function setGiftCardCurr($gift_card_curr) + { + if (is_null($gift_card_curr)) { + throw new \InvalidArgumentException('non-nullable gift_card_curr cannot be null'); + } + $this->container['gift_card_curr'] = $gift_card_curr; + + return $this; + } + + /** + * Gets pre_order_date + * + * @return \DateTime|null + */ + public function getPreOrderDate() + { + return $this->container['pre_order_date']; + } + + /** + * Sets pre_order_date + * + * @param \DateTime|null $pre_order_date For pre-order purchases, the expected date this product will be available to the shopper. + * + * @return self + */ + public function setPreOrderDate($pre_order_date) + { + if (is_null($pre_order_date)) { + throw new \InvalidArgumentException('non-nullable pre_order_date cannot be null'); + } + $this->container['pre_order_date'] = $pre_order_date; + + return $this; + } + + /** + * Gets pre_order_purchase + * + * @return bool|null + */ + public function getPreOrderPurchase() + { + return $this->container['pre_order_purchase']; + } + + /** + * Sets pre_order_purchase + * + * @param bool|null $pre_order_purchase Indicator for whether this transaction is for pre-ordering a product. + * + * @return self + */ + public function setPreOrderPurchase($pre_order_purchase) + { + if (is_null($pre_order_purchase)) { + throw new \InvalidArgumentException('non-nullable pre_order_purchase cannot be null'); + } + $this->container['pre_order_purchase'] = $pre_order_purchase; + + return $this; + } + + /** + * Gets pre_order_purchase_ind + * + * @return string|null + */ + public function getPreOrderPurchaseInd() + { + return $this->container['pre_order_purchase_ind']; + } + + /** + * Sets pre_order_purchase_ind + * + * @param string|null $pre_order_purchase_ind Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. + * + * @return self + */ + public function setPreOrderPurchaseInd($pre_order_purchase_ind) + { + if (is_null($pre_order_purchase_ind)) { + throw new \InvalidArgumentException('non-nullable pre_order_purchase_ind cannot be null'); + } + $this->container['pre_order_purchase_ind'] = $pre_order_purchase_ind; + + return $this; + } + + /** + * Gets reorder_items + * + * @return bool|null + */ + public function getReorderItems() + { + return $this->container['reorder_items']; + } + + /** + * Sets reorder_items + * + * @param bool|null $reorder_items Indicator for whether the shopper has already purchased the same items in the past. + * + * @return self + */ + public function setReorderItems($reorder_items) + { + if (is_null($reorder_items)) { + throw new \InvalidArgumentException('non-nullable reorder_items cannot be null'); + } + $this->container['reorder_items'] = $reorder_items; + + return $this; + } + + /** + * Gets reorder_items_ind + * + * @return string|null + */ + public function getReorderItemsInd() + { + return $this->container['reorder_items_ind']; + } + + /** + * Sets reorder_items_ind + * + * @param string|null $reorder_items_ind Indicates whether the cardholder is reordering previously purchased merchandise. + * + * @return self + */ + public function setReorderItemsInd($reorder_items_ind) + { + if (is_null($reorder_items_ind)) { + throw new \InvalidArgumentException('non-nullable reorder_items_ind cannot be null'); + } + $this->container['reorder_items_ind'] = $reorder_items_ind; + + return $this; + } + + /** + * Gets ship_indicator + * + * @return string|null + */ + public function getShipIndicator() + { + return $this->container['ship_indicator']; + } + + /** + * Sets ship_indicator + * + * @param string|null $ship_indicator Indicates shipping method chosen for the transaction. + * + * @return self + */ + public function setShipIndicator($ship_indicator) + { + if (is_null($ship_indicator)) { + throw new \InvalidArgumentException('non-nullable ship_indicator cannot be null'); + } + $this->container['ship_indicator'] = $ship_indicator; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ModelInterface.php b/src/Adyen/Model/Payments/ModelInterface.php new file mode 100644 index 000000000..5fbc74f03 --- /dev/null +++ b/src/Adyen/Model/Payments/ModelInterface.php @@ -0,0 +1,93 @@ + + */ +class ModificationResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModificationResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'psp_reference' => 'string', + 'response' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'psp_reference' => null, + 'response' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'psp_reference' => false, + 'response' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'psp_reference' => 'pspReference', + 'response' => 'response' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'psp_reference' => 'setPspReference', + 'response' => 'setResponse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'psp_reference' => 'getPspReference', + 'response' => 'getResponse' + ]; + + /** + * 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 RESPONSE_CAPTURE_RECEIVED = '[capture-received]'; + public const RESPONSE_CANCEL_RECEIVED = '[cancel-received]'; + public const RESPONSE_REFUND_RECEIVED = '[refund-received]'; + public const RESPONSE_CANCEL_OR_REFUND_RECEIVED = '[cancelOrRefund-received]'; + public const RESPONSE_ADJUST_AUTHORISATION_RECEIVED = '[adjustAuthorisation-received]'; + public const RESPONSE_DONATION_RECEIVED = '[donation-received]'; + public const RESPONSE_TECHNICAL_CANCEL_RECEIVED = '[technical-cancel-received]'; + public const RESPONSE_VOID_PENDING_REFUND_RECEIVED = '[voidPendingRefund-received]'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResponseAllowableValues() + { + return [ + self::RESPONSE_CAPTURE_RECEIVED, + self::RESPONSE_CANCEL_RECEIVED, + self::RESPONSE_REFUND_RECEIVED, + self::RESPONSE_CANCEL_OR_REFUND_RECEIVED, + self::RESPONSE_ADJUST_AUTHORISATION_RECEIVED, + self::RESPONSE_DONATION_RECEIVED, + self::RESPONSE_TECHNICAL_CANCEL_RECEIVED, + self::RESPONSE_VOID_PENDING_REFUND_RECEIVED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('response', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' can't be null"; + } + if ($this->container['response'] === null) { + $invalidProperties[] = "'response' can't be null"; + } + $allowedValues = $this->getResponseAllowableValues(); + if (!is_null($this->container['response']) && !in_array($this->container['response'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'response', must be one of '%s'", + $this->container['response'], + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be returned in a particular modification response. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets response + * + * @return string + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param string $response Indicates if the modification request has been received for processing. + * + * @return self + */ + public function setResponse($response) + { + if (is_null($response)) { + throw new \InvalidArgumentException('non-nullable response cannot be null'); + } + $allowedValues = $this->getResponseAllowableValues(); + if (!in_array($response, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'response', must be one of '%s'", + $response, + implode("', '", $allowedValues) + ) + ); + } + $this->container['response'] = $response; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Name.php b/src/Adyen/Model/Payments/Name.php new file mode 100644 index 000000000..6ba508659 --- /dev/null +++ b/src/Adyen/Model/Payments/Name.php @@ -0,0 +1,425 @@ + + */ +class Name implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Name'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string' + ]; + + /** + * 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 + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'first_name' => false, + 'last_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'firstName', + 'last_name' => 'lastName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['first_name'] === null) { + $invalidProperties[] = "'first_name' can't be null"; + } + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' 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 first_name + * + * @return string + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string $first_name The first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string $last_name The last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_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 + ); + } +} diff --git a/src/Adyen/Model/Payments/ObjectSerializer.php b/src/Adyen/Model/Payments/ObjectSerializer.php new file mode 100644 index 000000000..d996e79fd --- /dev/null +++ b/src/Adyen/Model/Payments/ObjectSerializer.php @@ -0,0 +1,318 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/Payments/PaymentRequest.php b/src/Adyen/Model/Payments/PaymentRequest.php new file mode 100644 index 000000000..2915882f8 --- /dev/null +++ b/src/Adyen/Model/Payments/PaymentRequest.php @@ -0,0 +1,2294 @@ + + */ +class PaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Payments\AccountInfo', + 'additional_amount' => '\Adyen\Model\Payments\Amount', + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Payments\Amount', + 'application_info' => '\Adyen\Model\Payments\ApplicationInfo', + 'bank_account' => '\Adyen\Model\Payments\BankAccount', + 'billing_address' => '\Adyen\Model\Payments\Address', + 'browser_info' => '\Adyen\Model\Payments\BrowserInfo', + 'capture_delay_hours' => 'int', + 'card' => '\Adyen\Model\Payments\Card', + 'date_of_birth' => '\DateTime', + 'dcc_quote' => '\Adyen\Model\Payments\ForexQuote', + 'delivery_address' => '\Adyen\Model\Payments\Address', + 'delivery_date' => '\DateTime', + 'device_fingerprint' => 'string', + 'entity_type' => 'string', + 'fraud_offset' => 'int', + 'fund_destination' => '\Adyen\Model\Payments\FundDestination', + 'fund_source' => '\Adyen\Model\Payments\FundSource', + 'funding_source' => 'string', + 'installments' => '\Adyen\Model\Payments\Installments', + 'localized_shopper_statement' => 'array', + 'mandate' => '\Adyen\Model\Payments\Mandate', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'merchant_risk_indicator' => '\Adyen\Model\Payments\MerchantRiskIndicator', + 'metadata' => 'array', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'nationality' => 'string', + 'order_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'recurring' => '\Adyen\Model\Payments\Recurring', + 'recurring_processing_model' => 'string', + 'reference' => 'string', + 'selected_brand' => 'string', + 'selected_recurring_detail_reference' => 'string', + 'session_id' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Payments\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'store' => 'string', + 'telephone_number' => 'string', + 'three_ds2_request_data' => '\Adyen\Model\Payments\ThreeDS2RequestData', + 'three_ds_authentication_only' => 'bool', + 'totals_group' => 'string', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_amount' => null, + 'additional_data' => null, + 'amount' => null, + 'application_info' => null, + 'bank_account' => null, + 'billing_address' => null, + 'browser_info' => null, + 'capture_delay_hours' => 'int32', + 'card' => null, + 'date_of_birth' => 'date', + 'dcc_quote' => null, + 'delivery_address' => null, + 'delivery_date' => 'date-time', + 'device_fingerprint' => null, + 'entity_type' => null, + 'fraud_offset' => 'int32', + 'fund_destination' => null, + 'fund_source' => null, + 'funding_source' => null, + 'installments' => null, + 'localized_shopper_statement' => null, + 'mandate' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'merchant_risk_indicator' => null, + 'metadata' => null, + 'mpi_data' => null, + 'nationality' => null, + 'order_reference' => null, + 'platform_chargeback_logic' => null, + 'recurring' => null, + 'recurring_processing_model' => null, + 'reference' => null, + 'selected_brand' => null, + 'selected_recurring_detail_reference' => null, + 'session_id' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'splits' => null, + 'store' => null, + 'telephone_number' => null, + 'three_ds2_request_data' => null, + 'three_ds_authentication_only' => null, + 'totals_group' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_amount' => false, + 'additional_data' => false, + 'amount' => false, + 'application_info' => false, + 'bank_account' => false, + 'billing_address' => false, + 'browser_info' => false, + 'capture_delay_hours' => true, + 'card' => false, + 'date_of_birth' => false, + 'dcc_quote' => false, + 'delivery_address' => false, + 'delivery_date' => false, + 'device_fingerprint' => false, + 'entity_type' => false, + 'fraud_offset' => true, + 'fund_destination' => false, + 'fund_source' => false, + 'funding_source' => false, + 'installments' => false, + 'localized_shopper_statement' => false, + 'mandate' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'merchant_risk_indicator' => false, + 'metadata' => false, + 'mpi_data' => false, + 'nationality' => false, + 'order_reference' => false, + 'platform_chargeback_logic' => false, + 'recurring' => false, + 'recurring_processing_model' => false, + 'reference' => false, + 'selected_brand' => false, + 'selected_recurring_detail_reference' => false, + 'session_id' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'splits' => false, + 'store' => false, + 'telephone_number' => false, + 'three_ds2_request_data' => false, + 'three_ds_authentication_only' => false, + 'totals_group' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_amount' => 'additionalAmount', + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'bank_account' => 'bankAccount', + 'billing_address' => 'billingAddress', + 'browser_info' => 'browserInfo', + 'capture_delay_hours' => 'captureDelayHours', + 'card' => 'card', + 'date_of_birth' => 'dateOfBirth', + 'dcc_quote' => 'dccQuote', + 'delivery_address' => 'deliveryAddress', + 'delivery_date' => 'deliveryDate', + 'device_fingerprint' => 'deviceFingerprint', + 'entity_type' => 'entityType', + 'fraud_offset' => 'fraudOffset', + 'fund_destination' => 'fundDestination', + 'fund_source' => 'fundSource', + 'funding_source' => 'fundingSource', + 'installments' => 'installments', + 'localized_shopper_statement' => 'localizedShopperStatement', + 'mandate' => 'mandate', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'merchant_risk_indicator' => 'merchantRiskIndicator', + 'metadata' => 'metadata', + 'mpi_data' => 'mpiData', + 'nationality' => 'nationality', + 'order_reference' => 'orderReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'recurring' => 'recurring', + 'recurring_processing_model' => 'recurringProcessingModel', + 'reference' => 'reference', + 'selected_brand' => 'selectedBrand', + 'selected_recurring_detail_reference' => 'selectedRecurringDetailReference', + 'session_id' => 'sessionId', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'splits' => 'splits', + 'store' => 'store', + 'telephone_number' => 'telephoneNumber', + 'three_ds2_request_data' => 'threeDS2RequestData', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'totals_group' => 'totalsGroup', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_amount' => 'setAdditionalAmount', + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'bank_account' => 'setBankAccount', + 'billing_address' => 'setBillingAddress', + 'browser_info' => 'setBrowserInfo', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'card' => 'setCard', + 'date_of_birth' => 'setDateOfBirth', + 'dcc_quote' => 'setDccQuote', + 'delivery_address' => 'setDeliveryAddress', + 'delivery_date' => 'setDeliveryDate', + 'device_fingerprint' => 'setDeviceFingerprint', + 'entity_type' => 'setEntityType', + 'fraud_offset' => 'setFraudOffset', + 'fund_destination' => 'setFundDestination', + 'fund_source' => 'setFundSource', + 'funding_source' => 'setFundingSource', + 'installments' => 'setInstallments', + 'localized_shopper_statement' => 'setLocalizedShopperStatement', + 'mandate' => 'setMandate', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'merchant_risk_indicator' => 'setMerchantRiskIndicator', + 'metadata' => 'setMetadata', + 'mpi_data' => 'setMpiData', + 'nationality' => 'setNationality', + 'order_reference' => 'setOrderReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'recurring' => 'setRecurring', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'reference' => 'setReference', + 'selected_brand' => 'setSelectedBrand', + 'selected_recurring_detail_reference' => 'setSelectedRecurringDetailReference', + 'session_id' => 'setSessionId', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds2_request_data' => 'setThreeDs2RequestData', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'totals_group' => 'setTotalsGroup', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_amount' => 'getAdditionalAmount', + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'bank_account' => 'getBankAccount', + 'billing_address' => 'getBillingAddress', + 'browser_info' => 'getBrowserInfo', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'card' => 'getCard', + 'date_of_birth' => 'getDateOfBirth', + 'dcc_quote' => 'getDccQuote', + 'delivery_address' => 'getDeliveryAddress', + 'delivery_date' => 'getDeliveryDate', + 'device_fingerprint' => 'getDeviceFingerprint', + 'entity_type' => 'getEntityType', + 'fraud_offset' => 'getFraudOffset', + 'fund_destination' => 'getFundDestination', + 'fund_source' => 'getFundSource', + 'funding_source' => 'getFundingSource', + 'installments' => 'getInstallments', + 'localized_shopper_statement' => 'getLocalizedShopperStatement', + 'mandate' => 'getMandate', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'merchant_risk_indicator' => 'getMerchantRiskIndicator', + 'metadata' => 'getMetadata', + 'mpi_data' => 'getMpiData', + 'nationality' => 'getNationality', + 'order_reference' => 'getOrderReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'recurring' => 'getRecurring', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'reference' => 'getReference', + 'selected_brand' => 'getSelectedBrand', + 'selected_recurring_detail_reference' => 'getSelectedRecurringDetailReference', + 'session_id' => 'getSessionId', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds2_request_data' => 'getThreeDs2RequestData', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'totals_group' => 'getTotalsGroup', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ENTITY_TYPE_NATURAL_PERSON = 'NaturalPerson'; + public const ENTITY_TYPE_COMPANY_NAME = 'CompanyName'; + public const FUNDING_SOURCE_DEBIT = 'debit'; + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEntityTypeAllowableValues() + { + return [ + self::ENTITY_TYPE_NATURAL_PERSON, + self::ENTITY_TYPE_COMPANY_NAME, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFundingSourceAllowableValues() + { + return [ + self::FUNDING_SOURCE_DEBIT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_amount', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('bank_account', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('browser_info', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('dcc_quote', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('delivery_date', $data ?? [], null); + $this->setIfExists('device_fingerprint', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('fund_destination', $data ?? [], null); + $this->setIfExists('fund_source', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('localized_shopper_statement', $data ?? [], null); + $this->setIfExists('mandate', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('merchant_risk_indicator', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('nationality', $data ?? [], null); + $this->setIfExists('order_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('recurring', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('selected_brand', $data ?? [], null); + $this->setIfExists('selected_recurring_detail_reference', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds2_request_data', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('totals_group', $data ?? [], null); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!is_null($this->container['entity_type']) && !in_array($this->container['entity_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'entity_type', must be one of '%s'", + $this->container['entity_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!is_null($this->container['funding_source']) && !in_array($this->container['funding_source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'funding_source', must be one of '%s'", + $this->container['funding_source'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + 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 account_info + * + * @return \Adyen\Model\Payments\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Payments\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additional_amount']; + } + + /** + * Sets additional_amount + * + * @param \Adyen\Model\Payments\Amount|null $additional_amount additional_amount + * + * @return self + */ + public function setAdditionalAmount($additional_amount) + { + if (is_null($additional_amount)) { + throw new \InvalidArgumentException('non-nullable additional_amount cannot be null'); + } + $this->container['additional_amount'] = $additional_amount; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Payments\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Payments\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Payments\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Payments\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets bank_account + * + * @return \Adyen\Model\Payments\BankAccount|null + */ + public function getBankAccount() + { + return $this->container['bank_account']; + } + + /** + * Sets bank_account + * + * @param \Adyen\Model\Payments\BankAccount|null $bank_account bank_account + * + * @return self + */ + public function setBankAccount($bank_account) + { + if (is_null($bank_account)) { + throw new \InvalidArgumentException('non-nullable bank_account cannot be null'); + } + $this->container['bank_account'] = $bank_account; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Payments\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets browser_info + * + * @return \Adyen\Model\Payments\BrowserInfo|null + */ + public function getBrowserInfo() + { + return $this->container['browser_info']; + } + + /** + * Sets browser_info + * + * @param \Adyen\Model\Payments\BrowserInfo|null $browser_info browser_info + * + * @return self + */ + public function setBrowserInfo($browser_info) + { + if (is_null($browser_info)) { + throw new \InvalidArgumentException('non-nullable browser_info cannot be null'); + } + $this->container['browser_info'] = $browser_info; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets card + * + * @return \Adyen\Model\Payments\Card|null + */ + public function getCard() + { + return $this->container['card']; + } + + /** + * Sets card + * + * @param \Adyen\Model\Payments\Card|null $card card + * + * @return self + */ + public function setCard($card) + { + if (is_null($card)) { + throw new \InvalidArgumentException('non-nullable card cannot be null'); + } + $this->container['card'] = $card; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets dcc_quote + * + * @return \Adyen\Model\Payments\ForexQuote|null + */ + public function getDccQuote() + { + return $this->container['dcc_quote']; + } + + /** + * Sets dcc_quote + * + * @param \Adyen\Model\Payments\ForexQuote|null $dcc_quote dcc_quote + * + * @return self + */ + public function setDccQuote($dcc_quote) + { + if (is_null($dcc_quote)) { + throw new \InvalidArgumentException('non-nullable dcc_quote cannot be null'); + } + $this->container['dcc_quote'] = $dcc_quote; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Payments\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets delivery_date + * + * @return \DateTime|null + */ + public function getDeliveryDate() + { + return $this->container['delivery_date']; + } + + /** + * Sets delivery_date + * + * @param \DateTime|null $delivery_date The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliveryDate($delivery_date) + { + if (is_null($delivery_date)) { + throw new \InvalidArgumentException('non-nullable delivery_date cannot be null'); + } + $this->container['delivery_date'] = $delivery_date; + + return $this; + } + + /** + * Gets device_fingerprint + * + * @return string|null + */ + public function getDeviceFingerprint() + { + return $this->container['device_fingerprint']; + } + + /** + * Sets device_fingerprint + * + * @param string|null $device_fingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + * + * @return self + */ + public function setDeviceFingerprint($device_fingerprint) + { + if (is_null($device_fingerprint)) { + throw new \InvalidArgumentException('non-nullable device_fingerprint cannot be null'); + } + $this->container['device_fingerprint'] = $device_fingerprint; + + return $this; + } + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type The type of the entity the payment is processed for. + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + throw new \InvalidArgumentException('non-nullable entity_type cannot be null'); + } + $allowedValues = $this->getEntityTypeAllowableValues(); + if (!in_array($entity_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'entity_type', must be one of '%s'", + $entity_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets fund_destination + * + * @return \Adyen\Model\Payments\FundDestination|null + */ + public function getFundDestination() + { + return $this->container['fund_destination']; + } + + /** + * Sets fund_destination + * + * @param \Adyen\Model\Payments\FundDestination|null $fund_destination fund_destination + * + * @return self + */ + public function setFundDestination($fund_destination) + { + if (is_null($fund_destination)) { + throw new \InvalidArgumentException('non-nullable fund_destination cannot be null'); + } + $this->container['fund_destination'] = $fund_destination; + + return $this; + } + + /** + * Gets fund_source + * + * @return \Adyen\Model\Payments\FundSource|null + */ + public function getFundSource() + { + return $this->container['fund_source']; + } + + /** + * Sets fund_source + * + * @param \Adyen\Model\Payments\FundSource|null $fund_source fund_source + * + * @return self + */ + public function setFundSource($fund_source) + { + if (is_null($fund_source)) { + throw new \InvalidArgumentException('non-nullable fund_source cannot be null'); + } + $this->container['fund_source'] = $fund_source; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $allowedValues = $this->getFundingSourceAllowableValues(); + if (!in_array($funding_source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'funding_source', must be one of '%s'", + $funding_source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Payments\Installments|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Payments\Installments|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets localized_shopper_statement + * + * @return array|null + */ + public function getLocalizedShopperStatement() + { + return $this->container['localized_shopper_statement']; + } + + /** + * Sets localized_shopper_statement + * + * @param array|null $localized_shopper_statement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * + * @return self + */ + public function setLocalizedShopperStatement($localized_shopper_statement) + { + if (is_null($localized_shopper_statement)) { + throw new \InvalidArgumentException('non-nullable localized_shopper_statement cannot be null'); + } + $this->container['localized_shopper_statement'] = $localized_shopper_statement; + + return $this; + } + + /** + * Gets mandate + * + * @return \Adyen\Model\Payments\Mandate|null + */ + public function getMandate() + { + return $this->container['mandate']; + } + + /** + * Sets mandate + * + * @param \Adyen\Model\Payments\Mandate|null $mandate mandate + * + * @return self + */ + public function setMandate($mandate) + { + if (is_null($mandate)) { + throw new \InvalidArgumentException('non-nullable mandate cannot be null'); + } + $this->container['mandate'] = $mandate; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets merchant_risk_indicator + * + * @return \Adyen\Model\Payments\MerchantRiskIndicator|null + */ + public function getMerchantRiskIndicator() + { + return $this->container['merchant_risk_indicator']; + } + + /** + * Sets merchant_risk_indicator + * + * @param \Adyen\Model\Payments\MerchantRiskIndicator|null $merchant_risk_indicator merchant_risk_indicator + * + * @return self + */ + public function setMerchantRiskIndicator($merchant_risk_indicator) + { + if (is_null($merchant_risk_indicator)) { + throw new \InvalidArgumentException('non-nullable merchant_risk_indicator cannot be null'); + } + $this->container['merchant_risk_indicator'] = $merchant_risk_indicator; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets nationality + * + * @return string|null + */ + public function getNationality() + { + return $this->container['nationality']; + } + + /** + * Sets nationality + * + * @param string|null $nationality The two-character country code of the shopper's nationality. + * + * @return self + */ + public function setNationality($nationality) + { + if (is_null($nationality)) { + throw new \InvalidArgumentException('non-nullable nationality cannot be null'); + } + $this->container['nationality'] = $nationality; + + return $this; + } + + /** + * Gets order_reference + * + * @return string|null + */ + public function getOrderReference() + { + return $this->container['order_reference']; + } + + /** + * Sets order_reference + * + * @param string|null $order_reference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + * + * @return self + */ + public function setOrderReference($order_reference) + { + if (is_null($order_reference)) { + throw new \InvalidArgumentException('non-nullable order_reference cannot be null'); + } + $this->container['order_reference'] = $order_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets recurring + * + * @return \Adyen\Model\Payments\Recurring|null + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param \Adyen\Model\Payments\Recurring|null $recurring recurring + * + * @return self + */ + public function setRecurring($recurring) + { + if (is_null($recurring)) { + throw new \InvalidArgumentException('non-nullable recurring cannot be null'); + } + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets selected_brand + * + * @return string|null + */ + public function getSelectedBrand() + { + return $this->container['selected_brand']; + } + + /** + * Sets selected_brand + * + * @param string|null $selected_brand Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + * + * @return self + */ + public function setSelectedBrand($selected_brand) + { + if (is_null($selected_brand)) { + throw new \InvalidArgumentException('non-nullable selected_brand cannot be null'); + } + $this->container['selected_brand'] = $selected_brand; + + return $this; + } + + /** + * Gets selected_recurring_detail_reference + * + * @return string|null + */ + public function getSelectedRecurringDetailReference() + { + return $this->container['selected_recurring_detail_reference']; + } + + /** + * Sets selected_recurring_detail_reference + * + * @param string|null $selected_recurring_detail_reference The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + * + * @return self + */ + public function setSelectedRecurringDetailReference($selected_recurring_detail_reference) + { + if (is_null($selected_recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable selected_recurring_detail_reference cannot be null'); + } + $this->container['selected_recurring_detail_reference'] = $selected_recurring_detail_reference; + + return $this; + } + + /** + * Gets session_id + * + * @return string|null + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string|null $session_id A session ID used to identify a payment session. + * + * @return self + */ + public function setSessionId($session_id) + { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } + $this->container['session_id'] = $session_id; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Payments\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Payments\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds2_request_data + * + * @return \Adyen\Model\Payments\ThreeDS2RequestData|null + */ + public function getThreeDs2RequestData() + { + return $this->container['three_ds2_request_data']; + } + + /** + * Sets three_ds2_request_data + * + * @param \Adyen\Model\Payments\ThreeDS2RequestData|null $three_ds2_request_data three_ds2_request_data + * + * @return self + */ + public function setThreeDs2RequestData($three_ds2_request_data) + { + if (is_null($three_ds2_request_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_request_data cannot be null'); + } + $this->container['three_ds2_request_data'] = $three_ds2_request_data; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets totals_group + * + * @return string|null + */ + public function getTotalsGroup() + { + return $this->container['totals_group']; + } + + /** + * Sets totals_group + * + * @param string|null $totals_group The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + * + * @return self + */ + public function setTotalsGroup($totals_group) + { + if (is_null($totals_group)) { + throw new \InvalidArgumentException('non-nullable totals_group cannot be null'); + } + $this->container['totals_group'] = $totals_group; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/PaymentRequest3d.php b/src/Adyen/Model/Payments/PaymentRequest3d.php new file mode 100644 index 000000000..a6667f34a --- /dev/null +++ b/src/Adyen/Model/Payments/PaymentRequest3d.php @@ -0,0 +1,1958 @@ + + */ +class PaymentRequest3d implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentRequest3d'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Payments\AccountInfo', + 'additional_amount' => '\Adyen\Model\Payments\Amount', + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Payments\Amount', + 'application_info' => '\Adyen\Model\Payments\ApplicationInfo', + 'billing_address' => '\Adyen\Model\Payments\Address', + 'browser_info' => '\Adyen\Model\Payments\BrowserInfo', + 'capture_delay_hours' => 'int', + 'date_of_birth' => '\DateTime', + 'dcc_quote' => '\Adyen\Model\Payments\ForexQuote', + 'delivery_address' => '\Adyen\Model\Payments\Address', + 'delivery_date' => '\DateTime', + 'device_fingerprint' => 'string', + 'fraud_offset' => 'int', + 'installments' => '\Adyen\Model\Payments\Installments', + 'localized_shopper_statement' => 'array', + 'mcc' => 'string', + 'md' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'merchant_risk_indicator' => '\Adyen\Model\Payments\MerchantRiskIndicator', + 'metadata' => 'array', + 'order_reference' => 'string', + 'pa_response' => 'string', + 'recurring' => '\Adyen\Model\Payments\Recurring', + 'recurring_processing_model' => 'string', + 'reference' => 'string', + 'selected_brand' => 'string', + 'selected_recurring_detail_reference' => 'string', + 'session_id' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Payments\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'store' => 'string', + 'telephone_number' => 'string', + 'three_ds2_request_data' => '\Adyen\Model\Payments\ThreeDS2RequestData', + 'three_ds_authentication_only' => 'bool', + 'totals_group' => 'string', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_amount' => null, + 'additional_data' => null, + 'amount' => null, + 'application_info' => null, + 'billing_address' => null, + 'browser_info' => null, + 'capture_delay_hours' => 'int32', + 'date_of_birth' => 'date', + 'dcc_quote' => null, + 'delivery_address' => null, + 'delivery_date' => 'date-time', + 'device_fingerprint' => null, + 'fraud_offset' => 'int32', + 'installments' => null, + 'localized_shopper_statement' => null, + 'mcc' => null, + 'md' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'merchant_risk_indicator' => null, + 'metadata' => null, + 'order_reference' => null, + 'pa_response' => null, + 'recurring' => null, + 'recurring_processing_model' => null, + 'reference' => null, + 'selected_brand' => null, + 'selected_recurring_detail_reference' => null, + 'session_id' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'splits' => null, + 'store' => null, + 'telephone_number' => null, + 'three_ds2_request_data' => null, + 'three_ds_authentication_only' => null, + 'totals_group' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_amount' => false, + 'additional_data' => false, + 'amount' => false, + 'application_info' => false, + 'billing_address' => false, + 'browser_info' => false, + 'capture_delay_hours' => true, + 'date_of_birth' => false, + 'dcc_quote' => false, + 'delivery_address' => false, + 'delivery_date' => false, + 'device_fingerprint' => false, + 'fraud_offset' => true, + 'installments' => false, + 'localized_shopper_statement' => false, + 'mcc' => false, + 'md' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'merchant_risk_indicator' => false, + 'metadata' => false, + 'order_reference' => false, + 'pa_response' => false, + 'recurring' => false, + 'recurring_processing_model' => false, + 'reference' => false, + 'selected_brand' => false, + 'selected_recurring_detail_reference' => false, + 'session_id' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'splits' => false, + 'store' => false, + 'telephone_number' => false, + 'three_ds2_request_data' => false, + 'three_ds_authentication_only' => false, + 'totals_group' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_amount' => 'additionalAmount', + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'billing_address' => 'billingAddress', + 'browser_info' => 'browserInfo', + 'capture_delay_hours' => 'captureDelayHours', + 'date_of_birth' => 'dateOfBirth', + 'dcc_quote' => 'dccQuote', + 'delivery_address' => 'deliveryAddress', + 'delivery_date' => 'deliveryDate', + 'device_fingerprint' => 'deviceFingerprint', + 'fraud_offset' => 'fraudOffset', + 'installments' => 'installments', + 'localized_shopper_statement' => 'localizedShopperStatement', + 'mcc' => 'mcc', + 'md' => 'md', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'merchant_risk_indicator' => 'merchantRiskIndicator', + 'metadata' => 'metadata', + 'order_reference' => 'orderReference', + 'pa_response' => 'paResponse', + 'recurring' => 'recurring', + 'recurring_processing_model' => 'recurringProcessingModel', + 'reference' => 'reference', + 'selected_brand' => 'selectedBrand', + 'selected_recurring_detail_reference' => 'selectedRecurringDetailReference', + 'session_id' => 'sessionId', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'splits' => 'splits', + 'store' => 'store', + 'telephone_number' => 'telephoneNumber', + 'three_ds2_request_data' => 'threeDS2RequestData', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'totals_group' => 'totalsGroup', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_amount' => 'setAdditionalAmount', + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'billing_address' => 'setBillingAddress', + 'browser_info' => 'setBrowserInfo', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'date_of_birth' => 'setDateOfBirth', + 'dcc_quote' => 'setDccQuote', + 'delivery_address' => 'setDeliveryAddress', + 'delivery_date' => 'setDeliveryDate', + 'device_fingerprint' => 'setDeviceFingerprint', + 'fraud_offset' => 'setFraudOffset', + 'installments' => 'setInstallments', + 'localized_shopper_statement' => 'setLocalizedShopperStatement', + 'mcc' => 'setMcc', + 'md' => 'setMd', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'merchant_risk_indicator' => 'setMerchantRiskIndicator', + 'metadata' => 'setMetadata', + 'order_reference' => 'setOrderReference', + 'pa_response' => 'setPaResponse', + 'recurring' => 'setRecurring', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'reference' => 'setReference', + 'selected_brand' => 'setSelectedBrand', + 'selected_recurring_detail_reference' => 'setSelectedRecurringDetailReference', + 'session_id' => 'setSessionId', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds2_request_data' => 'setThreeDs2RequestData', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'totals_group' => 'setTotalsGroup', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_amount' => 'getAdditionalAmount', + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'billing_address' => 'getBillingAddress', + 'browser_info' => 'getBrowserInfo', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'date_of_birth' => 'getDateOfBirth', + 'dcc_quote' => 'getDccQuote', + 'delivery_address' => 'getDeliveryAddress', + 'delivery_date' => 'getDeliveryDate', + 'device_fingerprint' => 'getDeviceFingerprint', + 'fraud_offset' => 'getFraudOffset', + 'installments' => 'getInstallments', + 'localized_shopper_statement' => 'getLocalizedShopperStatement', + 'mcc' => 'getMcc', + 'md' => 'getMd', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'merchant_risk_indicator' => 'getMerchantRiskIndicator', + 'metadata' => 'getMetadata', + 'order_reference' => 'getOrderReference', + 'pa_response' => 'getPaResponse', + 'recurring' => 'getRecurring', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'reference' => 'getReference', + 'selected_brand' => 'getSelectedBrand', + 'selected_recurring_detail_reference' => 'getSelectedRecurringDetailReference', + 'session_id' => 'getSessionId', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds2_request_data' => 'getThreeDs2RequestData', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'totals_group' => 'getTotalsGroup', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_amount', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('browser_info', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('dcc_quote', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('delivery_date', $data ?? [], null); + $this->setIfExists('device_fingerprint', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('localized_shopper_statement', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('md', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('merchant_risk_indicator', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('order_reference', $data ?? [], null); + $this->setIfExists('pa_response', $data ?? [], null); + $this->setIfExists('recurring', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('selected_brand', $data ?? [], null); + $this->setIfExists('selected_recurring_detail_reference', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds2_request_data', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('totals_group', $data ?? [], null); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['md'] === null) { + $invalidProperties[] = "'md' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['pa_response'] === null) { + $invalidProperties[] = "'pa_response' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + 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 account_info + * + * @return \Adyen\Model\Payments\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Payments\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additional_amount']; + } + + /** + * Sets additional_amount + * + * @param \Adyen\Model\Payments\Amount|null $additional_amount additional_amount + * + * @return self + */ + public function setAdditionalAmount($additional_amount) + { + if (is_null($additional_amount)) { + throw new \InvalidArgumentException('non-nullable additional_amount cannot be null'); + } + $this->container['additional_amount'] = $additional_amount; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Payments\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Payments\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Payments\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Payments\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets browser_info + * + * @return \Adyen\Model\Payments\BrowserInfo|null + */ + public function getBrowserInfo() + { + return $this->container['browser_info']; + } + + /** + * Sets browser_info + * + * @param \Adyen\Model\Payments\BrowserInfo|null $browser_info browser_info + * + * @return self + */ + public function setBrowserInfo($browser_info) + { + if (is_null($browser_info)) { + throw new \InvalidArgumentException('non-nullable browser_info cannot be null'); + } + $this->container['browser_info'] = $browser_info; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets dcc_quote + * + * @return \Adyen\Model\Payments\ForexQuote|null + */ + public function getDccQuote() + { + return $this->container['dcc_quote']; + } + + /** + * Sets dcc_quote + * + * @param \Adyen\Model\Payments\ForexQuote|null $dcc_quote dcc_quote + * + * @return self + */ + public function setDccQuote($dcc_quote) + { + if (is_null($dcc_quote)) { + throw new \InvalidArgumentException('non-nullable dcc_quote cannot be null'); + } + $this->container['dcc_quote'] = $dcc_quote; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Payments\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets delivery_date + * + * @return \DateTime|null + */ + public function getDeliveryDate() + { + return $this->container['delivery_date']; + } + + /** + * Sets delivery_date + * + * @param \DateTime|null $delivery_date The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliveryDate($delivery_date) + { + if (is_null($delivery_date)) { + throw new \InvalidArgumentException('non-nullable delivery_date cannot be null'); + } + $this->container['delivery_date'] = $delivery_date; + + return $this; + } + + /** + * Gets device_fingerprint + * + * @return string|null + */ + public function getDeviceFingerprint() + { + return $this->container['device_fingerprint']; + } + + /** + * Sets device_fingerprint + * + * @param string|null $device_fingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + * + * @return self + */ + public function setDeviceFingerprint($device_fingerprint) + { + if (is_null($device_fingerprint)) { + throw new \InvalidArgumentException('non-nullable device_fingerprint cannot be null'); + } + $this->container['device_fingerprint'] = $device_fingerprint; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Payments\Installments|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Payments\Installments|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets localized_shopper_statement + * + * @return array|null + */ + public function getLocalizedShopperStatement() + { + return $this->container['localized_shopper_statement']; + } + + /** + * Sets localized_shopper_statement + * + * @param array|null $localized_shopper_statement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * + * @return self + */ + public function setLocalizedShopperStatement($localized_shopper_statement) + { + if (is_null($localized_shopper_statement)) { + throw new \InvalidArgumentException('non-nullable localized_shopper_statement cannot be null'); + } + $this->container['localized_shopper_statement'] = $localized_shopper_statement; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets md + * + * @return string + */ + public function getMd() + { + return $this->container['md']; + } + + /** + * Sets md + * + * @param string $md The payment session identifier returned by the card issuer. + * + * @return self + */ + public function setMd($md) + { + if (is_null($md)) { + throw new \InvalidArgumentException('non-nullable md cannot be null'); + } + $this->container['md'] = $md; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets merchant_risk_indicator + * + * @return \Adyen\Model\Payments\MerchantRiskIndicator|null + */ + public function getMerchantRiskIndicator() + { + return $this->container['merchant_risk_indicator']; + } + + /** + * Sets merchant_risk_indicator + * + * @param \Adyen\Model\Payments\MerchantRiskIndicator|null $merchant_risk_indicator merchant_risk_indicator + * + * @return self + */ + public function setMerchantRiskIndicator($merchant_risk_indicator) + { + if (is_null($merchant_risk_indicator)) { + throw new \InvalidArgumentException('non-nullable merchant_risk_indicator cannot be null'); + } + $this->container['merchant_risk_indicator'] = $merchant_risk_indicator; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets order_reference + * + * @return string|null + */ + public function getOrderReference() + { + return $this->container['order_reference']; + } + + /** + * Sets order_reference + * + * @param string|null $order_reference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + * + * @return self + */ + public function setOrderReference($order_reference) + { + if (is_null($order_reference)) { + throw new \InvalidArgumentException('non-nullable order_reference cannot be null'); + } + $this->container['order_reference'] = $order_reference; + + return $this; + } + + /** + * Gets pa_response + * + * @return string + */ + public function getPaResponse() + { + return $this->container['pa_response']; + } + + /** + * Sets pa_response + * + * @param string $pa_response Payment authorisation response returned by the card issuer. The `paResponse` field holds the PaRes value received from the card issuer. + * + * @return self + */ + public function setPaResponse($pa_response) + { + if (is_null($pa_response)) { + throw new \InvalidArgumentException('non-nullable pa_response cannot be null'); + } + $this->container['pa_response'] = $pa_response; + + return $this; + } + + /** + * Gets recurring + * + * @return \Adyen\Model\Payments\Recurring|null + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param \Adyen\Model\Payments\Recurring|null $recurring recurring + * + * @return self + */ + public function setRecurring($recurring) + { + if (is_null($recurring)) { + throw new \InvalidArgumentException('non-nullable recurring cannot be null'); + } + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets selected_brand + * + * @return string|null + */ + public function getSelectedBrand() + { + return $this->container['selected_brand']; + } + + /** + * Sets selected_brand + * + * @param string|null $selected_brand Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + * + * @return self + */ + public function setSelectedBrand($selected_brand) + { + if (is_null($selected_brand)) { + throw new \InvalidArgumentException('non-nullable selected_brand cannot be null'); + } + $this->container['selected_brand'] = $selected_brand; + + return $this; + } + + /** + * Gets selected_recurring_detail_reference + * + * @return string|null + */ + public function getSelectedRecurringDetailReference() + { + return $this->container['selected_recurring_detail_reference']; + } + + /** + * Sets selected_recurring_detail_reference + * + * @param string|null $selected_recurring_detail_reference The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + * + * @return self + */ + public function setSelectedRecurringDetailReference($selected_recurring_detail_reference) + { + if (is_null($selected_recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable selected_recurring_detail_reference cannot be null'); + } + $this->container['selected_recurring_detail_reference'] = $selected_recurring_detail_reference; + + return $this; + } + + /** + * Gets session_id + * + * @return string|null + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string|null $session_id A session ID used to identify a payment session. + * + * @return self + */ + public function setSessionId($session_id) + { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } + $this->container['session_id'] = $session_id; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Payments\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Payments\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds2_request_data + * + * @return \Adyen\Model\Payments\ThreeDS2RequestData|null + */ + public function getThreeDs2RequestData() + { + return $this->container['three_ds2_request_data']; + } + + /** + * Sets three_ds2_request_data + * + * @param \Adyen\Model\Payments\ThreeDS2RequestData|null $three_ds2_request_data three_ds2_request_data + * + * @return self + */ + public function setThreeDs2RequestData($three_ds2_request_data) + { + if (is_null($three_ds2_request_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_request_data cannot be null'); + } + $this->container['three_ds2_request_data'] = $three_ds2_request_data; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets totals_group + * + * @return string|null + */ + public function getTotalsGroup() + { + return $this->container['totals_group']; + } + + /** + * Sets totals_group + * + * @param string|null $totals_group The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + * + * @return self + */ + public function setTotalsGroup($totals_group) + { + if (is_null($totals_group)) { + throw new \InvalidArgumentException('non-nullable totals_group cannot be null'); + } + $this->container['totals_group'] = $totals_group; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/PaymentRequest3ds2.php b/src/Adyen/Model/Payments/PaymentRequest3ds2.php new file mode 100644 index 000000000..175dd2c7f --- /dev/null +++ b/src/Adyen/Model/Payments/PaymentRequest3ds2.php @@ -0,0 +1,1958 @@ + + */ +class PaymentRequest3ds2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentRequest3ds2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_info' => '\Adyen\Model\Payments\AccountInfo', + 'additional_amount' => '\Adyen\Model\Payments\Amount', + 'additional_data' => 'array', + 'amount' => '\Adyen\Model\Payments\Amount', + 'application_info' => '\Adyen\Model\Payments\ApplicationInfo', + 'billing_address' => '\Adyen\Model\Payments\Address', + 'browser_info' => '\Adyen\Model\Payments\BrowserInfo', + 'capture_delay_hours' => 'int', + 'date_of_birth' => '\DateTime', + 'dcc_quote' => '\Adyen\Model\Payments\ForexQuote', + 'delivery_address' => '\Adyen\Model\Payments\Address', + 'delivery_date' => '\DateTime', + 'device_fingerprint' => 'string', + 'fraud_offset' => 'int', + 'installments' => '\Adyen\Model\Payments\Installments', + 'localized_shopper_statement' => 'array', + 'mcc' => 'string', + 'merchant_account' => 'string', + 'merchant_order_reference' => 'string', + 'merchant_risk_indicator' => '\Adyen\Model\Payments\MerchantRiskIndicator', + 'metadata' => 'array', + 'order_reference' => 'string', + 'recurring' => '\Adyen\Model\Payments\Recurring', + 'recurring_processing_model' => 'string', + 'reference' => 'string', + 'selected_brand' => 'string', + 'selected_recurring_detail_reference' => 'string', + 'session_id' => 'string', + 'shopper_email' => 'string', + 'shopper_ip' => 'string', + 'shopper_interaction' => 'string', + 'shopper_locale' => 'string', + 'shopper_name' => '\Adyen\Model\Payments\Name', + 'shopper_reference' => 'string', + 'shopper_statement' => 'string', + 'social_security_number' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'store' => 'string', + 'telephone_number' => 'string', + 'three_ds2_request_data' => '\Adyen\Model\Payments\ThreeDS2RequestData', + 'three_ds2_result' => '\Adyen\Model\Payments\ThreeDS2Result', + 'three_ds2_token' => 'string', + 'three_ds_authentication_only' => 'bool', + 'totals_group' => 'string', + 'trusted_shopper' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_info' => null, + 'additional_amount' => null, + 'additional_data' => null, + 'amount' => null, + 'application_info' => null, + 'billing_address' => null, + 'browser_info' => null, + 'capture_delay_hours' => 'int32', + 'date_of_birth' => 'date', + 'dcc_quote' => null, + 'delivery_address' => null, + 'delivery_date' => 'date-time', + 'device_fingerprint' => null, + 'fraud_offset' => 'int32', + 'installments' => null, + 'localized_shopper_statement' => null, + 'mcc' => null, + 'merchant_account' => null, + 'merchant_order_reference' => null, + 'merchant_risk_indicator' => null, + 'metadata' => null, + 'order_reference' => null, + 'recurring' => null, + 'recurring_processing_model' => null, + 'reference' => null, + 'selected_brand' => null, + 'selected_recurring_detail_reference' => null, + 'session_id' => null, + 'shopper_email' => null, + 'shopper_ip' => null, + 'shopper_interaction' => null, + 'shopper_locale' => null, + 'shopper_name' => null, + 'shopper_reference' => null, + 'shopper_statement' => null, + 'social_security_number' => null, + 'splits' => null, + 'store' => null, + 'telephone_number' => null, + 'three_ds2_request_data' => null, + 'three_ds2_result' => null, + 'three_ds2_token' => null, + 'three_ds_authentication_only' => null, + 'totals_group' => null, + 'trusted_shopper' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_info' => false, + 'additional_amount' => false, + 'additional_data' => false, + 'amount' => false, + 'application_info' => false, + 'billing_address' => false, + 'browser_info' => false, + 'capture_delay_hours' => true, + 'date_of_birth' => false, + 'dcc_quote' => false, + 'delivery_address' => false, + 'delivery_date' => false, + 'device_fingerprint' => false, + 'fraud_offset' => true, + 'installments' => false, + 'localized_shopper_statement' => false, + 'mcc' => false, + 'merchant_account' => false, + 'merchant_order_reference' => false, + 'merchant_risk_indicator' => false, + 'metadata' => false, + 'order_reference' => false, + 'recurring' => false, + 'recurring_processing_model' => false, + 'reference' => false, + 'selected_brand' => false, + 'selected_recurring_detail_reference' => false, + 'session_id' => false, + 'shopper_email' => false, + 'shopper_ip' => false, + 'shopper_interaction' => false, + 'shopper_locale' => false, + 'shopper_name' => false, + 'shopper_reference' => false, + 'shopper_statement' => false, + 'social_security_number' => false, + 'splits' => false, + 'store' => false, + 'telephone_number' => false, + 'three_ds2_request_data' => false, + 'three_ds2_result' => false, + 'three_ds2_token' => false, + 'three_ds_authentication_only' => false, + 'totals_group' => false, + 'trusted_shopper' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_info' => 'accountInfo', + 'additional_amount' => 'additionalAmount', + 'additional_data' => 'additionalData', + 'amount' => 'amount', + 'application_info' => 'applicationInfo', + 'billing_address' => 'billingAddress', + 'browser_info' => 'browserInfo', + 'capture_delay_hours' => 'captureDelayHours', + 'date_of_birth' => 'dateOfBirth', + 'dcc_quote' => 'dccQuote', + 'delivery_address' => 'deliveryAddress', + 'delivery_date' => 'deliveryDate', + 'device_fingerprint' => 'deviceFingerprint', + 'fraud_offset' => 'fraudOffset', + 'installments' => 'installments', + 'localized_shopper_statement' => 'localizedShopperStatement', + 'mcc' => 'mcc', + 'merchant_account' => 'merchantAccount', + 'merchant_order_reference' => 'merchantOrderReference', + 'merchant_risk_indicator' => 'merchantRiskIndicator', + 'metadata' => 'metadata', + 'order_reference' => 'orderReference', + 'recurring' => 'recurring', + 'recurring_processing_model' => 'recurringProcessingModel', + 'reference' => 'reference', + 'selected_brand' => 'selectedBrand', + 'selected_recurring_detail_reference' => 'selectedRecurringDetailReference', + 'session_id' => 'sessionId', + 'shopper_email' => 'shopperEmail', + 'shopper_ip' => 'shopperIP', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_locale' => 'shopperLocale', + 'shopper_name' => 'shopperName', + 'shopper_reference' => 'shopperReference', + 'shopper_statement' => 'shopperStatement', + 'social_security_number' => 'socialSecurityNumber', + 'splits' => 'splits', + 'store' => 'store', + 'telephone_number' => 'telephoneNumber', + 'three_ds2_request_data' => 'threeDS2RequestData', + 'three_ds2_result' => 'threeDS2Result', + 'three_ds2_token' => 'threeDS2Token', + 'three_ds_authentication_only' => 'threeDSAuthenticationOnly', + 'totals_group' => 'totalsGroup', + 'trusted_shopper' => 'trustedShopper' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_info' => 'setAccountInfo', + 'additional_amount' => 'setAdditionalAmount', + 'additional_data' => 'setAdditionalData', + 'amount' => 'setAmount', + 'application_info' => 'setApplicationInfo', + 'billing_address' => 'setBillingAddress', + 'browser_info' => 'setBrowserInfo', + 'capture_delay_hours' => 'setCaptureDelayHours', + 'date_of_birth' => 'setDateOfBirth', + 'dcc_quote' => 'setDccQuote', + 'delivery_address' => 'setDeliveryAddress', + 'delivery_date' => 'setDeliveryDate', + 'device_fingerprint' => 'setDeviceFingerprint', + 'fraud_offset' => 'setFraudOffset', + 'installments' => 'setInstallments', + 'localized_shopper_statement' => 'setLocalizedShopperStatement', + 'mcc' => 'setMcc', + 'merchant_account' => 'setMerchantAccount', + 'merchant_order_reference' => 'setMerchantOrderReference', + 'merchant_risk_indicator' => 'setMerchantRiskIndicator', + 'metadata' => 'setMetadata', + 'order_reference' => 'setOrderReference', + 'recurring' => 'setRecurring', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'reference' => 'setReference', + 'selected_brand' => 'setSelectedBrand', + 'selected_recurring_detail_reference' => 'setSelectedRecurringDetailReference', + 'session_id' => 'setSessionId', + 'shopper_email' => 'setShopperEmail', + 'shopper_ip' => 'setShopperIp', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_locale' => 'setShopperLocale', + 'shopper_name' => 'setShopperName', + 'shopper_reference' => 'setShopperReference', + 'shopper_statement' => 'setShopperStatement', + 'social_security_number' => 'setSocialSecurityNumber', + 'splits' => 'setSplits', + 'store' => 'setStore', + 'telephone_number' => 'setTelephoneNumber', + 'three_ds2_request_data' => 'setThreeDs2RequestData', + 'three_ds2_result' => 'setThreeDs2Result', + 'three_ds2_token' => 'setThreeDs2Token', + 'three_ds_authentication_only' => 'setThreeDsAuthenticationOnly', + 'totals_group' => 'setTotalsGroup', + 'trusted_shopper' => 'setTrustedShopper' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_info' => 'getAccountInfo', + 'additional_amount' => 'getAdditionalAmount', + 'additional_data' => 'getAdditionalData', + 'amount' => 'getAmount', + 'application_info' => 'getApplicationInfo', + 'billing_address' => 'getBillingAddress', + 'browser_info' => 'getBrowserInfo', + 'capture_delay_hours' => 'getCaptureDelayHours', + 'date_of_birth' => 'getDateOfBirth', + 'dcc_quote' => 'getDccQuote', + 'delivery_address' => 'getDeliveryAddress', + 'delivery_date' => 'getDeliveryDate', + 'device_fingerprint' => 'getDeviceFingerprint', + 'fraud_offset' => 'getFraudOffset', + 'installments' => 'getInstallments', + 'localized_shopper_statement' => 'getLocalizedShopperStatement', + 'mcc' => 'getMcc', + 'merchant_account' => 'getMerchantAccount', + 'merchant_order_reference' => 'getMerchantOrderReference', + 'merchant_risk_indicator' => 'getMerchantRiskIndicator', + 'metadata' => 'getMetadata', + 'order_reference' => 'getOrderReference', + 'recurring' => 'getRecurring', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'reference' => 'getReference', + 'selected_brand' => 'getSelectedBrand', + 'selected_recurring_detail_reference' => 'getSelectedRecurringDetailReference', + 'session_id' => 'getSessionId', + 'shopper_email' => 'getShopperEmail', + 'shopper_ip' => 'getShopperIp', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_locale' => 'getShopperLocale', + 'shopper_name' => 'getShopperName', + 'shopper_reference' => 'getShopperReference', + 'shopper_statement' => 'getShopperStatement', + 'social_security_number' => 'getSocialSecurityNumber', + 'splits' => 'getSplits', + 'store' => 'getStore', + 'telephone_number' => 'getTelephoneNumber', + 'three_ds2_request_data' => 'getThreeDs2RequestData', + 'three_ds2_result' => 'getThreeDs2Result', + 'three_ds2_token' => 'getThreeDs2Token', + 'three_ds_authentication_only' => 'getThreeDsAuthenticationOnly', + 'totals_group' => 'getTotalsGroup', + 'trusted_shopper' => 'getTrustedShopper' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + public const SHOPPER_INTERACTION_ECOMMERCE = 'Ecommerce'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'ContAuth'; + public const SHOPPER_INTERACTION_MOTO = 'Moto'; + public const SHOPPER_INTERACTION_POS = 'POS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_ECOMMERCE, + self::SHOPPER_INTERACTION_CONT_AUTH, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_info', $data ?? [], null); + $this->setIfExists('additional_amount', $data ?? [], null); + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('application_info', $data ?? [], null); + $this->setIfExists('billing_address', $data ?? [], null); + $this->setIfExists('browser_info', $data ?? [], null); + $this->setIfExists('capture_delay_hours', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('dcc_quote', $data ?? [], null); + $this->setIfExists('delivery_address', $data ?? [], null); + $this->setIfExists('delivery_date', $data ?? [], null); + $this->setIfExists('device_fingerprint', $data ?? [], null); + $this->setIfExists('fraud_offset', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('localized_shopper_statement', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_order_reference', $data ?? [], null); + $this->setIfExists('merchant_risk_indicator', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('order_reference', $data ?? [], null); + $this->setIfExists('recurring', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('selected_brand', $data ?? [], null); + $this->setIfExists('selected_recurring_detail_reference', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('shopper_email', $data ?? [], null); + $this->setIfExists('shopper_ip', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_locale', $data ?? [], null); + $this->setIfExists('shopper_name', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('social_security_number', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('telephone_number', $data ?? [], null); + $this->setIfExists('three_ds2_request_data', $data ?? [], null); + $this->setIfExists('three_ds2_result', $data ?? [], null); + $this->setIfExists('three_ds2_token', $data ?? [], null); + $this->setIfExists('three_ds_authentication_only', $data ?? [], false); + $this->setIfExists('totals_group', $data ?? [], null); + $this->setIfExists('trusted_shopper', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + 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 account_info + * + * @return \Adyen\Model\Payments\AccountInfo|null + */ + public function getAccountInfo() + { + return $this->container['account_info']; + } + + /** + * Sets account_info + * + * @param \Adyen\Model\Payments\AccountInfo|null $account_info account_info + * + * @return self + */ + public function setAccountInfo($account_info) + { + if (is_null($account_info)) { + throw new \InvalidArgumentException('non-nullable account_info cannot be null'); + } + $this->container['account_info'] = $account_info; + + return $this; + } + + /** + * Gets additional_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getAdditionalAmount() + { + return $this->container['additional_amount']; + } + + /** + * Sets additional_amount + * + * @param \Adyen\Model\Payments\Amount|null $additional_amount additional_amount + * + * @return self + */ + public function setAdditionalAmount($additional_amount) + { + if (is_null($additional_amount)) { + throw new \InvalidArgumentException('non-nullable additional_amount cannot be null'); + } + $this->container['additional_amount'] = $additional_amount; + + return $this; + } + + /** + * Gets additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Payments\Amount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Payments\Amount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets application_info + * + * @return \Adyen\Model\Payments\ApplicationInfo|null + */ + public function getApplicationInfo() + { + return $this->container['application_info']; + } + + /** + * Sets application_info + * + * @param \Adyen\Model\Payments\ApplicationInfo|null $application_info application_info + * + * @return self + */ + public function setApplicationInfo($application_info) + { + if (is_null($application_info)) { + throw new \InvalidArgumentException('non-nullable application_info cannot be null'); + } + $this->container['application_info'] = $application_info; + + return $this; + } + + /** + * Gets billing_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getBillingAddress() + { + return $this->container['billing_address']; + } + + /** + * Sets billing_address + * + * @param \Adyen\Model\Payments\Address|null $billing_address billing_address + * + * @return self + */ + public function setBillingAddress($billing_address) + { + if (is_null($billing_address)) { + throw new \InvalidArgumentException('non-nullable billing_address cannot be null'); + } + $this->container['billing_address'] = $billing_address; + + return $this; + } + + /** + * Gets browser_info + * + * @return \Adyen\Model\Payments\BrowserInfo|null + */ + public function getBrowserInfo() + { + return $this->container['browser_info']; + } + + /** + * Sets browser_info + * + * @param \Adyen\Model\Payments\BrowserInfo|null $browser_info browser_info + * + * @return self + */ + public function setBrowserInfo($browser_info) + { + if (is_null($browser_info)) { + throw new \InvalidArgumentException('non-nullable browser_info cannot be null'); + } + $this->container['browser_info'] = $browser_info; + + return $this; + } + + /** + * Gets capture_delay_hours + * + * @return int|null + */ + public function getCaptureDelayHours() + { + return $this->container['capture_delay_hours']; + } + + /** + * Sets capture_delay_hours + * + * @param int|null $capture_delay_hours The delay between the authorisation and scheduled auto-capture, specified in hours. + * + * @return self + */ + public function setCaptureDelayHours($capture_delay_hours) + { + // Do nothing for nullable integers + $this->container['capture_delay_hours'] = $capture_delay_hours; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + throw new \InvalidArgumentException('non-nullable date_of_birth cannot be null'); + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets dcc_quote + * + * @return \Adyen\Model\Payments\ForexQuote|null + */ + public function getDccQuote() + { + return $this->container['dcc_quote']; + } + + /** + * Sets dcc_quote + * + * @param \Adyen\Model\Payments\ForexQuote|null $dcc_quote dcc_quote + * + * @return self + */ + public function setDccQuote($dcc_quote) + { + if (is_null($dcc_quote)) { + throw new \InvalidArgumentException('non-nullable dcc_quote cannot be null'); + } + $this->container['dcc_quote'] = $dcc_quote; + + return $this; + } + + /** + * Gets delivery_address + * + * @return \Adyen\Model\Payments\Address|null + */ + public function getDeliveryAddress() + { + return $this->container['delivery_address']; + } + + /** + * Sets delivery_address + * + * @param \Adyen\Model\Payments\Address|null $delivery_address delivery_address + * + * @return self + */ + public function setDeliveryAddress($delivery_address) + { + if (is_null($delivery_address)) { + throw new \InvalidArgumentException('non-nullable delivery_address cannot be null'); + } + $this->container['delivery_address'] = $delivery_address; + + return $this; + } + + /** + * Gets delivery_date + * + * @return \DateTime|null + */ + public function getDeliveryDate() + { + return $this->container['delivery_date']; + } + + /** + * Sets delivery_date + * + * @param \DateTime|null $delivery_date The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + * + * @return self + */ + public function setDeliveryDate($delivery_date) + { + if (is_null($delivery_date)) { + throw new \InvalidArgumentException('non-nullable delivery_date cannot be null'); + } + $this->container['delivery_date'] = $delivery_date; + + return $this; + } + + /** + * Gets device_fingerprint + * + * @return string|null + */ + public function getDeviceFingerprint() + { + return $this->container['device_fingerprint']; + } + + /** + * Sets device_fingerprint + * + * @param string|null $device_fingerprint A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + * + * @return self + */ + public function setDeviceFingerprint($device_fingerprint) + { + if (is_null($device_fingerprint)) { + throw new \InvalidArgumentException('non-nullable device_fingerprint cannot be null'); + } + $this->container['device_fingerprint'] = $device_fingerprint; + + return $this; + } + + /** + * Gets fraud_offset + * + * @return int|null + */ + public function getFraudOffset() + { + return $this->container['fraud_offset']; + } + + /** + * Sets fraud_offset + * + * @param int|null $fraud_offset An integer value that is added to the normal fraud score. The value can be either positive or negative. + * + * @return self + */ + public function setFraudOffset($fraud_offset) + { + // Do nothing for nullable integers + $this->container['fraud_offset'] = $fraud_offset; + + return $this; + } + + /** + * Gets installments + * + * @return \Adyen\Model\Payments\Installments|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param \Adyen\Model\Payments\Installments|null $installments installments + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets localized_shopper_statement + * + * @return array|null + */ + public function getLocalizedShopperStatement() + { + return $this->container['localized_shopper_statement']; + } + + /** + * Sets localized_shopper_statement + * + * @param array|null $localized_shopper_statement This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * + * @return self + */ + public function setLocalizedShopperStatement($localized_shopper_statement) + { + if (is_null($localized_shopper_statement)) { + throw new \InvalidArgumentException('non-nullable localized_shopper_statement cannot be null'); + } + $this->container['localized_shopper_statement'] = $localized_shopper_statement; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_order_reference + * + * @return string|null + */ + public function getMerchantOrderReference() + { + return $this->container['merchant_order_reference']; + } + + /** + * Sets merchant_order_reference + * + * @param string|null $merchant_order_reference This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + * + * @return self + */ + public function setMerchantOrderReference($merchant_order_reference) + { + if (is_null($merchant_order_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_order_reference cannot be null'); + } + $this->container['merchant_order_reference'] = $merchant_order_reference; + + return $this; + } + + /** + * Gets merchant_risk_indicator + * + * @return \Adyen\Model\Payments\MerchantRiskIndicator|null + */ + public function getMerchantRiskIndicator() + { + return $this->container['merchant_risk_indicator']; + } + + /** + * Sets merchant_risk_indicator + * + * @param \Adyen\Model\Payments\MerchantRiskIndicator|null $merchant_risk_indicator merchant_risk_indicator + * + * @return self + */ + public function setMerchantRiskIndicator($merchant_risk_indicator) + { + if (is_null($merchant_risk_indicator)) { + throw new \InvalidArgumentException('non-nullable merchant_risk_indicator cannot be null'); + } + $this->container['merchant_risk_indicator'] = $merchant_risk_indicator; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets order_reference + * + * @return string|null + */ + public function getOrderReference() + { + return $this->container['order_reference']; + } + + /** + * Sets order_reference + * + * @param string|null $order_reference When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + * + * @return self + */ + public function setOrderReference($order_reference) + { + if (is_null($order_reference)) { + throw new \InvalidArgumentException('non-nullable order_reference cannot be null'); + } + $this->container['order_reference'] = $order_reference; + + return $this; + } + + /** + * Gets recurring + * + * @return \Adyen\Model\Payments\Recurring|null + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param \Adyen\Model\Payments\Recurring|null $recurring recurring + * + * @return self + */ + public function setRecurring($recurring) + { + if (is_null($recurring)) { + throw new \InvalidArgumentException('non-nullable recurring cannot be null'); + } + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets selected_brand + * + * @return string|null + */ + public function getSelectedBrand() + { + return $this->container['selected_brand']; + } + + /** + * Sets selected_brand + * + * @param string|null $selected_brand Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + * + * @return self + */ + public function setSelectedBrand($selected_brand) + { + if (is_null($selected_brand)) { + throw new \InvalidArgumentException('non-nullable selected_brand cannot be null'); + } + $this->container['selected_brand'] = $selected_brand; + + return $this; + } + + /** + * Gets selected_recurring_detail_reference + * + * @return string|null + */ + public function getSelectedRecurringDetailReference() + { + return $this->container['selected_recurring_detail_reference']; + } + + /** + * Sets selected_recurring_detail_reference + * + * @param string|null $selected_recurring_detail_reference The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + * + * @return self + */ + public function setSelectedRecurringDetailReference($selected_recurring_detail_reference) + { + if (is_null($selected_recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable selected_recurring_detail_reference cannot be null'); + } + $this->container['selected_recurring_detail_reference'] = $selected_recurring_detail_reference; + + return $this; + } + + /** + * Gets session_id + * + * @return string|null + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string|null $session_id A session ID used to identify a payment session. + * + * @return self + */ + public function setSessionId($session_id) + { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } + $this->container['session_id'] = $session_id; + + return $this; + } + + /** + * Gets shopper_email + * + * @return string|null + */ + public function getShopperEmail() + { + return $this->container['shopper_email']; + } + + /** + * Sets shopper_email + * + * @param string|null $shopper_email The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + * + * @return self + */ + public function setShopperEmail($shopper_email) + { + if (is_null($shopper_email)) { + throw new \InvalidArgumentException('non-nullable shopper_email cannot be null'); + } + $this->container['shopper_email'] = $shopper_email; + + return $this; + } + + /** + * Gets shopper_ip + * + * @return string|null + */ + public function getShopperIp() + { + return $this->container['shopper_ip']; + } + + /** + * Sets shopper_ip + * + * @param string|null $shopper_ip The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setShopperIp($shopper_ip) + { + if (is_null($shopper_ip)) { + throw new \InvalidArgumentException('non-nullable shopper_ip cannot be null'); + } + $this->container['shopper_ip'] = $shopper_ip; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_locale + * + * @return string|null + */ + public function getShopperLocale() + { + return $this->container['shopper_locale']; + } + + /** + * Sets shopper_locale + * + * @param string|null $shopper_locale The combination of a language code and a country code to specify the language to be used in the payment. + * + * @return self + */ + public function setShopperLocale($shopper_locale) + { + if (is_null($shopper_locale)) { + throw new \InvalidArgumentException('non-nullable shopper_locale cannot be null'); + } + $this->container['shopper_locale'] = $shopper_locale; + + return $this; + } + + /** + * Gets shopper_name + * + * @return \Adyen\Model\Payments\Name|null + */ + public function getShopperName() + { + return $this->container['shopper_name']; + } + + /** + * Sets shopper_name + * + * @param \Adyen\Model\Payments\Name|null $shopper_name shopper_name + * + * @return self + */ + public function setShopperName($shopper_name) + { + if (is_null($shopper_name)) { + throw new \InvalidArgumentException('non-nullable shopper_name cannot be null'); + } + $this->container['shopper_name'] = $shopper_name; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets social_security_number + * + * @return string|null + */ + public function getSocialSecurityNumber() + { + return $this->container['social_security_number']; + } + + /** + * Sets social_security_number + * + * @param string|null $social_security_number The shopper's social security number. + * + * @return self + */ + public function setSocialSecurityNumber($social_security_number) + { + if (is_null($social_security_number)) { + throw new \InvalidArgumentException('non-nullable social_security_number cannot be null'); + } + $this->container['social_security_number'] = $social_security_number; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The ecommerce or point-of-sale store that is processing the payment. Used in [partner model integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for Adyen for Platforms. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets telephone_number + * + * @return string|null + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param string|null $telephone_number The shopper's telephone number. + * + * @return self + */ + public function setTelephoneNumber($telephone_number) + { + if (is_null($telephone_number)) { + throw new \InvalidArgumentException('non-nullable telephone_number cannot be null'); + } + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + + /** + * Gets three_ds2_request_data + * + * @return \Adyen\Model\Payments\ThreeDS2RequestData|null + */ + public function getThreeDs2RequestData() + { + return $this->container['three_ds2_request_data']; + } + + /** + * Sets three_ds2_request_data + * + * @param \Adyen\Model\Payments\ThreeDS2RequestData|null $three_ds2_request_data three_ds2_request_data + * + * @return self + */ + public function setThreeDs2RequestData($three_ds2_request_data) + { + if (is_null($three_ds2_request_data)) { + throw new \InvalidArgumentException('non-nullable three_ds2_request_data cannot be null'); + } + $this->container['three_ds2_request_data'] = $three_ds2_request_data; + + return $this; + } + + /** + * Gets three_ds2_result + * + * @return \Adyen\Model\Payments\ThreeDS2Result|null + */ + public function getThreeDs2Result() + { + return $this->container['three_ds2_result']; + } + + /** + * Sets three_ds2_result + * + * @param \Adyen\Model\Payments\ThreeDS2Result|null $three_ds2_result three_ds2_result + * + * @return self + */ + public function setThreeDs2Result($three_ds2_result) + { + if (is_null($three_ds2_result)) { + throw new \InvalidArgumentException('non-nullable three_ds2_result cannot be null'); + } + $this->container['three_ds2_result'] = $three_ds2_result; + + return $this; + } + + /** + * Gets three_ds2_token + * + * @return string|null + */ + public function getThreeDs2Token() + { + return $this->container['three_ds2_token']; + } + + /** + * Sets three_ds2_token + * + * @param string|null $three_ds2_token The ThreeDS2Token that was returned in the /authorise call. + * + * @return self + */ + public function setThreeDs2Token($three_ds2_token) + { + if (is_null($three_ds2_token)) { + throw new \InvalidArgumentException('non-nullable three_ds2_token cannot be null'); + } + $this->container['three_ds2_token'] = $three_ds2_token; + + return $this; + } + + /** + * Gets three_ds_authentication_only + * + * @return bool|null + */ + public function getThreeDsAuthenticationOnly() + { + return $this->container['three_ds_authentication_only']; + } + + /** + * Sets three_ds_authentication_only + * + * @param bool|null $three_ds_authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + */ + public function setThreeDsAuthenticationOnly($three_ds_authentication_only) + { + if (is_null($three_ds_authentication_only)) { + throw new \InvalidArgumentException('non-nullable three_ds_authentication_only cannot be null'); + } + $this->container['three_ds_authentication_only'] = $three_ds_authentication_only; + + return $this; + } + + /** + * Gets totals_group + * + * @return string|null + */ + public function getTotalsGroup() + { + return $this->container['totals_group']; + } + + /** + * Sets totals_group + * + * @param string|null $totals_group The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + * + * @return self + */ + public function setTotalsGroup($totals_group) + { + if (is_null($totals_group)) { + throw new \InvalidArgumentException('non-nullable totals_group cannot be null'); + } + $this->container['totals_group'] = $totals_group; + + return $this; + } + + /** + * Gets trusted_shopper + * + * @return bool|null + */ + public function getTrustedShopper() + { + return $this->container['trusted_shopper']; + } + + /** + * Sets trusted_shopper + * + * @param bool|null $trusted_shopper Set to true if the payment should be routed to a trusted MID. + * + * @return self + */ + public function setTrustedShopper($trusted_shopper) + { + if (is_null($trusted_shopper)) { + throw new \InvalidArgumentException('non-nullable trusted_shopper cannot be null'); + } + $this->container['trusted_shopper'] = $trusted_shopper; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/PaymentResult.php b/src/Adyen/Model/Payments/PaymentResult.php new file mode 100644 index 000000000..ceba11cf5 --- /dev/null +++ b/src/Adyen/Model/Payments/PaymentResult.php @@ -0,0 +1,780 @@ + + */ +class PaymentResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'auth_code' => 'string', + 'dcc_amount' => '\Adyen\Model\Payments\Amount', + 'dcc_signature' => 'string', + 'fraud_result' => '\Adyen\Model\Payments\FraudResult', + 'issuer_url' => 'string', + 'md' => 'string', + 'pa_request' => 'string', + 'psp_reference' => 'string', + 'refusal_reason' => 'string', + 'result_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'auth_code' => null, + 'dcc_amount' => null, + 'dcc_signature' => null, + 'fraud_result' => null, + 'issuer_url' => null, + 'md' => null, + 'pa_request' => null, + 'psp_reference' => null, + 'refusal_reason' => null, + 'result_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'auth_code' => false, + 'dcc_amount' => false, + 'dcc_signature' => false, + 'fraud_result' => false, + 'issuer_url' => false, + 'md' => false, + 'pa_request' => false, + 'psp_reference' => false, + 'refusal_reason' => false, + 'result_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'auth_code' => 'authCode', + 'dcc_amount' => 'dccAmount', + 'dcc_signature' => 'dccSignature', + 'fraud_result' => 'fraudResult', + 'issuer_url' => 'issuerUrl', + 'md' => 'md', + 'pa_request' => 'paRequest', + 'psp_reference' => 'pspReference', + 'refusal_reason' => 'refusalReason', + 'result_code' => 'resultCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'auth_code' => 'setAuthCode', + 'dcc_amount' => 'setDccAmount', + 'dcc_signature' => 'setDccSignature', + 'fraud_result' => 'setFraudResult', + 'issuer_url' => 'setIssuerUrl', + 'md' => 'setMd', + 'pa_request' => 'setPaRequest', + 'psp_reference' => 'setPspReference', + 'refusal_reason' => 'setRefusalReason', + 'result_code' => 'setResultCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'auth_code' => 'getAuthCode', + 'dcc_amount' => 'getDccAmount', + 'dcc_signature' => 'getDccSignature', + 'fraud_result' => 'getFraudResult', + 'issuer_url' => 'getIssuerUrl', + 'md' => 'getMd', + 'pa_request' => 'getPaRequest', + 'psp_reference' => 'getPspReference', + 'refusal_reason' => 'getRefusalReason', + 'result_code' => 'getResultCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESULT_CODE_AUTHENTICATION_FINISHED = 'AuthenticationFinished'; + public const RESULT_CODE_AUTHENTICATION_NOT_REQUIRED = 'AuthenticationNotRequired'; + public const RESULT_CODE_AUTHORISED = 'Authorised'; + public const RESULT_CODE_CANCELLED = 'Cancelled'; + public const RESULT_CODE_CHALLENGE_SHOPPER = 'ChallengeShopper'; + public const RESULT_CODE_ERROR = 'Error'; + public const RESULT_CODE_IDENTIFY_SHOPPER = 'IdentifyShopper'; + public const RESULT_CODE_PENDING = 'Pending'; + public const RESULT_CODE_PRESENT_TO_SHOPPER = 'PresentToShopper'; + public const RESULT_CODE_RECEIVED = 'Received'; + public const RESULT_CODE_REDIRECT_SHOPPER = 'RedirectShopper'; + public const RESULT_CODE_REFUSED = 'Refused'; + public const RESULT_CODE_SUCCESS = 'Success'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResultCodeAllowableValues() + { + return [ + self::RESULT_CODE_AUTHENTICATION_FINISHED, + self::RESULT_CODE_AUTHENTICATION_NOT_REQUIRED, + self::RESULT_CODE_AUTHORISED, + self::RESULT_CODE_CANCELLED, + self::RESULT_CODE_CHALLENGE_SHOPPER, + self::RESULT_CODE_ERROR, + self::RESULT_CODE_IDENTIFY_SHOPPER, + self::RESULT_CODE_PENDING, + self::RESULT_CODE_PRESENT_TO_SHOPPER, + self::RESULT_CODE_RECEIVED, + self::RESULT_CODE_REDIRECT_SHOPPER, + self::RESULT_CODE_REFUSED, + self::RESULT_CODE_SUCCESS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('auth_code', $data ?? [], null); + $this->setIfExists('dcc_amount', $data ?? [], null); + $this->setIfExists('dcc_signature', $data ?? [], null); + $this->setIfExists('fraud_result', $data ?? [], null); + $this->setIfExists('issuer_url', $data ?? [], null); + $this->setIfExists('md', $data ?? [], null); + $this->setIfExists('pa_request', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('refusal_reason', $data ?? [], null); + $this->setIfExists('result_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getResultCodeAllowableValues(); + if (!is_null($this->container['result_code']) && !in_array($this->container['result_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'result_code', must be one of '%s'", + $this->container['result_code'], + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets auth_code + * + * @return string|null + */ + public function getAuthCode() + { + return $this->container['auth_code']; + } + + /** + * Sets auth_code + * + * @param string|null $auth_code Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + * + * @return self + */ + public function setAuthCode($auth_code) + { + if (is_null($auth_code)) { + throw new \InvalidArgumentException('non-nullable auth_code cannot be null'); + } + $this->container['auth_code'] = $auth_code; + + return $this; + } + + /** + * Gets dcc_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getDccAmount() + { + return $this->container['dcc_amount']; + } + + /** + * Sets dcc_amount + * + * @param \Adyen\Model\Payments\Amount|null $dcc_amount dcc_amount + * + * @return self + */ + public function setDccAmount($dcc_amount) + { + if (is_null($dcc_amount)) { + throw new \InvalidArgumentException('non-nullable dcc_amount cannot be null'); + } + $this->container['dcc_amount'] = $dcc_amount; + + return $this; + } + + /** + * Gets dcc_signature + * + * @return string|null + */ + public function getDccSignature() + { + return $this->container['dcc_signature']; + } + + /** + * Sets dcc_signature + * + * @param string|null $dcc_signature Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + * + * @return self + */ + public function setDccSignature($dcc_signature) + { + if (is_null($dcc_signature)) { + throw new \InvalidArgumentException('non-nullable dcc_signature cannot be null'); + } + $this->container['dcc_signature'] = $dcc_signature; + + return $this; + } + + /** + * Gets fraud_result + * + * @return \Adyen\Model\Payments\FraudResult|null + */ + public function getFraudResult() + { + return $this->container['fraud_result']; + } + + /** + * Sets fraud_result + * + * @param \Adyen\Model\Payments\FraudResult|null $fraud_result fraud_result + * + * @return self + */ + public function setFraudResult($fraud_result) + { + if (is_null($fraud_result)) { + throw new \InvalidArgumentException('non-nullable fraud_result cannot be null'); + } + $this->container['fraud_result'] = $fraud_result; + + return $this; + } + + /** + * Gets issuer_url + * + * @return string|null + */ + public function getIssuerUrl() + { + return $this->container['issuer_url']; + } + + /** + * Sets issuer_url + * + * @param string|null $issuer_url The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. + * + * @return self + */ + public function setIssuerUrl($issuer_url) + { + if (is_null($issuer_url)) { + throw new \InvalidArgumentException('non-nullable issuer_url cannot be null'); + } + $this->container['issuer_url'] = $issuer_url; + + return $this; + } + + /** + * Gets md + * + * @return string|null + */ + public function getMd() + { + return $this->container['md']; + } + + /** + * Sets md + * + * @param string|null $md The payment session. + * + * @return self + */ + public function setMd($md) + { + if (is_null($md)) { + throw new \InvalidArgumentException('non-nullable md cannot be null'); + } + $this->container['md'] = $md; + + return $this; + } + + /** + * Gets pa_request + * + * @return string|null + */ + public function getPaRequest() + { + return $this->container['pa_request']; + } + + /** + * Sets pa_request + * + * @param string|null $pa_request The 3D request data for the issuer. If the value is **CUPSecurePlus-CollectSMSVerificationCode**, collect an SMS code from the shopper and pass it in the `/authorise3D` request. For more information, see [3D Secure](https://docs.adyen.com/classic-integration/3d-secure). + * + * @return self + */ + public function setPaRequest($pa_request) + { + if (is_null($pa_request)) { + throw new \InvalidArgumentException('non-nullable pa_request cannot be null'); + } + $this->container['pa_request'] = $pa_request; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets refusal_reason + * + * @return string|null + */ + public function getRefusalReason() + { + return $this->container['refusal_reason']; + } + + /** + * Sets refusal_reason + * + * @param string|null $refusal_reason If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + * + * @return self + */ + public function setRefusalReason($refusal_reason) + { + if (is_null($refusal_reason)) { + throw new \InvalidArgumentException('non-nullable refusal_reason cannot be null'); + } + $this->container['refusal_reason'] = $refusal_reason; + + return $this; + } + + /** + * Gets result_code + * + * @return string|null + */ + public function getResultCode() + { + return $this->container['result_code']; + } + + /** + * Sets result_code + * + * @param string|null $result_code The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + * + * @return self + */ + public function setResultCode($result_code) + { + if (is_null($result_code)) { + throw new \InvalidArgumentException('non-nullable result_code cannot be null'); + } + $allowedValues = $this->getResultCodeAllowableValues(); + if (!in_array($result_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'result_code', must be one of '%s'", + $result_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['result_code'] = $result_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Phone.php b/src/Adyen/Model/Payments/Phone.php new file mode 100644 index 000000000..f0f64846a --- /dev/null +++ b/src/Adyen/Model/Payments/Phone.php @@ -0,0 +1,419 @@ + + */ +class Phone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Phone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cc' => 'string', + 'subscriber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cc' => null, + 'subscriber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cc' => false, + 'subscriber' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cc' => 'cc', + 'subscriber' => 'subscriber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cc' => 'setCc', + 'subscriber' => 'setSubscriber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cc' => 'getCc', + 'subscriber' => 'getSubscriber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cc', $data ?? [], null); + $this->setIfExists('subscriber', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cc + * + * @return string|null + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param string|null $cc Country code. Length: 1–3 characters. + * + * @return self + */ + public function setCc($cc) + { + if (is_null($cc)) { + throw new \InvalidArgumentException('non-nullable cc cannot be null'); + } + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets subscriber + * + * @return string|null + */ + public function getSubscriber() + { + return $this->container['subscriber']; + } + + /** + * Sets subscriber + * + * @param string|null $subscriber Subscriber number. Maximum length: 15 characters. + * + * @return self + */ + public function setSubscriber($subscriber) + { + if (is_null($subscriber)) { + throw new \InvalidArgumentException('non-nullable subscriber cannot be null'); + } + $this->container['subscriber'] = $subscriber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/PlatformChargebackLogic.php b/src/Adyen/Model/Payments/PlatformChargebackLogic.php new file mode 100644 index 000000000..27b44e584 --- /dev/null +++ b/src/Adyen/Model/Payments/PlatformChargebackLogic.php @@ -0,0 +1,454 @@ + + */ +class PlatformChargebackLogic implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PlatformChargebackLogic'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'behavior' => 'string', + 'target_account' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'behavior' => null, + 'target_account' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'behavior' => false, + 'target_account' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'behavior' => 'behavior', + 'target_account' => 'targetAccount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'behavior' => 'setBehavior', + 'target_account' => 'setTargetAccount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'behavior' => 'getBehavior', + 'target_account' => 'getTargetAccount' + ]; + + /** + * 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 BEHAVIOR_DEDUCT_ACCORDING_TO_SPLIT_RATIO = 'deductAccordingToSplitRatio'; + public const BEHAVIOR_DEDUCT_FROM_LIABLE_ACCOUNT = 'deductFromLiableAccount'; + public const BEHAVIOR_DEDUCT_FROM_ONE_BALANCE_ACCOUNT = 'deductFromOneBalanceAccount'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBehaviorAllowableValues() + { + return [ + self::BEHAVIOR_DEDUCT_ACCORDING_TO_SPLIT_RATIO, + self::BEHAVIOR_DEDUCT_FROM_LIABLE_ACCOUNT, + self::BEHAVIOR_DEDUCT_FROM_ONE_BALANCE_ACCOUNT, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('behavior', $data ?? [], null); + $this->setIfExists('target_account', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getBehaviorAllowableValues(); + if (!is_null($this->container['behavior']) && !in_array($this->container['behavior'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'behavior', must be one of '%s'", + $this->container['behavior'], + 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 behavior + * + * @return string|null + */ + public function getBehavior() + { + return $this->container['behavior']; + } + + /** + * Sets behavior + * + * @param string|null $behavior behavior + * + * @return self + */ + public function setBehavior($behavior) + { + if (is_null($behavior)) { + throw new \InvalidArgumentException('non-nullable behavior cannot be null'); + } + $allowedValues = $this->getBehaviorAllowableValues(); + if (!in_array($behavior, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'behavior', must be one of '%s'", + $behavior, + implode("', '", $allowedValues) + ) + ); + } + $this->container['behavior'] = $behavior; + + return $this; + } + + /** + * Gets target_account + * + * @return string|null + */ + public function getTargetAccount() + { + return $this->container['target_account']; + } + + /** + * Sets target_account + * + * @param string|null $target_account target_account + * + * @return self + */ + public function setTargetAccount($target_account) + { + if (is_null($target_account)) { + throw new \InvalidArgumentException('non-nullable target_account cannot be null'); + } + $this->container['target_account'] = $target_account; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Recurring.php b/src/Adyen/Model/Payments/Recurring.php new file mode 100644 index 000000000..d2ed5448d --- /dev/null +++ b/src/Adyen/Model/Payments/Recurring.php @@ -0,0 +1,589 @@ + + */ +class Recurring implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Recurring'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contract' => 'string', + 'recurring_detail_name' => 'string', + 'recurring_expiry' => '\DateTime', + 'recurring_frequency' => 'string', + 'token_service' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contract' => null, + 'recurring_detail_name' => null, + 'recurring_expiry' => 'date-time', + 'recurring_frequency' => null, + 'token_service' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'contract' => false, + 'recurring_detail_name' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'token_service' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract' => 'contract', + 'recurring_detail_name' => 'recurringDetailName', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'token_service' => 'tokenService' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract' => 'setContract', + 'recurring_detail_name' => 'setRecurringDetailName', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'token_service' => 'setTokenService' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract' => 'getContract', + 'recurring_detail_name' => 'getRecurringDetailName', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'token_service' => 'getTokenService' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CONTRACT_ONECLICK = 'ONECLICK'; + public const CONTRACT_RECURRING = 'RECURRING'; + public const CONTRACT_PAYOUT = 'PAYOUT'; + public const TOKEN_SERVICE_VISATOKENSERVICE = 'VISATOKENSERVICE'; + public const TOKEN_SERVICE_MCTOKENSERVICE = 'MCTOKENSERVICE'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContractAllowableValues() + { + return [ + self::CONTRACT_ONECLICK, + self::CONTRACT_RECURRING, + self::CONTRACT_PAYOUT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTokenServiceAllowableValues() + { + return [ + self::TOKEN_SERVICE_VISATOKENSERVICE, + self::TOKEN_SERVICE_MCTOKENSERVICE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('contract', $data ?? [], null); + $this->setIfExists('recurring_detail_name', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('token_service', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getContractAllowableValues(); + if (!is_null($this->container['contract']) && !in_array($this->container['contract'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'contract', must be one of '%s'", + $this->container['contract'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTokenServiceAllowableValues(); + if (!is_null($this->container['token_service']) && !in_array($this->container['token_service'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'token_service', must be one of '%s'", + $this->container['token_service'], + 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 contract + * + * @return string|null + */ + public function getContract() + { + return $this->container['contract']; + } + + /** + * Sets contract + * + * @param string|null $contract The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). + * + * @return self + */ + public function setContract($contract) + { + if (is_null($contract)) { + throw new \InvalidArgumentException('non-nullable contract cannot be null'); + } + $allowedValues = $this->getContractAllowableValues(); + if (!in_array($contract, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'contract', must be one of '%s'", + $contract, + implode("', '", $allowedValues) + ) + ); + } + $this->container['contract'] = $contract; + + return $this; + } + + /** + * Gets recurring_detail_name + * + * @return string|null + */ + public function getRecurringDetailName() + { + return $this->container['recurring_detail_name']; + } + + /** + * Sets recurring_detail_name + * + * @param string|null $recurring_detail_name A descriptive name for this detail. + * + * @return self + */ + public function setRecurringDetailName($recurring_detail_name) + { + if (is_null($recurring_detail_name)) { + throw new \InvalidArgumentException('non-nullable recurring_detail_name cannot be null'); + } + $this->container['recurring_detail_name'] = $recurring_detail_name; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return \DateTime|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param \DateTime|null $recurring_expiry Date after which no further authorisations shall be performed. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Minimum number of days between authorisations. Only for 3D Secure 2. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets token_service + * + * @return string|null + */ + public function getTokenService() + { + return $this->container['token_service']; + } + + /** + * Sets token_service + * + * @param string|null $token_service The name of the token service. + * + * @return self + */ + public function setTokenService($token_service) + { + if (is_null($token_service)) { + throw new \InvalidArgumentException('non-nullable token_service cannot be null'); + } + $allowedValues = $this->getTokenServiceAllowableValues(); + if (!in_array($token_service, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'token_service', must be one of '%s'", + $token_service, + implode("', '", $allowedValues) + ) + ); + } + $this->container['token_service'] = $token_service; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/RefundRequest.php b/src/Adyen/Model/Payments/RefundRequest.php new file mode 100644 index 000000000..696b68040 --- /dev/null +++ b/src/Adyen/Model/Payments/RefundRequest.php @@ -0,0 +1,734 @@ + + */ +class RefundRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RefundRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'merchant_account' => 'string', + 'modification_amount' => '\Adyen\Model\Payments\Amount', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'original_merchant_reference' => 'string', + 'original_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'tender_reference' => 'string', + 'unique_terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'merchant_account' => null, + 'modification_amount' => null, + 'mpi_data' => null, + 'original_merchant_reference' => null, + 'original_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null, + 'splits' => null, + 'tender_reference' => null, + 'unique_terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'merchant_account' => false, + 'modification_amount' => false, + 'mpi_data' => false, + 'original_merchant_reference' => false, + 'original_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false, + 'splits' => false, + 'tender_reference' => false, + 'unique_terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'merchant_account' => 'merchantAccount', + 'modification_amount' => 'modificationAmount', + 'mpi_data' => 'mpiData', + 'original_merchant_reference' => 'originalMerchantReference', + 'original_reference' => 'originalReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference', + 'splits' => 'splits', + 'tender_reference' => 'tenderReference', + 'unique_terminal_id' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'merchant_account' => 'setMerchantAccount', + 'modification_amount' => 'setModificationAmount', + 'mpi_data' => 'setMpiData', + 'original_merchant_reference' => 'setOriginalMerchantReference', + 'original_reference' => 'setOriginalReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'tender_reference' => 'setTenderReference', + 'unique_terminal_id' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'merchant_account' => 'getMerchantAccount', + 'modification_amount' => 'getModificationAmount', + 'mpi_data' => 'getMpiData', + 'original_merchant_reference' => 'getOriginalMerchantReference', + 'original_reference' => 'getOriginalReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'tender_reference' => 'getTenderReference', + 'unique_terminal_id' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('modification_amount', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('original_merchant_reference', $data ?? [], null); + $this->setIfExists('original_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('tender_reference', $data ?? [], null); + $this->setIfExists('unique_terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['modification_amount'] === null) { + $invalidProperties[] = "'modification_amount' can't be null"; + } + if ($this->container['original_reference'] === null) { + $invalidProperties[] = "'original_reference' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets modification_amount + * + * @return \Adyen\Model\Payments\Amount + */ + public function getModificationAmount() + { + return $this->container['modification_amount']; + } + + /** + * Sets modification_amount + * + * @param \Adyen\Model\Payments\Amount $modification_amount modification_amount + * + * @return self + */ + public function setModificationAmount($modification_amount) + { + if (is_null($modification_amount)) { + throw new \InvalidArgumentException('non-nullable modification_amount cannot be null'); + } + $this->container['modification_amount'] = $modification_amount; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets original_merchant_reference + * + * @return string|null + */ + public function getOriginalMerchantReference() + { + return $this->container['original_merchant_reference']; + } + + /** + * Sets original_merchant_reference + * + * @param string|null $original_merchant_reference The original merchant reference to cancel. + * + * @return self + */ + public function setOriginalMerchantReference($original_merchant_reference) + { + if (is_null($original_merchant_reference)) { + throw new \InvalidArgumentException('non-nullable original_merchant_reference cannot be null'); + } + $this->container['original_merchant_reference'] = $original_merchant_reference; + + return $this; + } + + /** + * Gets original_reference + * + * @return string + */ + public function getOriginalReference() + { + return $this->container['original_reference']; + } + + /** + * Sets original_reference + * + * @param string $original_reference The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + * + * @return self + */ + public function setOriginalReference($original_reference) + { + if (is_null($original_reference)) { + throw new \InvalidArgumentException('non-nullable original_reference cannot be null'); + } + $this->container['original_reference'] = $original_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets tender_reference + * + * @return string|null + */ + public function getTenderReference() + { + return $this->container['tender_reference']; + } + + /** + * Sets tender_reference + * + * @param string|null $tender_reference The transaction reference provided by the PED. For point-of-sale integrations only. + * + * @return self + */ + public function setTenderReference($tender_reference) + { + if (is_null($tender_reference)) { + throw new \InvalidArgumentException('non-nullable tender_reference cannot be null'); + } + $this->container['tender_reference'] = $tender_reference; + + return $this; + } + + /** + * Gets unique_terminal_id + * + * @return string|null + */ + public function getUniqueTerminalId() + { + return $this->container['unique_terminal_id']; + } + + /** + * Sets unique_terminal_id + * + * @param string|null $unique_terminal_id Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + * + * @return self + */ + public function setUniqueTerminalId($unique_terminal_id) + { + if (is_null($unique_terminal_id)) { + throw new \InvalidArgumentException('non-nullable unique_terminal_id cannot be null'); + } + $this->container['unique_terminal_id'] = $unique_terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalData3DSecure.php b/src/Adyen/Model/Payments/ResponseAdditionalData3DSecure.php new file mode 100644 index 000000000..85e69b0ac --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalData3DSecure.php @@ -0,0 +1,521 @@ + + */ +class ResponseAdditionalData3DSecure implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalData3DSecure'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'card_holder_info' => 'string', + 'cavv' => 'string', + 'cavv_algorithm' => 'string', + 'sca_exemption_requested' => 'string', + 'threeds2_card_enrolled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'card_holder_info' => null, + 'cavv' => null, + 'cavv_algorithm' => null, + 'sca_exemption_requested' => null, + 'threeds2_card_enrolled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'card_holder_info' => false, + 'cavv' => false, + 'cavv_algorithm' => false, + 'sca_exemption_requested' => false, + 'threeds2_card_enrolled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_holder_info' => 'cardHolderInfo', + 'cavv' => 'cavv', + 'cavv_algorithm' => 'cavvAlgorithm', + 'sca_exemption_requested' => 'scaExemptionRequested', + 'threeds2_card_enrolled' => 'threeds2.cardEnrolled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_holder_info' => 'setCardHolderInfo', + 'cavv' => 'setCavv', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'sca_exemption_requested' => 'setScaExemptionRequested', + 'threeds2_card_enrolled' => 'setThreeds2CardEnrolled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_holder_info' => 'getCardHolderInfo', + 'cavv' => 'getCavv', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'sca_exemption_requested' => 'getScaExemptionRequested', + 'threeds2_card_enrolled' => 'getThreeds2CardEnrolled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('card_holder_info', $data ?? [], null); + $this->setIfExists('cavv', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('sca_exemption_requested', $data ?? [], null); + $this->setIfExists('threeds2_card_enrolled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets card_holder_info + * + * @return string|null + */ + public function getCardHolderInfo() + { + return $this->container['card_holder_info']; + } + + /** + * Sets card_holder_info + * + * @param string|null $card_holder_info Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + * + * @return self + */ + public function setCardHolderInfo($card_holder_info) + { + if (is_null($card_holder_info)) { + throw new \InvalidArgumentException('non-nullable card_holder_info cannot be null'); + } + $this->container['card_holder_info'] = $card_holder_info; + + return $this; + } + + /** + * Gets cavv + * + * @return string|null + */ + public function getCavv() + { + return $this->container['cavv']; + } + + /** + * Sets cavv + * + * @param string|null $cavv The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. + * + * @return self + */ + public function setCavv($cavv) + { + if (is_null($cavv)) { + throw new \InvalidArgumentException('non-nullable cavv cannot be null'); + } + $this->container['cavv'] = $cavv; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm The CAVV algorithm used. + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets sca_exemption_requested + * + * @return string|null + */ + public function getScaExemptionRequested() + { + return $this->container['sca_exemption_requested']; + } + + /** + * Sets sca_exemption_requested + * + * @param string|null $sca_exemption_requested Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + * + * @return self + */ + public function setScaExemptionRequested($sca_exemption_requested) + { + if (is_null($sca_exemption_requested)) { + throw new \InvalidArgumentException('non-nullable sca_exemption_requested cannot be null'); + } + $this->container['sca_exemption_requested'] = $sca_exemption_requested; + + return $this; + } + + /** + * Gets threeds2_card_enrolled + * + * @return bool|null + */ + public function getThreeds2CardEnrolled() + { + return $this->container['threeds2_card_enrolled']; + } + + /** + * Sets threeds2_card_enrolled + * + * @param bool|null $threeds2_card_enrolled Indicates whether a card is enrolled for 3D Secure 2. + * + * @return self + */ + public function setThreeds2CardEnrolled($threeds2_card_enrolled) + { + if (is_null($threeds2_card_enrolled)) { + throw new \InvalidArgumentException('non-nullable threeds2_card_enrolled cannot be null'); + } + $this->container['threeds2_card_enrolled'] = $threeds2_card_enrolled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalDataBillingAddress.php b/src/Adyen/Model/Payments/ResponseAdditionalDataBillingAddress.php new file mode 100644 index 000000000..287765505 --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataBillingAddress.php @@ -0,0 +1,555 @@ + + */ +class ResponseAdditionalDataBillingAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataBillingAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_address_city' => 'string', + 'billing_address_country' => 'string', + 'billing_address_house_number_or_name' => 'string', + 'billing_address_postal_code' => 'string', + 'billing_address_state_or_province' => 'string', + 'billing_address_street' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_address_city' => null, + 'billing_address_country' => null, + 'billing_address_house_number_or_name' => null, + 'billing_address_postal_code' => null, + 'billing_address_state_or_province' => null, + 'billing_address_street' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_address_city' => false, + 'billing_address_country' => false, + 'billing_address_house_number_or_name' => false, + 'billing_address_postal_code' => false, + 'billing_address_state_or_province' => false, + 'billing_address_street' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_address_city' => 'billingAddress.city', + 'billing_address_country' => 'billingAddress.country', + 'billing_address_house_number_or_name' => 'billingAddress.houseNumberOrName', + 'billing_address_postal_code' => 'billingAddress.postalCode', + 'billing_address_state_or_province' => 'billingAddress.stateOrProvince', + 'billing_address_street' => 'billingAddress.street' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_address_city' => 'setBillingAddressCity', + 'billing_address_country' => 'setBillingAddressCountry', + 'billing_address_house_number_or_name' => 'setBillingAddressHouseNumberOrName', + 'billing_address_postal_code' => 'setBillingAddressPostalCode', + 'billing_address_state_or_province' => 'setBillingAddressStateOrProvince', + 'billing_address_street' => 'setBillingAddressStreet' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_address_city' => 'getBillingAddressCity', + 'billing_address_country' => 'getBillingAddressCountry', + 'billing_address_house_number_or_name' => 'getBillingAddressHouseNumberOrName', + 'billing_address_postal_code' => 'getBillingAddressPostalCode', + 'billing_address_state_or_province' => 'getBillingAddressStateOrProvince', + 'billing_address_street' => 'getBillingAddressStreet' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_address_city', $data ?? [], null); + $this->setIfExists('billing_address_country', $data ?? [], null); + $this->setIfExists('billing_address_house_number_or_name', $data ?? [], null); + $this->setIfExists('billing_address_postal_code', $data ?? [], null); + $this->setIfExists('billing_address_state_or_province', $data ?? [], null); + $this->setIfExists('billing_address_street', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 billing_address_city + * + * @return string|null + */ + public function getBillingAddressCity() + { + return $this->container['billing_address_city']; + } + + /** + * Sets billing_address_city + * + * @param string|null $billing_address_city The billing address city passed in the payment request. + * + * @return self + */ + public function setBillingAddressCity($billing_address_city) + { + if (is_null($billing_address_city)) { + throw new \InvalidArgumentException('non-nullable billing_address_city cannot be null'); + } + $this->container['billing_address_city'] = $billing_address_city; + + return $this; + } + + /** + * Gets billing_address_country + * + * @return string|null + */ + public function getBillingAddressCountry() + { + return $this->container['billing_address_country']; + } + + /** + * Sets billing_address_country + * + * @param string|null $billing_address_country The billing address country passed in the payment request. Example: NL + * + * @return self + */ + public function setBillingAddressCountry($billing_address_country) + { + if (is_null($billing_address_country)) { + throw new \InvalidArgumentException('non-nullable billing_address_country cannot be null'); + } + $this->container['billing_address_country'] = $billing_address_country; + + return $this; + } + + /** + * Gets billing_address_house_number_or_name + * + * @return string|null + */ + public function getBillingAddressHouseNumberOrName() + { + return $this->container['billing_address_house_number_or_name']; + } + + /** + * Sets billing_address_house_number_or_name + * + * @param string|null $billing_address_house_number_or_name The billing address house number or name passed in the payment request. + * + * @return self + */ + public function setBillingAddressHouseNumberOrName($billing_address_house_number_or_name) + { + if (is_null($billing_address_house_number_or_name)) { + throw new \InvalidArgumentException('non-nullable billing_address_house_number_or_name cannot be null'); + } + $this->container['billing_address_house_number_or_name'] = $billing_address_house_number_or_name; + + return $this; + } + + /** + * Gets billing_address_postal_code + * + * @return string|null + */ + public function getBillingAddressPostalCode() + { + return $this->container['billing_address_postal_code']; + } + + /** + * Sets billing_address_postal_code + * + * @param string|null $billing_address_postal_code The billing address postal code passed in the payment request. Example: 1011 DJ + * + * @return self + */ + public function setBillingAddressPostalCode($billing_address_postal_code) + { + if (is_null($billing_address_postal_code)) { + throw new \InvalidArgumentException('non-nullable billing_address_postal_code cannot be null'); + } + $this->container['billing_address_postal_code'] = $billing_address_postal_code; + + return $this; + } + + /** + * Gets billing_address_state_or_province + * + * @return string|null + */ + public function getBillingAddressStateOrProvince() + { + return $this->container['billing_address_state_or_province']; + } + + /** + * Sets billing_address_state_or_province + * + * @param string|null $billing_address_state_or_province The billing address state or province passed in the payment request. Example: NH + * + * @return self + */ + public function setBillingAddressStateOrProvince($billing_address_state_or_province) + { + if (is_null($billing_address_state_or_province)) { + throw new \InvalidArgumentException('non-nullable billing_address_state_or_province cannot be null'); + } + $this->container['billing_address_state_or_province'] = $billing_address_state_or_province; + + return $this; + } + + /** + * Gets billing_address_street + * + * @return string|null + */ + public function getBillingAddressStreet() + { + return $this->container['billing_address_street']; + } + + /** + * Sets billing_address_street + * + * @param string|null $billing_address_street The billing address street passed in the payment request. + * + * @return self + */ + public function setBillingAddressStreet($billing_address_street) + { + if (is_null($billing_address_street)) { + throw new \InvalidArgumentException('non-nullable billing_address_street cannot be null'); + } + $this->container['billing_address_street'] = $billing_address_street; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalDataCard.php b/src/Adyen/Model/Payments/ResponseAdditionalDataCard.php new file mode 100644 index 000000000..d5af7fb6b --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataCard.php @@ -0,0 +1,623 @@ + + */ +class ResponseAdditionalDataCard implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataCard'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'card_bin' => 'string', + 'card_holder_name' => 'string', + 'card_issuing_bank' => 'string', + 'card_issuing_country' => 'string', + 'card_issuing_currency' => 'string', + 'card_payment_method' => 'string', + 'card_summary' => 'string', + 'issuer_bin' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'card_bin' => null, + 'card_holder_name' => null, + 'card_issuing_bank' => null, + 'card_issuing_country' => null, + 'card_issuing_currency' => null, + 'card_payment_method' => null, + 'card_summary' => null, + 'issuer_bin' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'card_bin' => false, + 'card_holder_name' => false, + 'card_issuing_bank' => false, + 'card_issuing_country' => false, + 'card_issuing_currency' => false, + 'card_payment_method' => false, + 'card_summary' => false, + 'issuer_bin' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'card_bin' => 'cardBin', + 'card_holder_name' => 'cardHolderName', + 'card_issuing_bank' => 'cardIssuingBank', + 'card_issuing_country' => 'cardIssuingCountry', + 'card_issuing_currency' => 'cardIssuingCurrency', + 'card_payment_method' => 'cardPaymentMethod', + 'card_summary' => 'cardSummary', + 'issuer_bin' => 'issuerBin' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'card_bin' => 'setCardBin', + 'card_holder_name' => 'setCardHolderName', + 'card_issuing_bank' => 'setCardIssuingBank', + 'card_issuing_country' => 'setCardIssuingCountry', + 'card_issuing_currency' => 'setCardIssuingCurrency', + 'card_payment_method' => 'setCardPaymentMethod', + 'card_summary' => 'setCardSummary', + 'issuer_bin' => 'setIssuerBin' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'card_bin' => 'getCardBin', + 'card_holder_name' => 'getCardHolderName', + 'card_issuing_bank' => 'getCardIssuingBank', + 'card_issuing_country' => 'getCardIssuingCountry', + 'card_issuing_currency' => 'getCardIssuingCurrency', + 'card_payment_method' => 'getCardPaymentMethod', + 'card_summary' => 'getCardSummary', + 'issuer_bin' => 'getIssuerBin' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('card_bin', $data ?? [], null); + $this->setIfExists('card_holder_name', $data ?? [], null); + $this->setIfExists('card_issuing_bank', $data ?? [], null); + $this->setIfExists('card_issuing_country', $data ?? [], null); + $this->setIfExists('card_issuing_currency', $data ?? [], null); + $this->setIfExists('card_payment_method', $data ?? [], null); + $this->setIfExists('card_summary', $data ?? [], null); + $this->setIfExists('issuer_bin', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets card_bin + * + * @return string|null + */ + public function getCardBin() + { + return $this->container['card_bin']; + } + + /** + * Sets card_bin + * + * @param string|null $card_bin The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 + * + * @return self + */ + public function setCardBin($card_bin) + { + if (is_null($card_bin)) { + throw new \InvalidArgumentException('non-nullable card_bin cannot be null'); + } + $this->container['card_bin'] = $card_bin; + + return $this; + } + + /** + * Gets card_holder_name + * + * @return string|null + */ + public function getCardHolderName() + { + return $this->container['card_holder_name']; + } + + /** + * Sets card_holder_name + * + * @param string|null $card_holder_name The cardholder name passed in the payment request. + * + * @return self + */ + public function setCardHolderName($card_holder_name) + { + if (is_null($card_holder_name)) { + throw new \InvalidArgumentException('non-nullable card_holder_name cannot be null'); + } + $this->container['card_holder_name'] = $card_holder_name; + + return $this; + } + + /** + * Gets card_issuing_bank + * + * @return string|null + */ + public function getCardIssuingBank() + { + return $this->container['card_issuing_bank']; + } + + /** + * Sets card_issuing_bank + * + * @param string|null $card_issuing_bank The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. + * + * @return self + */ + public function setCardIssuingBank($card_issuing_bank) + { + if (is_null($card_issuing_bank)) { + throw new \InvalidArgumentException('non-nullable card_issuing_bank cannot be null'); + } + $this->container['card_issuing_bank'] = $card_issuing_bank; + + return $this; + } + + /** + * Gets card_issuing_country + * + * @return string|null + */ + public function getCardIssuingCountry() + { + return $this->container['card_issuing_country']; + } + + /** + * Sets card_issuing_country + * + * @param string|null $card_issuing_country The country where the card was issued. Example: US + * + * @return self + */ + public function setCardIssuingCountry($card_issuing_country) + { + if (is_null($card_issuing_country)) { + throw new \InvalidArgumentException('non-nullable card_issuing_country cannot be null'); + } + $this->container['card_issuing_country'] = $card_issuing_country; + + return $this; + } + + /** + * Gets card_issuing_currency + * + * @return string|null + */ + public function getCardIssuingCurrency() + { + return $this->container['card_issuing_currency']; + } + + /** + * Sets card_issuing_currency + * + * @param string|null $card_issuing_currency The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD + * + * @return self + */ + public function setCardIssuingCurrency($card_issuing_currency) + { + if (is_null($card_issuing_currency)) { + throw new \InvalidArgumentException('non-nullable card_issuing_currency cannot be null'); + } + $this->container['card_issuing_currency'] = $card_issuing_currency; + + return $this; + } + + /** + * Gets card_payment_method + * + * @return string|null + */ + public function getCardPaymentMethod() + { + return $this->container['card_payment_method']; + } + + /** + * Sets card_payment_method + * + * @param string|null $card_payment_method The card payment method used for the transaction. Example: amex + * + * @return self + */ + public function setCardPaymentMethod($card_payment_method) + { + if (is_null($card_payment_method)) { + throw new \InvalidArgumentException('non-nullable card_payment_method cannot be null'); + } + $this->container['card_payment_method'] = $card_payment_method; + + return $this; + } + + /** + * Gets card_summary + * + * @return string|null + */ + public function getCardSummary() + { + return $this->container['card_summary']; + } + + /** + * Sets card_summary + * + * @param string|null $card_summary The last four digits of a card number. > Returned only in case of a card payment. + * + * @return self + */ + public function setCardSummary($card_summary) + { + if (is_null($card_summary)) { + throw new \InvalidArgumentException('non-nullable card_summary cannot be null'); + } + $this->container['card_summary'] = $card_summary; + + return $this; + } + + /** + * Gets issuer_bin + * + * @return string|null + */ + public function getIssuerBin() + { + return $this->container['issuer_bin']; + } + + /** + * Sets issuer_bin + * + * @param string|null $issuer_bin The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 + * + * @return self + */ + public function setIssuerBin($issuer_bin) + { + if (is_null($issuer_bin)) { + throw new \InvalidArgumentException('non-nullable issuer_bin cannot be null'); + } + $this->container['issuer_bin'] = $issuer_bin; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalDataCommon.php b/src/Adyen/Model/Payments/ResponseAdditionalDataCommon.php new file mode 100644 index 000000000..9b0045830 --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataCommon.php @@ -0,0 +1,2425 @@ + + */ +class ResponseAdditionalDataCommon implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataCommon'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acquirer_account_code' => 'string', + 'acquirer_code' => 'string', + 'acquirer_reference' => 'string', + 'alias' => 'string', + 'alias_type' => 'string', + 'auth_code' => 'string', + 'authorisation_mid' => 'string', + 'authorised_amount_currency' => 'string', + 'authorised_amount_value' => 'string', + 'avs_result' => 'string', + 'avs_result_raw' => 'string', + 'bic' => 'string', + 'co_branded_with' => 'string', + 'cvc_result' => 'string', + 'cvc_result_raw' => 'string', + 'ds_trans_id' => 'string', + 'eci' => 'string', + 'expiry_date' => 'string', + 'extra_costs_currency' => 'string', + 'extra_costs_value' => 'string', + 'fraud_check__item_nr__fraud_checkname' => 'string', + 'fraud_manual_review' => 'string', + 'fraud_result_type' => 'string', + 'funding_source' => 'string', + 'funds_availability' => 'string', + 'inferred_refusal_reason' => 'string', + 'is_card_commercial' => 'string', + 'issuer_country' => 'string', + 'liability_shift' => 'string', + 'mc_bank_net_reference_number' => 'string', + 'merchant_advice_code' => 'string', + 'merchant_reference' => 'string', + 'network_tx_reference' => 'string', + 'owner_name' => 'string', + 'payment_account_reference' => 'string', + 'payment_method' => 'string', + 'payment_method_variant' => 'string', + 'payout_eligible' => 'string', + 'realtime_account_updater_status' => 'string', + 'receipt_free_text' => 'string', + 'recurring_contract_types' => 'string', + 'recurring_first_psp_reference' => 'string', + 'recurring_recurring_detail_reference' => 'string', + 'recurring_shopper_reference' => 'string', + 'recurring_processing_model' => 'string', + 'referred' => 'string', + 'refusal_reason_raw' => 'string', + 'request_amount' => 'string', + 'request_currency_code' => 'string', + 'shopper_interaction' => 'string', + 'shopper_reference' => 'string', + 'terminal_id' => 'string', + 'three_d_authenticated' => 'string', + 'three_d_authenticated_response' => 'string', + 'three_d_offered' => 'string', + 'three_d_offered_response' => 'string', + 'three_ds_version' => 'string', + 'visa_transaction_id' => 'string', + 'xid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acquirer_account_code' => null, + 'acquirer_code' => null, + 'acquirer_reference' => null, + 'alias' => null, + 'alias_type' => null, + 'auth_code' => null, + 'authorisation_mid' => null, + 'authorised_amount_currency' => null, + 'authorised_amount_value' => null, + 'avs_result' => null, + 'avs_result_raw' => null, + 'bic' => null, + 'co_branded_with' => null, + 'cvc_result' => null, + 'cvc_result_raw' => null, + 'ds_trans_id' => null, + 'eci' => null, + 'expiry_date' => null, + 'extra_costs_currency' => null, + 'extra_costs_value' => null, + 'fraud_check__item_nr__fraud_checkname' => null, + 'fraud_manual_review' => null, + 'fraud_result_type' => null, + 'funding_source' => null, + 'funds_availability' => null, + 'inferred_refusal_reason' => null, + 'is_card_commercial' => null, + 'issuer_country' => null, + 'liability_shift' => null, + 'mc_bank_net_reference_number' => null, + 'merchant_advice_code' => null, + 'merchant_reference' => null, + 'network_tx_reference' => null, + 'owner_name' => null, + 'payment_account_reference' => null, + 'payment_method' => null, + 'payment_method_variant' => null, + 'payout_eligible' => null, + 'realtime_account_updater_status' => null, + 'receipt_free_text' => null, + 'recurring_contract_types' => null, + 'recurring_first_psp_reference' => null, + 'recurring_recurring_detail_reference' => null, + 'recurring_shopper_reference' => null, + 'recurring_processing_model' => null, + 'referred' => null, + 'refusal_reason_raw' => null, + 'request_amount' => null, + 'request_currency_code' => null, + 'shopper_interaction' => null, + 'shopper_reference' => null, + 'terminal_id' => null, + 'three_d_authenticated' => null, + 'three_d_authenticated_response' => null, + 'three_d_offered' => null, + 'three_d_offered_response' => null, + 'three_ds_version' => null, + 'visa_transaction_id' => null, + 'xid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acquirer_account_code' => false, + 'acquirer_code' => false, + 'acquirer_reference' => false, + 'alias' => false, + 'alias_type' => false, + 'auth_code' => false, + 'authorisation_mid' => false, + 'authorised_amount_currency' => false, + 'authorised_amount_value' => false, + 'avs_result' => false, + 'avs_result_raw' => false, + 'bic' => false, + 'co_branded_with' => false, + 'cvc_result' => false, + 'cvc_result_raw' => false, + 'ds_trans_id' => false, + 'eci' => false, + 'expiry_date' => false, + 'extra_costs_currency' => false, + 'extra_costs_value' => false, + 'fraud_check__item_nr__fraud_checkname' => false, + 'fraud_manual_review' => false, + 'fraud_result_type' => false, + 'funding_source' => false, + 'funds_availability' => false, + 'inferred_refusal_reason' => false, + 'is_card_commercial' => false, + 'issuer_country' => false, + 'liability_shift' => false, + 'mc_bank_net_reference_number' => false, + 'merchant_advice_code' => false, + 'merchant_reference' => false, + 'network_tx_reference' => false, + 'owner_name' => false, + 'payment_account_reference' => false, + 'payment_method' => false, + 'payment_method_variant' => false, + 'payout_eligible' => false, + 'realtime_account_updater_status' => false, + 'receipt_free_text' => false, + 'recurring_contract_types' => false, + 'recurring_first_psp_reference' => false, + 'recurring_recurring_detail_reference' => false, + 'recurring_shopper_reference' => false, + 'recurring_processing_model' => false, + 'referred' => false, + 'refusal_reason_raw' => false, + 'request_amount' => false, + 'request_currency_code' => false, + 'shopper_interaction' => false, + 'shopper_reference' => false, + 'terminal_id' => false, + 'three_d_authenticated' => false, + 'three_d_authenticated_response' => false, + 'three_d_offered' => false, + 'three_d_offered_response' => false, + 'three_ds_version' => false, + 'visa_transaction_id' => false, + 'xid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acquirer_account_code' => 'acquirerAccountCode', + 'acquirer_code' => 'acquirerCode', + 'acquirer_reference' => 'acquirerReference', + 'alias' => 'alias', + 'alias_type' => 'aliasType', + 'auth_code' => 'authCode', + 'authorisation_mid' => 'authorisationMid', + 'authorised_amount_currency' => 'authorisedAmountCurrency', + 'authorised_amount_value' => 'authorisedAmountValue', + 'avs_result' => 'avsResult', + 'avs_result_raw' => 'avsResultRaw', + 'bic' => 'bic', + 'co_branded_with' => 'coBrandedWith', + 'cvc_result' => 'cvcResult', + 'cvc_result_raw' => 'cvcResultRaw', + 'ds_trans_id' => 'dsTransID', + 'eci' => 'eci', + 'expiry_date' => 'expiryDate', + 'extra_costs_currency' => 'extraCostsCurrency', + 'extra_costs_value' => 'extraCostsValue', + 'fraud_check__item_nr__fraud_checkname' => 'fraudCheck-[itemNr]-[FraudCheckname]', + 'fraud_manual_review' => 'fraudManualReview', + 'fraud_result_type' => 'fraudResultType', + 'funding_source' => 'fundingSource', + 'funds_availability' => 'fundsAvailability', + 'inferred_refusal_reason' => 'inferredRefusalReason', + 'is_card_commercial' => 'isCardCommercial', + 'issuer_country' => 'issuerCountry', + 'liability_shift' => 'liabilityShift', + 'mc_bank_net_reference_number' => 'mcBankNetReferenceNumber', + 'merchant_advice_code' => 'merchantAdviceCode', + 'merchant_reference' => 'merchantReference', + 'network_tx_reference' => 'networkTxReference', + 'owner_name' => 'ownerName', + 'payment_account_reference' => 'paymentAccountReference', + 'payment_method' => 'paymentMethod', + 'payment_method_variant' => 'paymentMethodVariant', + 'payout_eligible' => 'payoutEligible', + 'realtime_account_updater_status' => 'realtimeAccountUpdaterStatus', + 'receipt_free_text' => 'receiptFreeText', + 'recurring_contract_types' => 'recurring.contractTypes', + 'recurring_first_psp_reference' => 'recurring.firstPspReference', + 'recurring_recurring_detail_reference' => 'recurring.recurringDetailReference', + 'recurring_shopper_reference' => 'recurring.shopperReference', + 'recurring_processing_model' => 'recurringProcessingModel', + 'referred' => 'referred', + 'refusal_reason_raw' => 'refusalReasonRaw', + 'request_amount' => 'requestAmount', + 'request_currency_code' => 'requestCurrencyCode', + 'shopper_interaction' => 'shopperInteraction', + 'shopper_reference' => 'shopperReference', + 'terminal_id' => 'terminalId', + 'three_d_authenticated' => 'threeDAuthenticated', + 'three_d_authenticated_response' => 'threeDAuthenticatedResponse', + 'three_d_offered' => 'threeDOffered', + 'three_d_offered_response' => 'threeDOfferedResponse', + 'three_ds_version' => 'threeDSVersion', + 'visa_transaction_id' => 'visaTransactionId', + 'xid' => 'xid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acquirer_account_code' => 'setAcquirerAccountCode', + 'acquirer_code' => 'setAcquirerCode', + 'acquirer_reference' => 'setAcquirerReference', + 'alias' => 'setAlias', + 'alias_type' => 'setAliasType', + 'auth_code' => 'setAuthCode', + 'authorisation_mid' => 'setAuthorisationMid', + 'authorised_amount_currency' => 'setAuthorisedAmountCurrency', + 'authorised_amount_value' => 'setAuthorisedAmountValue', + 'avs_result' => 'setAvsResult', + 'avs_result_raw' => 'setAvsResultRaw', + 'bic' => 'setBic', + 'co_branded_with' => 'setCoBrandedWith', + 'cvc_result' => 'setCvcResult', + 'cvc_result_raw' => 'setCvcResultRaw', + 'ds_trans_id' => 'setDsTransId', + 'eci' => 'setEci', + 'expiry_date' => 'setExpiryDate', + 'extra_costs_currency' => 'setExtraCostsCurrency', + 'extra_costs_value' => 'setExtraCostsValue', + 'fraud_check__item_nr__fraud_checkname' => 'setFraudCheckItemNrFraudCheckname', + 'fraud_manual_review' => 'setFraudManualReview', + 'fraud_result_type' => 'setFraudResultType', + 'funding_source' => 'setFundingSource', + 'funds_availability' => 'setFundsAvailability', + 'inferred_refusal_reason' => 'setInferredRefusalReason', + 'is_card_commercial' => 'setIsCardCommercial', + 'issuer_country' => 'setIssuerCountry', + 'liability_shift' => 'setLiabilityShift', + 'mc_bank_net_reference_number' => 'setMcBankNetReferenceNumber', + 'merchant_advice_code' => 'setMerchantAdviceCode', + 'merchant_reference' => 'setMerchantReference', + 'network_tx_reference' => 'setNetworkTxReference', + 'owner_name' => 'setOwnerName', + 'payment_account_reference' => 'setPaymentAccountReference', + 'payment_method' => 'setPaymentMethod', + 'payment_method_variant' => 'setPaymentMethodVariant', + 'payout_eligible' => 'setPayoutEligible', + 'realtime_account_updater_status' => 'setRealtimeAccountUpdaterStatus', + 'receipt_free_text' => 'setReceiptFreeText', + 'recurring_contract_types' => 'setRecurringContractTypes', + 'recurring_first_psp_reference' => 'setRecurringFirstPspReference', + 'recurring_recurring_detail_reference' => 'setRecurringRecurringDetailReference', + 'recurring_shopper_reference' => 'setRecurringShopperReference', + 'recurring_processing_model' => 'setRecurringProcessingModel', + 'referred' => 'setReferred', + 'refusal_reason_raw' => 'setRefusalReasonRaw', + 'request_amount' => 'setRequestAmount', + 'request_currency_code' => 'setRequestCurrencyCode', + 'shopper_interaction' => 'setShopperInteraction', + 'shopper_reference' => 'setShopperReference', + 'terminal_id' => 'setTerminalId', + 'three_d_authenticated' => 'setThreeDAuthenticated', + 'three_d_authenticated_response' => 'setThreeDAuthenticatedResponse', + 'three_d_offered' => 'setThreeDOffered', + 'three_d_offered_response' => 'setThreeDOfferedResponse', + 'three_ds_version' => 'setThreeDsVersion', + 'visa_transaction_id' => 'setVisaTransactionId', + 'xid' => 'setXid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acquirer_account_code' => 'getAcquirerAccountCode', + 'acquirer_code' => 'getAcquirerCode', + 'acquirer_reference' => 'getAcquirerReference', + 'alias' => 'getAlias', + 'alias_type' => 'getAliasType', + 'auth_code' => 'getAuthCode', + 'authorisation_mid' => 'getAuthorisationMid', + 'authorised_amount_currency' => 'getAuthorisedAmountCurrency', + 'authorised_amount_value' => 'getAuthorisedAmountValue', + 'avs_result' => 'getAvsResult', + 'avs_result_raw' => 'getAvsResultRaw', + 'bic' => 'getBic', + 'co_branded_with' => 'getCoBrandedWith', + 'cvc_result' => 'getCvcResult', + 'cvc_result_raw' => 'getCvcResultRaw', + 'ds_trans_id' => 'getDsTransId', + 'eci' => 'getEci', + 'expiry_date' => 'getExpiryDate', + 'extra_costs_currency' => 'getExtraCostsCurrency', + 'extra_costs_value' => 'getExtraCostsValue', + 'fraud_check__item_nr__fraud_checkname' => 'getFraudCheckItemNrFraudCheckname', + 'fraud_manual_review' => 'getFraudManualReview', + 'fraud_result_type' => 'getFraudResultType', + 'funding_source' => 'getFundingSource', + 'funds_availability' => 'getFundsAvailability', + 'inferred_refusal_reason' => 'getInferredRefusalReason', + 'is_card_commercial' => 'getIsCardCommercial', + 'issuer_country' => 'getIssuerCountry', + 'liability_shift' => 'getLiabilityShift', + 'mc_bank_net_reference_number' => 'getMcBankNetReferenceNumber', + 'merchant_advice_code' => 'getMerchantAdviceCode', + 'merchant_reference' => 'getMerchantReference', + 'network_tx_reference' => 'getNetworkTxReference', + 'owner_name' => 'getOwnerName', + 'payment_account_reference' => 'getPaymentAccountReference', + 'payment_method' => 'getPaymentMethod', + 'payment_method_variant' => 'getPaymentMethodVariant', + 'payout_eligible' => 'getPayoutEligible', + 'realtime_account_updater_status' => 'getRealtimeAccountUpdaterStatus', + 'receipt_free_text' => 'getReceiptFreeText', + 'recurring_contract_types' => 'getRecurringContractTypes', + 'recurring_first_psp_reference' => 'getRecurringFirstPspReference', + 'recurring_recurring_detail_reference' => 'getRecurringRecurringDetailReference', + 'recurring_shopper_reference' => 'getRecurringShopperReference', + 'recurring_processing_model' => 'getRecurringProcessingModel', + 'referred' => 'getReferred', + 'refusal_reason_raw' => 'getRefusalReasonRaw', + 'request_amount' => 'getRequestAmount', + 'request_currency_code' => 'getRequestCurrencyCode', + 'shopper_interaction' => 'getShopperInteraction', + 'shopper_reference' => 'getShopperReference', + 'terminal_id' => 'getTerminalId', + 'three_d_authenticated' => 'getThreeDAuthenticated', + 'three_d_authenticated_response' => 'getThreeDAuthenticatedResponse', + 'three_d_offered' => 'getThreeDOffered', + 'three_d_offered_response' => 'getThreeDOfferedResponse', + 'three_ds_version' => 'getThreeDsVersion', + 'visa_transaction_id' => 'getVisaTransactionId', + 'xid' => 'getXid' + ]; + + /** + * 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 FRAUD_RESULT_TYPE_GREEN = 'GREEN'; + public const FRAUD_RESULT_TYPE_FRAUD = 'FRAUD'; + public const RECURRING_PROCESSING_MODEL_CARD_ON_FILE = 'CardOnFile'; + public const RECURRING_PROCESSING_MODEL_SUBSCRIPTION = 'Subscription'; + public const RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE = 'UnscheduledCardOnFile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFraudResultTypeAllowableValues() + { + return [ + self::FRAUD_RESULT_TYPE_GREEN, + self::FRAUD_RESULT_TYPE_FRAUD, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecurringProcessingModelAllowableValues() + { + return [ + self::RECURRING_PROCESSING_MODEL_CARD_ON_FILE, + self::RECURRING_PROCESSING_MODEL_SUBSCRIPTION, + self::RECURRING_PROCESSING_MODEL_UNSCHEDULED_CARD_ON_FILE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('acquirer_account_code', $data ?? [], null); + $this->setIfExists('acquirer_code', $data ?? [], null); + $this->setIfExists('acquirer_reference', $data ?? [], null); + $this->setIfExists('alias', $data ?? [], null); + $this->setIfExists('alias_type', $data ?? [], null); + $this->setIfExists('auth_code', $data ?? [], null); + $this->setIfExists('authorisation_mid', $data ?? [], null); + $this->setIfExists('authorised_amount_currency', $data ?? [], null); + $this->setIfExists('authorised_amount_value', $data ?? [], null); + $this->setIfExists('avs_result', $data ?? [], null); + $this->setIfExists('avs_result_raw', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); + $this->setIfExists('co_branded_with', $data ?? [], null); + $this->setIfExists('cvc_result', $data ?? [], null); + $this->setIfExists('cvc_result_raw', $data ?? [], null); + $this->setIfExists('ds_trans_id', $data ?? [], null); + $this->setIfExists('eci', $data ?? [], null); + $this->setIfExists('expiry_date', $data ?? [], null); + $this->setIfExists('extra_costs_currency', $data ?? [], null); + $this->setIfExists('extra_costs_value', $data ?? [], null); + $this->setIfExists('fraud_check__item_nr__fraud_checkname', $data ?? [], null); + $this->setIfExists('fraud_manual_review', $data ?? [], null); + $this->setIfExists('fraud_result_type', $data ?? [], null); + $this->setIfExists('funding_source', $data ?? [], null); + $this->setIfExists('funds_availability', $data ?? [], null); + $this->setIfExists('inferred_refusal_reason', $data ?? [], null); + $this->setIfExists('is_card_commercial', $data ?? [], null); + $this->setIfExists('issuer_country', $data ?? [], null); + $this->setIfExists('liability_shift', $data ?? [], null); + $this->setIfExists('mc_bank_net_reference_number', $data ?? [], null); + $this->setIfExists('merchant_advice_code', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('network_tx_reference', $data ?? [], null); + $this->setIfExists('owner_name', $data ?? [], null); + $this->setIfExists('payment_account_reference', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('payment_method_variant', $data ?? [], null); + $this->setIfExists('payout_eligible', $data ?? [], null); + $this->setIfExists('realtime_account_updater_status', $data ?? [], null); + $this->setIfExists('receipt_free_text', $data ?? [], null); + $this->setIfExists('recurring_contract_types', $data ?? [], null); + $this->setIfExists('recurring_first_psp_reference', $data ?? [], null); + $this->setIfExists('recurring_recurring_detail_reference', $data ?? [], null); + $this->setIfExists('recurring_shopper_reference', $data ?? [], null); + $this->setIfExists('recurring_processing_model', $data ?? [], null); + $this->setIfExists('referred', $data ?? [], null); + $this->setIfExists('refusal_reason_raw', $data ?? [], null); + $this->setIfExists('request_amount', $data ?? [], null); + $this->setIfExists('request_currency_code', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('shopper_reference', $data ?? [], null); + $this->setIfExists('terminal_id', $data ?? [], null); + $this->setIfExists('three_d_authenticated', $data ?? [], null); + $this->setIfExists('three_d_authenticated_response', $data ?? [], null); + $this->setIfExists('three_d_offered', $data ?? [], null); + $this->setIfExists('three_d_offered_response', $data ?? [], null); + $this->setIfExists('three_ds_version', $data ?? [], null); + $this->setIfExists('visa_transaction_id', $data ?? [], null); + $this->setIfExists('xid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFraudResultTypeAllowableValues(); + if (!is_null($this->container['fraud_result_type']) && !in_array($this->container['fraud_result_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'fraud_result_type', must be one of '%s'", + $this->container['fraud_result_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!is_null($this->container['recurring_processing_model']) && !in_array($this->container['recurring_processing_model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $this->container['recurring_processing_model'], + 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 acquirer_account_code + * + * @return string|null + */ + public function getAcquirerAccountCode() + { + return $this->container['acquirer_account_code']; + } + + /** + * Sets acquirer_account_code + * + * @param string|null $acquirer_account_code The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. + * + * @return self + */ + public function setAcquirerAccountCode($acquirer_account_code) + { + if (is_null($acquirer_account_code)) { + throw new \InvalidArgumentException('non-nullable acquirer_account_code cannot be null'); + } + $this->container['acquirer_account_code'] = $acquirer_account_code; + + return $this; + } + + /** + * Gets acquirer_code + * + * @return string|null + */ + public function getAcquirerCode() + { + return $this->container['acquirer_code']; + } + + /** + * Sets acquirer_code + * + * @param string|null $acquirer_code The name of the acquirer processing the payment request. Example: TestPmmAcquirer + * + * @return self + */ + public function setAcquirerCode($acquirer_code) + { + if (is_null($acquirer_code)) { + throw new \InvalidArgumentException('non-nullable acquirer_code cannot be null'); + } + $this->container['acquirer_code'] = $acquirer_code; + + return $this; + } + + /** + * Gets acquirer_reference + * + * @return string|null + */ + public function getAcquirerReference() + { + return $this->container['acquirer_reference']; + } + + /** + * Sets acquirer_reference + * + * @param string|null $acquirer_reference The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 + * + * @return self + */ + public function setAcquirerReference($acquirer_reference) + { + if (is_null($acquirer_reference)) { + throw new \InvalidArgumentException('non-nullable acquirer_reference cannot be null'); + } + $this->container['acquirer_reference'] = $acquirer_reference; + + return $this; + } + + /** + * Gets alias + * + * @return string|null + */ + public function getAlias() + { + return $this->container['alias']; + } + + /** + * Sets alias + * + * @param string|null $alias The Adyen alias of the card. Example: H167852639363479 + * + * @return self + */ + public function setAlias($alias) + { + if (is_null($alias)) { + throw new \InvalidArgumentException('non-nullable alias cannot be null'); + } + $this->container['alias'] = $alias; + + return $this; + } + + /** + * Gets alias_type + * + * @return string|null + */ + public function getAliasType() + { + return $this->container['alias_type']; + } + + /** + * Sets alias_type + * + * @param string|null $alias_type The type of the card alias. Example: Default + * + * @return self + */ + public function setAliasType($alias_type) + { + if (is_null($alias_type)) { + throw new \InvalidArgumentException('non-nullable alias_type cannot be null'); + } + $this->container['alias_type'] = $alias_type; + + return $this; + } + + /** + * Gets auth_code + * + * @return string|null + */ + public function getAuthCode() + { + return $this->container['auth_code']; + } + + /** + * Sets auth_code + * + * @param string|null $auth_code Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 + * + * @return self + */ + public function setAuthCode($auth_code) + { + if (is_null($auth_code)) { + throw new \InvalidArgumentException('non-nullable auth_code cannot be null'); + } + $this->container['auth_code'] = $auth_code; + + return $this; + } + + /** + * Gets authorisation_mid + * + * @return string|null + */ + public function getAuthorisationMid() + { + return $this->container['authorisation_mid']; + } + + /** + * Sets authorisation_mid + * + * @param string|null $authorisation_mid Merchant ID known by the acquirer. + * + * @return self + */ + public function setAuthorisationMid($authorisation_mid) + { + if (is_null($authorisation_mid)) { + throw new \InvalidArgumentException('non-nullable authorisation_mid cannot be null'); + } + $this->container['authorisation_mid'] = $authorisation_mid; + + return $this; + } + + /** + * Gets authorised_amount_currency + * + * @return string|null + */ + public function getAuthorisedAmountCurrency() + { + return $this->container['authorised_amount_currency']; + } + + /** + * Sets authorised_amount_currency + * + * @param string|null $authorised_amount_currency The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setAuthorisedAmountCurrency($authorised_amount_currency) + { + if (is_null($authorised_amount_currency)) { + throw new \InvalidArgumentException('non-nullable authorised_amount_currency cannot be null'); + } + $this->container['authorised_amount_currency'] = $authorised_amount_currency; + + return $this; + } + + /** + * Gets authorised_amount_value + * + * @return string|null + */ + public function getAuthorisedAmountValue() + { + return $this->container['authorised_amount_value']; + } + + /** + * Sets authorised_amount_value + * + * @param string|null $authorised_amount_value Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setAuthorisedAmountValue($authorised_amount_value) + { + if (is_null($authorised_amount_value)) { + throw new \InvalidArgumentException('non-nullable authorised_amount_value cannot be null'); + } + $this->container['authorised_amount_value'] = $authorised_amount_value; + + return $this; + } + + /** + * Gets avs_result + * + * @return string|null + */ + public function getAvsResult() + { + return $this->container['avs_result']; + } + + /** + * Sets avs_result + * + * @param string|null $avs_result The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). + * + * @return self + */ + public function setAvsResult($avs_result) + { + if (is_null($avs_result)) { + throw new \InvalidArgumentException('non-nullable avs_result cannot be null'); + } + $this->container['avs_result'] = $avs_result; + + return $this; + } + + /** + * Gets avs_result_raw + * + * @return string|null + */ + public function getAvsResultRaw() + { + return $this->container['avs_result_raw']; + } + + /** + * Sets avs_result_raw + * + * @param string|null $avs_result_raw Raw AVS result received from the acquirer, where available. Example: D + * + * @return self + */ + public function setAvsResultRaw($avs_result_raw) + { + if (is_null($avs_result_raw)) { + throw new \InvalidArgumentException('non-nullable avs_result_raw cannot be null'); + } + $this->container['avs_result_raw'] = $avs_result_raw; + + return $this; + } + + /** + * Gets bic + * + * @return string|null + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string|null $bic BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets co_branded_with + * + * @return string|null + */ + public function getCoBrandedWith() + { + return $this->container['co_branded_with']; + } + + /** + * Sets co_branded_with + * + * @param string|null $co_branded_with Includes the co-branded card information. + * + * @return self + */ + public function setCoBrandedWith($co_branded_with) + { + if (is_null($co_branded_with)) { + throw new \InvalidArgumentException('non-nullable co_branded_with cannot be null'); + } + $this->container['co_branded_with'] = $co_branded_with; + + return $this; + } + + /** + * Gets cvc_result + * + * @return string|null + */ + public function getCvcResult() + { + return $this->container['cvc_result']; + } + + /** + * Sets cvc_result + * + * @param string|null $cvc_result The result of CVC verification. + * + * @return self + */ + public function setCvcResult($cvc_result) + { + if (is_null($cvc_result)) { + throw new \InvalidArgumentException('non-nullable cvc_result cannot be null'); + } + $this->container['cvc_result'] = $cvc_result; + + return $this; + } + + /** + * Gets cvc_result_raw + * + * @return string|null + */ + public function getCvcResultRaw() + { + return $this->container['cvc_result_raw']; + } + + /** + * Sets cvc_result_raw + * + * @param string|null $cvc_result_raw The raw result of CVC verification. + * + * @return self + */ + public function setCvcResultRaw($cvc_result_raw) + { + if (is_null($cvc_result_raw)) { + throw new \InvalidArgumentException('non-nullable cvc_result_raw cannot be null'); + } + $this->container['cvc_result_raw'] = $cvc_result_raw; + + return $this; + } + + /** + * Gets ds_trans_id + * + * @return string|null + */ + public function getDsTransId() + { + return $this->container['ds_trans_id']; + } + + /** + * Sets ds_trans_id + * + * @param string|null $ds_trans_id Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. + * + * @return self + */ + public function setDsTransId($ds_trans_id) + { + if (is_null($ds_trans_id)) { + throw new \InvalidArgumentException('non-nullable ds_trans_id cannot be null'); + } + $this->container['ds_trans_id'] = $ds_trans_id; + + return $this; + } + + /** + * Gets eci + * + * @return string|null + */ + public function getEci() + { + return $this->container['eci']; + } + + /** + * Sets eci + * + * @param string|null $eci The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 + * + * @return self + */ + public function setEci($eci) + { + if (is_null($eci)) { + throw new \InvalidArgumentException('non-nullable eci cannot be null'); + } + $this->container['eci'] = $eci; + + return $this; + } + + /** + * Gets expiry_date + * + * @return string|null + */ + public function getExpiryDate() + { + return $this->container['expiry_date']; + } + + /** + * Sets expiry_date + * + * @param string|null $expiry_date The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. + * + * @return self + */ + public function setExpiryDate($expiry_date) + { + if (is_null($expiry_date)) { + throw new \InvalidArgumentException('non-nullable expiry_date cannot be null'); + } + $this->container['expiry_date'] = $expiry_date; + + return $this; + } + + /** + * Gets extra_costs_currency + * + * @return string|null + */ + public function getExtraCostsCurrency() + { + return $this->container['extra_costs_currency']; + } + + /** + * Sets extra_costs_currency + * + * @param string|null $extra_costs_currency The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR + * + * @return self + */ + public function setExtraCostsCurrency($extra_costs_currency) + { + if (is_null($extra_costs_currency)) { + throw new \InvalidArgumentException('non-nullable extra_costs_currency cannot be null'); + } + $this->container['extra_costs_currency'] = $extra_costs_currency; + + return $this; + } + + /** + * Gets extra_costs_value + * + * @return string|null + */ + public function getExtraCostsValue() + { + return $this->container['extra_costs_value']; + } + + /** + * Sets extra_costs_value + * + * @param string|null $extra_costs_value The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. + * + * @return self + */ + public function setExtraCostsValue($extra_costs_value) + { + if (is_null($extra_costs_value)) { + throw new \InvalidArgumentException('non-nullable extra_costs_value cannot be null'); + } + $this->container['extra_costs_value'] = $extra_costs_value; + + return $this; + } + + /** + * Gets fraud_check__item_nr__fraud_checkname + * + * @return string|null + */ + public function getFraudCheckItemNrFraudCheckname() + { + return $this->container['fraud_check__item_nr__fraud_checkname']; + } + + /** + * Sets fraud_check__item_nr__fraud_checkname + * + * @param string|null $fraud_check__item_nr__fraud_checkname The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. + * + * @return self + */ + public function setFraudCheckItemNrFraudCheckname($fraud_check__item_nr__fraud_checkname) + { + if (is_null($fraud_check__item_nr__fraud_checkname)) { + throw new \InvalidArgumentException('non-nullable fraud_check__item_nr__fraud_checkname cannot be null'); + } + $this->container['fraud_check__item_nr__fraud_checkname'] = $fraud_check__item_nr__fraud_checkname; + + return $this; + } + + /** + * Gets fraud_manual_review + * + * @return string|null + */ + public function getFraudManualReview() + { + return $this->container['fraud_manual_review']; + } + + /** + * Sets fraud_manual_review + * + * @param string|null $fraud_manual_review Indicates if the payment is sent to manual review. + * + * @return self + */ + public function setFraudManualReview($fraud_manual_review) + { + if (is_null($fraud_manual_review)) { + throw new \InvalidArgumentException('non-nullable fraud_manual_review cannot be null'); + } + $this->container['fraud_manual_review'] = $fraud_manual_review; + + return $this; + } + + /** + * Gets fraud_result_type + * + * @return string|null + */ + public function getFraudResultType() + { + return $this->container['fraud_result_type']; + } + + /** + * Sets fraud_result_type + * + * @param string|null $fraud_result_type The fraud result properties of the payment. + * + * @return self + */ + public function setFraudResultType($fraud_result_type) + { + if (is_null($fraud_result_type)) { + throw new \InvalidArgumentException('non-nullable fraud_result_type cannot be null'); + } + $allowedValues = $this->getFraudResultTypeAllowableValues(); + if (!in_array($fraud_result_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'fraud_result_type', must be one of '%s'", + $fraud_result_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['fraud_result_type'] = $fraud_result_type; + + return $this; + } + + /** + * Gets funding_source + * + * @return string|null + */ + public function getFundingSource() + { + return $this->container['funding_source']; + } + + /** + * Sets funding_source + * + * @param string|null $funding_source Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. + * + * @return self + */ + public function setFundingSource($funding_source) + { + if (is_null($funding_source)) { + throw new \InvalidArgumentException('non-nullable funding_source cannot be null'); + } + $this->container['funding_source'] = $funding_source; + + return $this; + } + + /** + * Gets funds_availability + * + * @return string|null + */ + public function getFundsAvailability() + { + return $this->container['funds_availability']; + } + + /** + * Sets funds_availability + * + * @param string|null $funds_availability Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". + * + * @return self + */ + public function setFundsAvailability($funds_availability) + { + if (is_null($funds_availability)) { + throw new \InvalidArgumentException('non-nullable funds_availability cannot be null'); + } + $this->container['funds_availability'] = $funds_availability; + + return $this; + } + + /** + * Gets inferred_refusal_reason + * + * @return string|null + */ + public function getInferredRefusalReason() + { + return $this->container['inferred_refusal_reason']; + } + + /** + * Sets inferred_refusal_reason + * + * @param string|null $inferred_refusal_reason Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card + * + * @return self + */ + public function setInferredRefusalReason($inferred_refusal_reason) + { + if (is_null($inferred_refusal_reason)) { + throw new \InvalidArgumentException('non-nullable inferred_refusal_reason cannot be null'); + } + $this->container['inferred_refusal_reason'] = $inferred_refusal_reason; + + return $this; + } + + /** + * Gets is_card_commercial + * + * @return string|null + */ + public function getIsCardCommercial() + { + return $this->container['is_card_commercial']; + } + + /** + * Sets is_card_commercial + * + * @param string|null $is_card_commercial Indicates if the card is used for business purposes only. + * + * @return self + */ + public function setIsCardCommercial($is_card_commercial) + { + if (is_null($is_card_commercial)) { + throw new \InvalidArgumentException('non-nullable is_card_commercial cannot be null'); + } + $this->container['is_card_commercial'] = $is_card_commercial; + + return $this; + } + + /** + * Gets issuer_country + * + * @return string|null + */ + public function getIssuerCountry() + { + return $this->container['issuer_country']; + } + + /** + * Sets issuer_country + * + * @param string|null $issuer_country The issuing country of the card based on the BIN list that Adyen maintains. Example: JP + * + * @return self + */ + public function setIssuerCountry($issuer_country) + { + if (is_null($issuer_country)) { + throw new \InvalidArgumentException('non-nullable issuer_country cannot be null'); + } + $this->container['issuer_country'] = $issuer_country; + + return $this; + } + + /** + * Gets liability_shift + * + * @return string|null + */ + public function getLiabilityShift() + { + return $this->container['liability_shift']; + } + + /** + * Sets liability_shift + * + * @param string|null $liability_shift A Boolean value indicating whether a liability shift was offered for this payment. + * + * @return self + */ + public function setLiabilityShift($liability_shift) + { + if (is_null($liability_shift)) { + throw new \InvalidArgumentException('non-nullable liability_shift cannot be null'); + } + $this->container['liability_shift'] = $liability_shift; + + return $this; + } + + /** + * Gets mc_bank_net_reference_number + * + * @return string|null + */ + public function getMcBankNetReferenceNumber() + { + return $this->container['mc_bank_net_reference_number']; + } + + /** + * Sets mc_bank_net_reference_number + * + * @param string|null $mc_bank_net_reference_number The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. + * + * @return self + */ + public function setMcBankNetReferenceNumber($mc_bank_net_reference_number) + { + if (is_null($mc_bank_net_reference_number)) { + throw new \InvalidArgumentException('non-nullable mc_bank_net_reference_number cannot be null'); + } + $this->container['mc_bank_net_reference_number'] = $mc_bank_net_reference_number; + + return $this; + } + + /** + * Gets merchant_advice_code + * + * @return string|null + */ + public function getMerchantAdviceCode() + { + return $this->container['merchant_advice_code']; + } + + /** + * Sets merchant_advice_code + * + * @param string|null $merchant_advice_code The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). + * + * @return self + */ + public function setMerchantAdviceCode($merchant_advice_code) + { + if (is_null($merchant_advice_code)) { + throw new \InvalidArgumentException('non-nullable merchant_advice_code cannot be null'); + } + $this->container['merchant_advice_code'] = $merchant_advice_code; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string|null + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string|null $merchant_reference The reference provided for the transaction. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets network_tx_reference + * + * @return string|null + */ + public function getNetworkTxReference() + { + return $this->container['network_tx_reference']; + } + + /** + * Sets network_tx_reference + * + * @param string|null $network_tx_reference Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + * + * @return self + */ + public function setNetworkTxReference($network_tx_reference) + { + if (is_null($network_tx_reference)) { + throw new \InvalidArgumentException('non-nullable network_tx_reference cannot be null'); + } + $this->container['network_tx_reference'] = $network_tx_reference; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. + * + * @return self + */ + public function setOwnerName($owner_name) + { + if (is_null($owner_name)) { + throw new \InvalidArgumentException('non-nullable owner_name cannot be null'); + } + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets payment_account_reference + * + * @return string|null + */ + public function getPaymentAccountReference() + { + return $this->container['payment_account_reference']; + } + + /** + * Sets payment_account_reference + * + * @param string|null $payment_account_reference The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. + * + * @return self + */ + public function setPaymentAccountReference($payment_account_reference) + { + if (is_null($payment_account_reference)) { + throw new \InvalidArgumentException('non-nullable payment_account_reference cannot be null'); + } + $this->container['payment_account_reference'] = $payment_account_reference; + + return $this; + } + + /** + * Gets payment_method + * + * @return string|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param string|null $payment_method The payment method used in the transaction. + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets payment_method_variant + * + * @return string|null + */ + public function getPaymentMethodVariant() + { + return $this->container['payment_method_variant']; + } + + /** + * Sets payment_method_variant + * + * @param string|null $payment_method_variant The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro + * + * @return self + */ + public function setPaymentMethodVariant($payment_method_variant) + { + if (is_null($payment_method_variant)) { + throw new \InvalidArgumentException('non-nullable payment_method_variant cannot be null'); + } + $this->container['payment_method_variant'] = $payment_method_variant; + + return $this; + } + + /** + * Gets payout_eligible + * + * @return string|null + */ + public function getPayoutEligible() + { + return $this->container['payout_eligible']; + } + + /** + * Sets payout_eligible + * + * @param string|null $payout_eligible Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) + * + * @return self + */ + public function setPayoutEligible($payout_eligible) + { + if (is_null($payout_eligible)) { + throw new \InvalidArgumentException('non-nullable payout_eligible cannot be null'); + } + $this->container['payout_eligible'] = $payout_eligible; + + return $this; + } + + /** + * Gets realtime_account_updater_status + * + * @return string|null + */ + public function getRealtimeAccountUpdaterStatus() + { + return $this->container['realtime_account_updater_status']; + } + + /** + * Sets realtime_account_updater_status + * + * @param string|null $realtime_account_updater_status The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder + * + * @return self + */ + public function setRealtimeAccountUpdaterStatus($realtime_account_updater_status) + { + if (is_null($realtime_account_updater_status)) { + throw new \InvalidArgumentException('non-nullable realtime_account_updater_status cannot be null'); + } + $this->container['realtime_account_updater_status'] = $realtime_account_updater_status; + + return $this; + } + + /** + * Gets receipt_free_text + * + * @return string|null + */ + public function getReceiptFreeText() + { + return $this->container['receipt_free_text']; + } + + /** + * Sets receipt_free_text + * + * @param string|null $receipt_free_text Message to be displayed on the terminal. + * + * @return self + */ + public function setReceiptFreeText($receipt_free_text) + { + if (is_null($receipt_free_text)) { + throw new \InvalidArgumentException('non-nullable receipt_free_text cannot be null'); + } + $this->container['receipt_free_text'] = $receipt_free_text; + + return $this; + } + + /** + * Gets recurring_contract_types + * + * @return string|null + */ + public function getRecurringContractTypes() + { + return $this->container['recurring_contract_types']; + } + + /** + * Sets recurring_contract_types + * + * @param string|null $recurring_contract_types The recurring contract types applicable to the transaction. + * + * @return self + */ + public function setRecurringContractTypes($recurring_contract_types) + { + if (is_null($recurring_contract_types)) { + throw new \InvalidArgumentException('non-nullable recurring_contract_types cannot be null'); + } + $this->container['recurring_contract_types'] = $recurring_contract_types; + + return $this; + } + + /** + * Gets recurring_first_psp_reference + * + * @return string|null + */ + public function getRecurringFirstPspReference() + { + return $this->container['recurring_first_psp_reference']; + } + + /** + * Sets recurring_first_psp_reference + * + * @param string|null $recurring_first_psp_reference The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. + * + * @return self + */ + public function setRecurringFirstPspReference($recurring_first_psp_reference) + { + if (is_null($recurring_first_psp_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_first_psp_reference cannot be null'); + } + $this->container['recurring_first_psp_reference'] = $recurring_first_psp_reference; + + return $this; + } + + /** + * Gets recurring_recurring_detail_reference + * + * @return string|null + */ + public function getRecurringRecurringDetailReference() + { + return $this->container['recurring_recurring_detail_reference']; + } + + /** + * Sets recurring_recurring_detail_reference + * + * @param string|null $recurring_recurring_detail_reference The reference that uniquely identifies the recurring transaction. + * + * @return self + */ + public function setRecurringRecurringDetailReference($recurring_recurring_detail_reference) + { + if (is_null($recurring_recurring_detail_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_recurring_detail_reference cannot be null'); + } + $this->container['recurring_recurring_detail_reference'] = $recurring_recurring_detail_reference; + + return $this; + } + + /** + * Gets recurring_shopper_reference + * + * @return string|null + */ + public function getRecurringShopperReference() + { + return $this->container['recurring_shopper_reference']; + } + + /** + * Sets recurring_shopper_reference + * + * @param string|null $recurring_shopper_reference The provided reference of the shopper for a recurring transaction. + * + * @return self + */ + public function setRecurringShopperReference($recurring_shopper_reference) + { + if (is_null($recurring_shopper_reference)) { + throw new \InvalidArgumentException('non-nullable recurring_shopper_reference cannot be null'); + } + $this->container['recurring_shopper_reference'] = $recurring_shopper_reference; + + return $this; + } + + /** + * Gets recurring_processing_model + * + * @return string|null + */ + public function getRecurringProcessingModel() + { + return $this->container['recurring_processing_model']; + } + + /** + * Sets recurring_processing_model + * + * @param string|null $recurring_processing_model The processing model used for the recurring transaction. + * + * @return self + */ + public function setRecurringProcessingModel($recurring_processing_model) + { + if (is_null($recurring_processing_model)) { + throw new \InvalidArgumentException('non-nullable recurring_processing_model cannot be null'); + } + $allowedValues = $this->getRecurringProcessingModelAllowableValues(); + if (!in_array($recurring_processing_model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'recurring_processing_model', must be one of '%s'", + $recurring_processing_model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['recurring_processing_model'] = $recurring_processing_model; + + return $this; + } + + /** + * Gets referred + * + * @return string|null + */ + public function getReferred() + { + return $this->container['referred']; + } + + /** + * Sets referred + * + * @param string|null $referred If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true + * + * @return self + */ + public function setReferred($referred) + { + if (is_null($referred)) { + throw new \InvalidArgumentException('non-nullable referred cannot be null'); + } + $this->container['referred'] = $referred; + + return $this; + } + + /** + * Gets refusal_reason_raw + * + * @return string|null + */ + public function getRefusalReasonRaw() + { + return $this->container['refusal_reason_raw']; + } + + /** + * Sets refusal_reason_raw + * + * @param string|null $refusal_reason_raw Raw refusal reason received from the acquirer, where available. Example: AUTHORISED + * + * @return self + */ + public function setRefusalReasonRaw($refusal_reason_raw) + { + if (is_null($refusal_reason_raw)) { + throw new \InvalidArgumentException('non-nullable refusal_reason_raw cannot be null'); + } + $this->container['refusal_reason_raw'] = $refusal_reason_raw; + + return $this; + } + + /** + * Gets request_amount + * + * @return string|null + */ + public function getRequestAmount() + { + return $this->container['request_amount']; + } + + /** + * Sets request_amount + * + * @param string|null $request_amount The amount of the payment request. + * + * @return self + */ + public function setRequestAmount($request_amount) + { + if (is_null($request_amount)) { + throw new \InvalidArgumentException('non-nullable request_amount cannot be null'); + } + $this->container['request_amount'] = $request_amount; + + return $this; + } + + /** + * Gets request_currency_code + * + * @return string|null + */ + public function getRequestCurrencyCode() + { + return $this->container['request_currency_code']; + } + + /** + * Sets request_currency_code + * + * @param string|null $request_currency_code The currency of the payment request. + * + * @return self + */ + public function setRequestCurrencyCode($request_currency_code) + { + if (is_null($request_currency_code)) { + throw new \InvalidArgumentException('non-nullable request_currency_code cannot be null'); + } + $this->container['request_currency_code'] = $request_currency_code; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction The shopper interaction type of the payment request. Example: Ecommerce + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets shopper_reference + * + * @return string|null + */ + public function getShopperReference() + { + return $this->container['shopper_reference']; + } + + /** + * Sets shopper_reference + * + * @param string|null $shopper_reference The shopperReference passed in the payment request. Example: AdyenTestShopperXX + * + * @return self + */ + public function setShopperReference($shopper_reference) + { + if (is_null($shopper_reference)) { + throw new \InvalidArgumentException('non-nullable shopper_reference cannot be null'); + } + $this->container['shopper_reference'] = $shopper_reference; + + return $this; + } + + /** + * Gets terminal_id + * + * @return string|null + */ + public function getTerminalId() + { + return $this->container['terminal_id']; + } + + /** + * Sets terminal_id + * + * @param string|null $terminal_id The terminal ID used in a point-of-sale payment. Example: 06022622 + * + * @return self + */ + public function setTerminalId($terminal_id) + { + if (is_null($terminal_id)) { + throw new \InvalidArgumentException('non-nullable terminal_id cannot be null'); + } + $this->container['terminal_id'] = $terminal_id; + + return $this; + } + + /** + * Gets three_d_authenticated + * + * @return string|null + */ + public function getThreeDAuthenticated() + { + return $this->container['three_d_authenticated']; + } + + /** + * Sets three_d_authenticated + * + * @param string|null $three_d_authenticated A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + * + * @return self + */ + public function setThreeDAuthenticated($three_d_authenticated) + { + if (is_null($three_d_authenticated)) { + throw new \InvalidArgumentException('non-nullable three_d_authenticated cannot be null'); + } + $this->container['three_d_authenticated'] = $three_d_authenticated; + + return $this; + } + + /** + * Gets three_d_authenticated_response + * + * @return string|null + */ + public function getThreeDAuthenticatedResponse() + { + return $this->container['three_d_authenticated_response']; + } + + /** + * Sets three_d_authenticated_response + * + * @param string|null $three_d_authenticated_response The raw 3DS authentication result from the card issuer. Example: N + * + * @return self + */ + public function setThreeDAuthenticatedResponse($three_d_authenticated_response) + { + if (is_null($three_d_authenticated_response)) { + throw new \InvalidArgumentException('non-nullable three_d_authenticated_response cannot be null'); + } + $this->container['three_d_authenticated_response'] = $three_d_authenticated_response; + + return $this; + } + + /** + * Gets three_d_offered + * + * @return string|null + */ + public function getThreeDOffered() + { + return $this->container['three_d_offered']; + } + + /** + * Sets three_d_offered + * + * @param string|null $three_d_offered A Boolean value indicating whether 3DS was offered for this payment. Example: true + * + * @return self + */ + public function setThreeDOffered($three_d_offered) + { + if (is_null($three_d_offered)) { + throw new \InvalidArgumentException('non-nullable three_d_offered cannot be null'); + } + $this->container['three_d_offered'] = $three_d_offered; + + return $this; + } + + /** + * Gets three_d_offered_response + * + * @return string|null + */ + public function getThreeDOfferedResponse() + { + return $this->container['three_d_offered_response']; + } + + /** + * Sets three_d_offered_response + * + * @param string|null $three_d_offered_response The raw enrollment result from the 3DS directory services of the card schemes. Example: Y + * + * @return self + */ + public function setThreeDOfferedResponse($three_d_offered_response) + { + if (is_null($three_d_offered_response)) { + throw new \InvalidArgumentException('non-nullable three_d_offered_response cannot be null'); + } + $this->container['three_d_offered_response'] = $three_d_offered_response; + + return $this; + } + + /** + * Gets three_ds_version + * + * @return string|null + */ + public function getThreeDsVersion() + { + return $this->container['three_ds_version']; + } + + /** + * Sets three_ds_version + * + * @param string|null $three_ds_version The 3D Secure 2 version. + * + * @return self + */ + public function setThreeDsVersion($three_ds_version) + { + if (is_null($three_ds_version)) { + throw new \InvalidArgumentException('non-nullable three_ds_version cannot be null'); + } + $this->container['three_ds_version'] = $three_ds_version; + + return $this; + } + + /** + * Gets visa_transaction_id + * + * @return string|null + */ + public function getVisaTransactionId() + { + return $this->container['visa_transaction_id']; + } + + /** + * Sets visa_transaction_id + * + * @param string|null $visa_transaction_id The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. + * + * @return self + */ + public function setVisaTransactionId($visa_transaction_id) + { + if (is_null($visa_transaction_id)) { + throw new \InvalidArgumentException('non-nullable visa_transaction_id cannot be null'); + } + $this->container['visa_transaction_id'] = $visa_transaction_id; + + return $this; + } + + /** + * Gets xid + * + * @return string|null + */ + public function getXid() + { + return $this->container['xid']; + } + + /** + * Sets xid + * + * @param string|null $xid The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. If you want to submit the xid in your 3D Secure 1 request, use the `mpiData.xid`, field. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= + * + * @return self + */ + public function setXid($xid) + { + if (is_null($xid)) { + throw new \InvalidArgumentException('non-nullable xid cannot be null'); + } + $this->container['xid'] = $xid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalDataInstallments.php b/src/Adyen/Model/Payments/ResponseAdditionalDataInstallments.php new file mode 100644 index 000000000..5b8ed7b5b --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataInstallments.php @@ -0,0 +1,759 @@ + + */ +class ResponseAdditionalDataInstallments implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataInstallments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'installment_payment_data_installment_type' => 'string', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'string', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'string', + 'installment_payment_data_option_item_nr_installment_fee' => 'string', + 'installment_payment_data_option_item_nr_interest_rate' => 'string', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'string', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'string', + 'installment_payment_data_option_item_nr_number_of_installments' => 'string', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'string', + 'installment_payment_data_option_item_nr_total_amount_due' => 'string', + 'installment_payment_data_payment_options' => 'string', + 'installments_value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'installment_payment_data_installment_type' => null, + 'installment_payment_data_option_item_nr_annual_percentage_rate' => null, + 'installment_payment_data_option_item_nr_first_installment_amount' => null, + 'installment_payment_data_option_item_nr_installment_fee' => null, + 'installment_payment_data_option_item_nr_interest_rate' => null, + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => null, + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => null, + 'installment_payment_data_option_item_nr_number_of_installments' => null, + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => null, + 'installment_payment_data_option_item_nr_total_amount_due' => null, + 'installment_payment_data_payment_options' => null, + 'installments_value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'installment_payment_data_installment_type' => false, + 'installment_payment_data_option_item_nr_annual_percentage_rate' => false, + 'installment_payment_data_option_item_nr_first_installment_amount' => false, + 'installment_payment_data_option_item_nr_installment_fee' => false, + 'installment_payment_data_option_item_nr_interest_rate' => false, + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => false, + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => false, + 'installment_payment_data_option_item_nr_number_of_installments' => false, + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => false, + 'installment_payment_data_option_item_nr_total_amount_due' => false, + 'installment_payment_data_payment_options' => false, + 'installments_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'installment_payment_data_installment_type' => 'installmentPaymentData.installmentType', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'installmentPaymentData.option[itemNr].annualPercentageRate', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'installmentPaymentData.option[itemNr].firstInstallmentAmount', + 'installment_payment_data_option_item_nr_installment_fee' => 'installmentPaymentData.option[itemNr].installmentFee', + 'installment_payment_data_option_item_nr_interest_rate' => 'installmentPaymentData.option[itemNr].interestRate', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'installmentPaymentData.option[itemNr].maximumNumberOfInstallments', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'installmentPaymentData.option[itemNr].minimumNumberOfInstallments', + 'installment_payment_data_option_item_nr_number_of_installments' => 'installmentPaymentData.option[itemNr].numberOfInstallments', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'installmentPaymentData.option[itemNr].subsequentInstallmentAmount', + 'installment_payment_data_option_item_nr_total_amount_due' => 'installmentPaymentData.option[itemNr].totalAmountDue', + 'installment_payment_data_payment_options' => 'installmentPaymentData.paymentOptions', + 'installments_value' => 'installments.value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'installment_payment_data_installment_type' => 'setInstallmentPaymentDataInstallmentType', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'setInstallmentPaymentDataOptionItemNrAnnualPercentageRate', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'setInstallmentPaymentDataOptionItemNrFirstInstallmentAmount', + 'installment_payment_data_option_item_nr_installment_fee' => 'setInstallmentPaymentDataOptionItemNrInstallmentFee', + 'installment_payment_data_option_item_nr_interest_rate' => 'setInstallmentPaymentDataOptionItemNrInterestRate', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'setInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments', + 'installment_payment_data_option_item_nr_number_of_installments' => 'setInstallmentPaymentDataOptionItemNrNumberOfInstallments', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'setInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount', + 'installment_payment_data_option_item_nr_total_amount_due' => 'setInstallmentPaymentDataOptionItemNrTotalAmountDue', + 'installment_payment_data_payment_options' => 'setInstallmentPaymentDataPaymentOptions', + 'installments_value' => 'setInstallmentsValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'installment_payment_data_installment_type' => 'getInstallmentPaymentDataInstallmentType', + 'installment_payment_data_option_item_nr_annual_percentage_rate' => 'getInstallmentPaymentDataOptionItemNrAnnualPercentageRate', + 'installment_payment_data_option_item_nr_first_installment_amount' => 'getInstallmentPaymentDataOptionItemNrFirstInstallmentAmount', + 'installment_payment_data_option_item_nr_installment_fee' => 'getInstallmentPaymentDataOptionItemNrInstallmentFee', + 'installment_payment_data_option_item_nr_interest_rate' => 'getInstallmentPaymentDataOptionItemNrInterestRate', + 'installment_payment_data_option_item_nr_maximum_number_of_installments' => 'getInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments', + 'installment_payment_data_option_item_nr_minimum_number_of_installments' => 'getInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments', + 'installment_payment_data_option_item_nr_number_of_installments' => 'getInstallmentPaymentDataOptionItemNrNumberOfInstallments', + 'installment_payment_data_option_item_nr_subsequent_installment_amount' => 'getInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount', + 'installment_payment_data_option_item_nr_total_amount_due' => 'getInstallmentPaymentDataOptionItemNrTotalAmountDue', + 'installment_payment_data_payment_options' => 'getInstallmentPaymentDataPaymentOptions', + 'installments_value' => 'getInstallmentsValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('installment_payment_data_installment_type', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_annual_percentage_rate', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_first_installment_amount', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_installment_fee', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_interest_rate', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_maximum_number_of_installments', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_minimum_number_of_installments', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_number_of_installments', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_subsequent_installment_amount', $data ?? [], null); + $this->setIfExists('installment_payment_data_option_item_nr_total_amount_due', $data ?? [], null); + $this->setIfExists('installment_payment_data_payment_options', $data ?? [], null); + $this->setIfExists('installments_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 installment_payment_data_installment_type + * + * @return string|null + */ + public function getInstallmentPaymentDataInstallmentType() + { + return $this->container['installment_payment_data_installment_type']; + } + + /** + * Sets installment_payment_data_installment_type + * + * @param string|null $installment_payment_data_installment_type Type of installment. The value of `installmentType` should be **IssuerFinanced**. + * + * @return self + */ + public function setInstallmentPaymentDataInstallmentType($installment_payment_data_installment_type) + { + if (is_null($installment_payment_data_installment_type)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_installment_type cannot be null'); + } + $this->container['installment_payment_data_installment_type'] = $installment_payment_data_installment_type; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_annual_percentage_rate + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrAnnualPercentageRate() + { + return $this->container['installment_payment_data_option_item_nr_annual_percentage_rate']; + } + + /** + * Sets installment_payment_data_option_item_nr_annual_percentage_rate + * + * @param string|null $installment_payment_data_option_item_nr_annual_percentage_rate Annual interest rate. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrAnnualPercentageRate($installment_payment_data_option_item_nr_annual_percentage_rate) + { + if (is_null($installment_payment_data_option_item_nr_annual_percentage_rate)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_annual_percentage_rate cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_annual_percentage_rate'] = $installment_payment_data_option_item_nr_annual_percentage_rate; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_first_installment_amount + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrFirstInstallmentAmount() + { + return $this->container['installment_payment_data_option_item_nr_first_installment_amount']; + } + + /** + * Sets installment_payment_data_option_item_nr_first_installment_amount + * + * @param string|null $installment_payment_data_option_item_nr_first_installment_amount First Installment Amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrFirstInstallmentAmount($installment_payment_data_option_item_nr_first_installment_amount) + { + if (is_null($installment_payment_data_option_item_nr_first_installment_amount)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_first_installment_amount cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_first_installment_amount'] = $installment_payment_data_option_item_nr_first_installment_amount; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_installment_fee + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrInstallmentFee() + { + return $this->container['installment_payment_data_option_item_nr_installment_fee']; + } + + /** + * Sets installment_payment_data_option_item_nr_installment_fee + * + * @param string|null $installment_payment_data_option_item_nr_installment_fee Installment fee amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrInstallmentFee($installment_payment_data_option_item_nr_installment_fee) + { + if (is_null($installment_payment_data_option_item_nr_installment_fee)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_installment_fee cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_installment_fee'] = $installment_payment_data_option_item_nr_installment_fee; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_interest_rate + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrInterestRate() + { + return $this->container['installment_payment_data_option_item_nr_interest_rate']; + } + + /** + * Sets installment_payment_data_option_item_nr_interest_rate + * + * @param string|null $installment_payment_data_option_item_nr_interest_rate Interest rate for the installment period. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrInterestRate($installment_payment_data_option_item_nr_interest_rate) + { + if (is_null($installment_payment_data_option_item_nr_interest_rate)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_interest_rate cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_interest_rate'] = $installment_payment_data_option_item_nr_interest_rate; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_maximum_number_of_installments + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments() + { + return $this->container['installment_payment_data_option_item_nr_maximum_number_of_installments']; + } + + /** + * Sets installment_payment_data_option_item_nr_maximum_number_of_installments + * + * @param string|null $installment_payment_data_option_item_nr_maximum_number_of_installments Maximum number of installments possible for this payment. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments($installment_payment_data_option_item_nr_maximum_number_of_installments) + { + if (is_null($installment_payment_data_option_item_nr_maximum_number_of_installments)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_maximum_number_of_installments cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_maximum_number_of_installments'] = $installment_payment_data_option_item_nr_maximum_number_of_installments; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_minimum_number_of_installments + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments() + { + return $this->container['installment_payment_data_option_item_nr_minimum_number_of_installments']; + } + + /** + * Sets installment_payment_data_option_item_nr_minimum_number_of_installments + * + * @param string|null $installment_payment_data_option_item_nr_minimum_number_of_installments Minimum number of installments possible for this payment. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments($installment_payment_data_option_item_nr_minimum_number_of_installments) + { + if (is_null($installment_payment_data_option_item_nr_minimum_number_of_installments)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_minimum_number_of_installments cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_minimum_number_of_installments'] = $installment_payment_data_option_item_nr_minimum_number_of_installments; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_number_of_installments + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrNumberOfInstallments() + { + return $this->container['installment_payment_data_option_item_nr_number_of_installments']; + } + + /** + * Sets installment_payment_data_option_item_nr_number_of_installments + * + * @param string|null $installment_payment_data_option_item_nr_number_of_installments Total number of installments possible for this payment. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrNumberOfInstallments($installment_payment_data_option_item_nr_number_of_installments) + { + if (is_null($installment_payment_data_option_item_nr_number_of_installments)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_number_of_installments cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_number_of_installments'] = $installment_payment_data_option_item_nr_number_of_installments; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_subsequent_installment_amount + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount() + { + return $this->container['installment_payment_data_option_item_nr_subsequent_installment_amount']; + } + + /** + * Sets installment_payment_data_option_item_nr_subsequent_installment_amount + * + * @param string|null $installment_payment_data_option_item_nr_subsequent_installment_amount Subsequent Installment Amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount($installment_payment_data_option_item_nr_subsequent_installment_amount) + { + if (is_null($installment_payment_data_option_item_nr_subsequent_installment_amount)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_subsequent_installment_amount cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_subsequent_installment_amount'] = $installment_payment_data_option_item_nr_subsequent_installment_amount; + + return $this; + } + + /** + * Gets installment_payment_data_option_item_nr_total_amount_due + * + * @return string|null + */ + public function getInstallmentPaymentDataOptionItemNrTotalAmountDue() + { + return $this->container['installment_payment_data_option_item_nr_total_amount_due']; + } + + /** + * Sets installment_payment_data_option_item_nr_total_amount_due + * + * @param string|null $installment_payment_data_option_item_nr_total_amount_due Total amount in minor units. + * + * @return self + */ + public function setInstallmentPaymentDataOptionItemNrTotalAmountDue($installment_payment_data_option_item_nr_total_amount_due) + { + if (is_null($installment_payment_data_option_item_nr_total_amount_due)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_option_item_nr_total_amount_due cannot be null'); + } + $this->container['installment_payment_data_option_item_nr_total_amount_due'] = $installment_payment_data_option_item_nr_total_amount_due; + + return $this; + } + + /** + * Gets installment_payment_data_payment_options + * + * @return string|null + */ + public function getInstallmentPaymentDataPaymentOptions() + { + return $this->container['installment_payment_data_payment_options']; + } + + /** + * Sets installment_payment_data_payment_options + * + * @param string|null $installment_payment_data_payment_options Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments + * + * @return self + */ + public function setInstallmentPaymentDataPaymentOptions($installment_payment_data_payment_options) + { + if (is_null($installment_payment_data_payment_options)) { + throw new \InvalidArgumentException('non-nullable installment_payment_data_payment_options cannot be null'); + } + $this->container['installment_payment_data_payment_options'] = $installment_payment_data_payment_options; + + return $this; + } + + /** + * Gets installments_value + * + * @return string|null + */ + public function getInstallmentsValue() + { + return $this->container['installments_value']; + } + + /** + * Sets installments_value + * + * @param string|null $installments_value The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. + * + * @return self + */ + public function setInstallmentsValue($installments_value) + { + if (is_null($installments_value)) { + throw new \InvalidArgumentException('non-nullable installments_value cannot be null'); + } + $this->container['installments_value'] = $installments_value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalDataNetworkTokens.php b/src/Adyen/Model/Payments/ResponseAdditionalDataNetworkTokens.php new file mode 100644 index 000000000..caa6fedd6 --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataNetworkTokens.php @@ -0,0 +1,453 @@ + + */ +class ResponseAdditionalDataNetworkTokens implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataNetworkTokens'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'network_token_available' => 'string', + 'network_token_bin' => 'string', + 'network_token_token_summary' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'network_token_available' => null, + 'network_token_bin' => null, + 'network_token_token_summary' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'network_token_available' => false, + 'network_token_bin' => false, + 'network_token_token_summary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'network_token_available' => 'networkToken.available', + 'network_token_bin' => 'networkToken.bin', + 'network_token_token_summary' => 'networkToken.tokenSummary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'network_token_available' => 'setNetworkTokenAvailable', + 'network_token_bin' => 'setNetworkTokenBin', + 'network_token_token_summary' => 'setNetworkTokenTokenSummary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'network_token_available' => 'getNetworkTokenAvailable', + 'network_token_bin' => 'getNetworkTokenBin', + 'network_token_token_summary' => 'getNetworkTokenTokenSummary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('network_token_available', $data ?? [], null); + $this->setIfExists('network_token_bin', $data ?? [], null); + $this->setIfExists('network_token_token_summary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets network_token_available + * + * @return string|null + */ + public function getNetworkTokenAvailable() + { + return $this->container['network_token_available']; + } + + /** + * Sets network_token_available + * + * @param string|null $network_token_available Indicates whether a network token is available for the specified card. + * + * @return self + */ + public function setNetworkTokenAvailable($network_token_available) + { + if (is_null($network_token_available)) { + throw new \InvalidArgumentException('non-nullable network_token_available cannot be null'); + } + $this->container['network_token_available'] = $network_token_available; + + return $this; + } + + /** + * Gets network_token_bin + * + * @return string|null + */ + public function getNetworkTokenBin() + { + return $this->container['network_token_bin']; + } + + /** + * Sets network_token_bin + * + * @param string|null $network_token_bin The Bank Identification Number of a tokenized card, which is the first six digits of a card number. + * + * @return self + */ + public function setNetworkTokenBin($network_token_bin) + { + if (is_null($network_token_bin)) { + throw new \InvalidArgumentException('non-nullable network_token_bin cannot be null'); + } + $this->container['network_token_bin'] = $network_token_bin; + + return $this; + } + + /** + * Gets network_token_token_summary + * + * @return string|null + */ + public function getNetworkTokenTokenSummary() + { + return $this->container['network_token_token_summary']; + } + + /** + * Sets network_token_token_summary + * + * @param string|null $network_token_token_summary The last four digits of a network token. + * + * @return self + */ + public function setNetworkTokenTokenSummary($network_token_token_summary) + { + if (is_null($network_token_token_summary)) { + throw new \InvalidArgumentException('non-nullable network_token_token_summary cannot be null'); + } + $this->container['network_token_token_summary'] = $network_token_token_summary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalDataOpi.php b/src/Adyen/Model/Payments/ResponseAdditionalDataOpi.php new file mode 100644 index 000000000..e2a3c01ab --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataOpi.php @@ -0,0 +1,385 @@ + + */ +class ResponseAdditionalDataOpi implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataOpi'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'opi_trans_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'opi_trans_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'opi_trans_token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'opi_trans_token' => 'opi.transToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'opi_trans_token' => 'setOpiTransToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'opi_trans_token' => 'getOpiTransToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('opi_trans_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets opi_trans_token + * + * @return string|null + */ + public function getOpiTransToken() + { + return $this->container['opi_trans_token']; + } + + /** + * Sets opi_trans_token + * + * @param string|null $opi_trans_token Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + * + * @return self + */ + public function setOpiTransToken($opi_trans_token) + { + if (is_null($opi_trans_token)) { + throw new \InvalidArgumentException('non-nullable opi_trans_token cannot be null'); + } + $this->container['opi_trans_token'] = $opi_trans_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ResponseAdditionalDataSepa.php b/src/Adyen/Model/Payments/ResponseAdditionalDataSepa.php new file mode 100644 index 000000000..6cc54117e --- /dev/null +++ b/src/Adyen/Model/Payments/ResponseAdditionalDataSepa.php @@ -0,0 +1,453 @@ + + */ +class ResponseAdditionalDataSepa implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResponseAdditionalDataSepa'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sepadirectdebit_date_of_signature' => 'string', + 'sepadirectdebit_mandate_id' => 'string', + 'sepadirectdebit_sequence_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sepadirectdebit_date_of_signature' => null, + 'sepadirectdebit_mandate_id' => null, + 'sepadirectdebit_sequence_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sepadirectdebit_date_of_signature' => false, + 'sepadirectdebit_mandate_id' => false, + 'sepadirectdebit_sequence_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sepadirectdebit_date_of_signature' => 'sepadirectdebit.dateOfSignature', + 'sepadirectdebit_mandate_id' => 'sepadirectdebit.mandateId', + 'sepadirectdebit_sequence_type' => 'sepadirectdebit.sequenceType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sepadirectdebit_date_of_signature' => 'setSepadirectdebitDateOfSignature', + 'sepadirectdebit_mandate_id' => 'setSepadirectdebitMandateId', + 'sepadirectdebit_sequence_type' => 'setSepadirectdebitSequenceType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sepadirectdebit_date_of_signature' => 'getSepadirectdebitDateOfSignature', + 'sepadirectdebit_mandate_id' => 'getSepadirectdebitMandateId', + 'sepadirectdebit_sequence_type' => 'getSepadirectdebitSequenceType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('sepadirectdebit_date_of_signature', $data ?? [], null); + $this->setIfExists('sepadirectdebit_mandate_id', $data ?? [], null); + $this->setIfExists('sepadirectdebit_sequence_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sepadirectdebit_date_of_signature + * + * @return string|null + */ + public function getSepadirectdebitDateOfSignature() + { + return $this->container['sepadirectdebit_date_of_signature']; + } + + /** + * Sets sepadirectdebit_date_of_signature + * + * @param string|null $sepadirectdebit_date_of_signature The transaction signature date. Format: yyyy-MM-dd + * + * @return self + */ + public function setSepadirectdebitDateOfSignature($sepadirectdebit_date_of_signature) + { + if (is_null($sepadirectdebit_date_of_signature)) { + throw new \InvalidArgumentException('non-nullable sepadirectdebit_date_of_signature cannot be null'); + } + $this->container['sepadirectdebit_date_of_signature'] = $sepadirectdebit_date_of_signature; + + return $this; + } + + /** + * Gets sepadirectdebit_mandate_id + * + * @return string|null + */ + public function getSepadirectdebitMandateId() + { + return $this->container['sepadirectdebit_mandate_id']; + } + + /** + * Sets sepadirectdebit_mandate_id + * + * @param string|null $sepadirectdebit_mandate_id Its value corresponds to the pspReference value of the transaction. + * + * @return self + */ + public function setSepadirectdebitMandateId($sepadirectdebit_mandate_id) + { + if (is_null($sepadirectdebit_mandate_id)) { + throw new \InvalidArgumentException('non-nullable sepadirectdebit_mandate_id cannot be null'); + } + $this->container['sepadirectdebit_mandate_id'] = $sepadirectdebit_mandate_id; + + return $this; + } + + /** + * Gets sepadirectdebit_sequence_type + * + * @return string|null + */ + public function getSepadirectdebitSequenceType() + { + return $this->container['sepadirectdebit_sequence_type']; + } + + /** + * Sets sepadirectdebit_sequence_type + * + * @param string|null $sepadirectdebit_sequence_type This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF + * + * @return self + */ + public function setSepadirectdebitSequenceType($sepadirectdebit_sequence_type) + { + if (is_null($sepadirectdebit_sequence_type)) { + throw new \InvalidArgumentException('non-nullable sepadirectdebit_sequence_type cannot be null'); + } + $this->container['sepadirectdebit_sequence_type'] = $sepadirectdebit_sequence_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/SDKEphemPubKey.php b/src/Adyen/Model/Payments/SDKEphemPubKey.php new file mode 100644 index 000000000..f175d4c91 --- /dev/null +++ b/src/Adyen/Model/Payments/SDKEphemPubKey.php @@ -0,0 +1,487 @@ + + */ +class SDKEphemPubKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SDKEphemPubKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'crv' => 'string', + 'kty' => 'string', + 'x' => 'string', + 'y' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'crv' => null, + 'kty' => null, + 'x' => null, + 'y' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'crv' => false, + 'kty' => false, + 'x' => false, + 'y' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'crv' => 'crv', + 'kty' => 'kty', + 'x' => 'x', + 'y' => 'y' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'crv' => 'setCrv', + 'kty' => 'setKty', + 'x' => 'setX', + 'y' => 'setY' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'crv' => 'getCrv', + 'kty' => 'getKty', + 'x' => 'getX', + 'y' => 'getY' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('crv', $data ?? [], null); + $this->setIfExists('kty', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets crv + * + * @return string|null + */ + public function getCrv() + { + return $this->container['crv']; + } + + /** + * Sets crv + * + * @param string|null $crv The `crv` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setCrv($crv) + { + if (is_null($crv)) { + throw new \InvalidArgumentException('non-nullable crv cannot be null'); + } + $this->container['crv'] = $crv; + + return $this; + } + + /** + * Gets kty + * + * @return string|null + */ + public function getKty() + { + return $this->container['kty']; + } + + /** + * Sets kty + * + * @param string|null $kty The `kty` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setKty($kty) + { + if (is_null($kty)) { + throw new \InvalidArgumentException('non-nullable kty cannot be null'); + } + $this->container['kty'] = $kty; + + return $this; + } + + /** + * Gets x + * + * @return string|null + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param string|null $x The `x` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets y + * + * @return string|null + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param string|null $y The `y` value as received from the 3D Secure 2 SDK. + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ServiceError.php b/src/Adyen/Model/Payments/ServiceError.php new file mode 100644 index 000000000..b44b0e68b --- /dev/null +++ b/src/Adyen/Model/Payments/ServiceError.php @@ -0,0 +1,553 @@ + + */ +class ServiceError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ServiceError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'error_code' => 'string', + 'error_type' => 'string', + 'message' => 'string', + 'psp_reference' => 'string', + 'status' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'error_code' => null, + 'error_type' => null, + 'message' => null, + 'psp_reference' => null, + 'status' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'error_code' => false, + 'error_type' => false, + 'message' => false, + 'psp_reference' => false, + 'status' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'error_code' => 'errorCode', + 'error_type' => 'errorType', + 'message' => 'message', + 'psp_reference' => 'pspReference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'error_code' => 'setErrorCode', + 'error_type' => 'setErrorType', + 'message' => 'setMessage', + 'psp_reference' => 'setPspReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'error_code' => 'getErrorCode', + 'error_type' => 'getErrorType', + 'message' => 'getMessage', + 'psp_reference' => 'getPspReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('error_type', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets error_code + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['error_code']; + } + + /** + * Sets error_code + * + * @param string|null $error_code The error code mapped to the error message. + * + * @return self + */ + public function setErrorCode($error_code) + { + if (is_null($error_code)) { + throw new \InvalidArgumentException('non-nullable error_code cannot be null'); + } + $this->container['error_code'] = $error_code; + + return $this; + } + + /** + * Gets error_type + * + * @return string|null + */ + public function getErrorType() + { + return $this->container['error_type']; + } + + /** + * Sets error_type + * + * @param string|null $error_type The category of the error. + * + * @return self + */ + public function setErrorType($error_type) + { + if (is_null($error_type)) { + throw new \InvalidArgumentException('non-nullable error_type cannot be null'); + } + $this->container['error_type'] = $error_type; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A short explanation of the issue. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference The PSP reference of the payment. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP response status. + * + * @return self + */ + public function setStatus($status) + { + // Do nothing for nullable integers + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ShopperInteractionDevice.php b/src/Adyen/Model/Payments/ShopperInteractionDevice.php new file mode 100644 index 000000000..360ab76e5 --- /dev/null +++ b/src/Adyen/Model/Payments/ShopperInteractionDevice.php @@ -0,0 +1,453 @@ + + */ +class ShopperInteractionDevice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShopperInteractionDevice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'locale' => 'string', + 'os' => 'string', + 'os_version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'locale' => null, + 'os' => null, + 'os_version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'locale' => false, + 'os' => false, + 'os_version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'locale' => 'locale', + 'os' => 'os', + 'os_version' => 'osVersion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'locale' => 'setLocale', + 'os' => 'setOs', + 'os_version' => 'setOsVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'locale' => 'getLocale', + 'os' => 'getOs', + 'os_version' => 'getOsVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('os', $data ?? [], null); + $this->setIfExists('os_version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale Locale on the shopper interaction device. + * + * @return self + */ + public function setLocale($locale) + { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets os + * + * @return string|null + */ + public function getOs() + { + return $this->container['os']; + } + + /** + * Sets os + * + * @param string|null $os Operating system running on the shopper interaction device. + * + * @return self + */ + public function setOs($os) + { + if (is_null($os)) { + throw new \InvalidArgumentException('non-nullable os cannot be null'); + } + $this->container['os'] = $os; + + return $this; + } + + /** + * Gets os_version + * + * @return string|null + */ + public function getOsVersion() + { + return $this->container['os_version']; + } + + /** + * Sets os_version + * + * @param string|null $os_version Version of the operating system on the shopper interaction device. + * + * @return self + */ + public function setOsVersion($os_version) + { + if (is_null($os_version)) { + throw new \InvalidArgumentException('non-nullable os_version cannot be null'); + } + $this->container['os_version'] = $os_version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/Split.php b/src/Adyen/Model/Payments/Split.php new file mode 100644 index 000000000..ecd9ec464 --- /dev/null +++ b/src/Adyen/Model/Payments/Split.php @@ -0,0 +1,576 @@ + + */ +class Split implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Split'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account' => 'string', + 'amount' => '\Adyen\Model\Payments\SplitAmount', + 'description' => 'string', + 'reference' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account' => null, + 'amount' => null, + 'description' => null, + 'reference' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account' => false, + 'amount' => false, + 'description' => false, + 'reference' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account' => 'account', + 'amount' => 'amount', + 'description' => 'description', + 'reference' => 'reference', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account' => 'setAccount', + 'amount' => 'setAmount', + 'description' => 'setDescription', + 'reference' => 'setReference', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account' => 'getAccount', + 'amount' => 'getAmount', + 'description' => 'getDescription', + 'reference' => 'getReference', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BALANCE_ACCOUNT = 'BalanceAccount'; + public const TYPE_COMMISSION = 'Commission'; + public const TYPE__DEFAULT = 'Default'; + public const TYPE_MARKET_PLACE = 'MarketPlace'; + public const TYPE_PAYMENT_FEE = 'PaymentFee'; + public const TYPE_REMAINDER = 'Remainder'; + public const TYPE_SURCHARGE = 'Surcharge'; + public const TYPE_TIP = 'Tip'; + public const TYPE_VAT = 'VAT'; + public const TYPE_VERIFICATION = 'Verification'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_ACCOUNT, + self::TYPE_COMMISSION, + self::TYPE__DEFAULT, + self::TYPE_MARKET_PLACE, + self::TYPE_PAYMENT_FEE, + self::TYPE_REMAINDER, + self::TYPE_SURCHARGE, + self::TYPE_TIP, + self::TYPE_VAT, + self::TYPE_VERIFICATION, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account + * + * @return string|null + */ + public function getAccount() + { + return $this->container['account']; + } + + /** + * Sets account + * + * @param string|null $account Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. + * + * @return self + */ + public function setAccount($account) + { + if (is_null($account)) { + throw new \InvalidArgumentException('non-nullable account cannot be null'); + } + $this->container['account'] = $account; + + return $this; + } + + /** + * Gets amount + * + * @return \Adyen\Model\Payments\SplitAmount + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Payments\SplitAmount $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of this split. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/SplitAmount.php b/src/Adyen/Model/Payments/SplitAmount.php new file mode 100644 index 000000000..8d3e0f837 --- /dev/null +++ b/src/Adyen/Model/Payments/SplitAmount.php @@ -0,0 +1,422 @@ + + */ +class SplitAmount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SplitAmount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/SubMerchant.php b/src/Adyen/Model/Payments/SubMerchant.php new file mode 100644 index 000000000..b4e6cc43c --- /dev/null +++ b/src/Adyen/Model/Payments/SubMerchant.php @@ -0,0 +1,521 @@ + + */ +class SubMerchant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubMerchant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'mcc' => 'string', + 'name' => 'string', + 'tax_id' => '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, + 'mcc' => null, + 'name' => null, + 'tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'mcc' => false, + 'name' => false, + 'tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'mcc' => 'mcc', + 'name' => 'name', + 'tax_id' => 'taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'mcc' => 'setMcc', + 'name' => 'setName', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'mcc' => 'getMcc', + 'name' => 'getName', + '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->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tax_id + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param string|null $tax_id The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + * + * @return self + */ + public function setTaxId($tax_id) + { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } + $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 + ); + } +} diff --git a/src/Adyen/Model/Payments/TechnicalCancelRequest.php b/src/Adyen/Model/Payments/TechnicalCancelRequest.php new file mode 100644 index 000000000..c6753dc7a --- /dev/null +++ b/src/Adyen/Model/Payments/TechnicalCancelRequest.php @@ -0,0 +1,697 @@ + + */ +class TechnicalCancelRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TechnicalCancelRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'merchant_account' => 'string', + 'modification_amount' => '\Adyen\Model\Payments\Amount', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'original_merchant_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'tender_reference' => 'string', + 'unique_terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'merchant_account' => null, + 'modification_amount' => null, + 'mpi_data' => null, + 'original_merchant_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null, + 'splits' => null, + 'tender_reference' => null, + 'unique_terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'merchant_account' => false, + 'modification_amount' => false, + 'mpi_data' => false, + 'original_merchant_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false, + 'splits' => false, + 'tender_reference' => false, + 'unique_terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'merchant_account' => 'merchantAccount', + 'modification_amount' => 'modificationAmount', + 'mpi_data' => 'mpiData', + 'original_merchant_reference' => 'originalMerchantReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference', + 'splits' => 'splits', + 'tender_reference' => 'tenderReference', + 'unique_terminal_id' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'merchant_account' => 'setMerchantAccount', + 'modification_amount' => 'setModificationAmount', + 'mpi_data' => 'setMpiData', + 'original_merchant_reference' => 'setOriginalMerchantReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'tender_reference' => 'setTenderReference', + 'unique_terminal_id' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'merchant_account' => 'getMerchantAccount', + 'modification_amount' => 'getModificationAmount', + 'mpi_data' => 'getMpiData', + 'original_merchant_reference' => 'getOriginalMerchantReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'tender_reference' => 'getTenderReference', + 'unique_terminal_id' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('modification_amount', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('original_merchant_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('tender_reference', $data ?? [], null); + $this->setIfExists('unique_terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['original_merchant_reference'] === null) { + $invalidProperties[] = "'original_merchant_reference' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets modification_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getModificationAmount() + { + return $this->container['modification_amount']; + } + + /** + * Sets modification_amount + * + * @param \Adyen\Model\Payments\Amount|null $modification_amount modification_amount + * + * @return self + */ + public function setModificationAmount($modification_amount) + { + if (is_null($modification_amount)) { + throw new \InvalidArgumentException('non-nullable modification_amount cannot be null'); + } + $this->container['modification_amount'] = $modification_amount; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets original_merchant_reference + * + * @return string + */ + public function getOriginalMerchantReference() + { + return $this->container['original_merchant_reference']; + } + + /** + * Sets original_merchant_reference + * + * @param string $original_merchant_reference The original merchant reference to cancel. + * + * @return self + */ + public function setOriginalMerchantReference($original_merchant_reference) + { + if (is_null($original_merchant_reference)) { + throw new \InvalidArgumentException('non-nullable original_merchant_reference cannot be null'); + } + $this->container['original_merchant_reference'] = $original_merchant_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets tender_reference + * + * @return string|null + */ + public function getTenderReference() + { + return $this->container['tender_reference']; + } + + /** + * Sets tender_reference + * + * @param string|null $tender_reference The transaction reference provided by the PED. For point-of-sale integrations only. + * + * @return self + */ + public function setTenderReference($tender_reference) + { + if (is_null($tender_reference)) { + throw new \InvalidArgumentException('non-nullable tender_reference cannot be null'); + } + $this->container['tender_reference'] = $tender_reference; + + return $this; + } + + /** + * Gets unique_terminal_id + * + * @return string|null + */ + public function getUniqueTerminalId() + { + return $this->container['unique_terminal_id']; + } + + /** + * Sets unique_terminal_id + * + * @param string|null $unique_terminal_id Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + * + * @return self + */ + public function setUniqueTerminalId($unique_terminal_id) + { + if (is_null($unique_terminal_id)) { + throw new \InvalidArgumentException('non-nullable unique_terminal_id cannot be null'); + } + $this->container['unique_terminal_id'] = $unique_terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDS1Result.php b/src/Adyen/Model/Payments/ThreeDS1Result.php new file mode 100644 index 000000000..e7884aaad --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDS1Result.php @@ -0,0 +1,555 @@ + + */ +class ThreeDS1Result implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS1Result'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cavv' => 'string', + 'cavv_algorithm' => 'string', + 'eci' => 'string', + 'three_d_authenticated_response' => 'string', + 'three_d_offered_response' => 'string', + 'xid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cavv' => null, + 'cavv_algorithm' => null, + 'eci' => null, + 'three_d_authenticated_response' => null, + 'three_d_offered_response' => null, + 'xid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cavv' => false, + 'cavv_algorithm' => false, + 'eci' => false, + 'three_d_authenticated_response' => false, + 'three_d_offered_response' => false, + 'xid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cavv' => 'cavv', + 'cavv_algorithm' => 'cavvAlgorithm', + 'eci' => 'eci', + 'three_d_authenticated_response' => 'threeDAuthenticatedResponse', + 'three_d_offered_response' => 'threeDOfferedResponse', + 'xid' => 'xid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cavv' => 'setCavv', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'eci' => 'setEci', + 'three_d_authenticated_response' => 'setThreeDAuthenticatedResponse', + 'three_d_offered_response' => 'setThreeDOfferedResponse', + 'xid' => 'setXid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cavv' => 'getCavv', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'eci' => 'getEci', + 'three_d_authenticated_response' => 'getThreeDAuthenticatedResponse', + 'three_d_offered_response' => 'getThreeDOfferedResponse', + 'xid' => 'getXid' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cavv', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('eci', $data ?? [], null); + $this->setIfExists('three_d_authenticated_response', $data ?? [], null); + $this->setIfExists('three_d_offered_response', $data ?? [], null); + $this->setIfExists('xid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cavv + * + * @return string|null + */ + public function getCavv() + { + return $this->container['cavv']; + } + + /** + * Sets cavv + * + * @param string|null $cavv The cardholder authentication value (base64 encoded). + * + * @return self + */ + public function setCavv($cavv) + { + if (is_null($cavv)) { + throw new \InvalidArgumentException('non-nullable cavv cannot be null'); + } + $this->container['cavv'] = $cavv; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm The CAVV algorithm used. + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets eci + * + * @return string|null + */ + public function getEci() + { + return $this->container['eci']; + } + + /** + * Sets eci + * + * @param string|null $eci 3D Secure Electronic Commerce Indicator (ECI). + * + * @return self + */ + public function setEci($eci) + { + if (is_null($eci)) { + throw new \InvalidArgumentException('non-nullable eci cannot be null'); + } + $this->container['eci'] = $eci; + + return $this; + } + + /** + * Gets three_d_authenticated_response + * + * @return string|null + */ + public function getThreeDAuthenticatedResponse() + { + return $this->container['three_d_authenticated_response']; + } + + /** + * Sets three_d_authenticated_response + * + * @param string|null $three_d_authenticated_response The authentication response from the ACS. + * + * @return self + */ + public function setThreeDAuthenticatedResponse($three_d_authenticated_response) + { + if (is_null($three_d_authenticated_response)) { + throw new \InvalidArgumentException('non-nullable three_d_authenticated_response cannot be null'); + } + $this->container['three_d_authenticated_response'] = $three_d_authenticated_response; + + return $this; + } + + /** + * Gets three_d_offered_response + * + * @return string|null + */ + public function getThreeDOfferedResponse() + { + return $this->container['three_d_offered_response']; + } + + /** + * Sets three_d_offered_response + * + * @param string|null $three_d_offered_response Whether 3D Secure was offered or not. + * + * @return self + */ + public function setThreeDOfferedResponse($three_d_offered_response) + { + if (is_null($three_d_offered_response)) { + throw new \InvalidArgumentException('non-nullable three_d_offered_response cannot be null'); + } + $this->container['three_d_offered_response'] = $three_d_offered_response; + + return $this; + } + + /** + * Gets xid + * + * @return string|null + */ + public function getXid() + { + return $this->container['xid']; + } + + /** + * Sets xid + * + * @param string|null $xid A unique transaction identifier generated by the MPI on behalf of the merchant to identify the 3D Secure transaction, in `Base64` encoding. + * + * @return self + */ + public function setXid($xid) + { + if (is_null($xid)) { + throw new \InvalidArgumentException('non-nullable xid cannot be null'); + } + $this->container['xid'] = $xid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDS2RequestData.php b/src/Adyen/Model/Payments/ThreeDS2RequestData.php new file mode 100644 index 000000000..d1e5878fd --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDS2RequestData.php @@ -0,0 +1,1906 @@ + + */ +class ThreeDS2RequestData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2RequestData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acct_info' => '\Adyen\Model\Payments\AcctInfo', + 'acct_type' => 'string', + 'acquirer_bin' => 'string', + 'acquirer_merchant_id' => 'string', + 'addr_match' => 'string', + 'authentication_only' => 'bool', + 'challenge_indicator' => 'string', + 'device_channel' => 'string', + 'device_render_options' => '\Adyen\Model\Payments\DeviceRenderOptions', + 'home_phone' => '\Adyen\Model\Payments\Phone', + 'mcc' => 'string', + 'merchant_name' => 'string', + 'message_version' => 'string', + 'mobile_phone' => '\Adyen\Model\Payments\Phone', + 'notification_url' => 'string', + 'pay_token_ind' => 'bool', + 'payment_authentication_use_case' => 'string', + 'purchase_instal_data' => 'string', + 'recurring_expiry' => 'string', + 'recurring_frequency' => 'string', + 'sdk_app_id' => 'string', + 'sdk_enc_data' => 'string', + 'sdk_ephem_pub_key' => '\Adyen\Model\Payments\SDKEphemPubKey', + 'sdk_max_timeout' => 'int', + 'sdk_reference_number' => 'string', + 'sdk_trans_id' => 'string', + 'sdk_version' => 'string', + 'three_ds_comp_ind' => 'string', + 'three_ds_requestor_authentication_ind' => 'string', + 'three_ds_requestor_authentication_info' => '\Adyen\Model\Payments\ThreeDSRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'string', + 'three_ds_requestor_id' => 'string', + 'three_ds_requestor_name' => 'string', + 'three_ds_requestor_prior_authentication_info' => '\Adyen\Model\Payments\ThreeDSRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'string', + 'trans_type' => 'string', + 'transaction_type' => 'string', + 'white_list_status' => 'string', + 'work_phone' => '\Adyen\Model\Payments\Phone' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acct_info' => null, + 'acct_type' => null, + 'acquirer_bin' => null, + 'acquirer_merchant_id' => null, + 'addr_match' => null, + 'authentication_only' => null, + 'challenge_indicator' => null, + 'device_channel' => null, + 'device_render_options' => null, + 'home_phone' => null, + 'mcc' => null, + 'merchant_name' => null, + 'message_version' => null, + 'mobile_phone' => null, + 'notification_url' => null, + 'pay_token_ind' => null, + 'payment_authentication_use_case' => null, + 'purchase_instal_data' => null, + 'recurring_expiry' => null, + 'recurring_frequency' => null, + 'sdk_app_id' => null, + 'sdk_enc_data' => null, + 'sdk_ephem_pub_key' => null, + 'sdk_max_timeout' => 'int32', + 'sdk_reference_number' => null, + 'sdk_trans_id' => null, + 'sdk_version' => null, + 'three_ds_comp_ind' => null, + 'three_ds_requestor_authentication_ind' => null, + 'three_ds_requestor_authentication_info' => null, + 'three_ds_requestor_challenge_ind' => null, + 'three_ds_requestor_id' => null, + 'three_ds_requestor_name' => null, + 'three_ds_requestor_prior_authentication_info' => null, + 'three_ds_requestor_url' => null, + 'trans_type' => null, + 'transaction_type' => null, + 'white_list_status' => null, + 'work_phone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'acct_info' => false, + 'acct_type' => false, + 'acquirer_bin' => false, + 'acquirer_merchant_id' => false, + 'addr_match' => false, + 'authentication_only' => false, + 'challenge_indicator' => false, + 'device_channel' => false, + 'device_render_options' => false, + 'home_phone' => false, + 'mcc' => false, + 'merchant_name' => false, + 'message_version' => false, + 'mobile_phone' => false, + 'notification_url' => false, + 'pay_token_ind' => false, + 'payment_authentication_use_case' => false, + 'purchase_instal_data' => false, + 'recurring_expiry' => false, + 'recurring_frequency' => false, + 'sdk_app_id' => false, + 'sdk_enc_data' => false, + 'sdk_ephem_pub_key' => false, + 'sdk_max_timeout' => true, + 'sdk_reference_number' => false, + 'sdk_trans_id' => false, + 'sdk_version' => false, + 'three_ds_comp_ind' => false, + 'three_ds_requestor_authentication_ind' => false, + 'three_ds_requestor_authentication_info' => false, + 'three_ds_requestor_challenge_ind' => false, + 'three_ds_requestor_id' => false, + 'three_ds_requestor_name' => false, + 'three_ds_requestor_prior_authentication_info' => false, + 'three_ds_requestor_url' => false, + 'trans_type' => false, + 'transaction_type' => false, + 'white_list_status' => false, + 'work_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acct_info' => 'acctInfo', + 'acct_type' => 'acctType', + 'acquirer_bin' => 'acquirerBIN', + 'acquirer_merchant_id' => 'acquirerMerchantID', + 'addr_match' => 'addrMatch', + 'authentication_only' => 'authenticationOnly', + 'challenge_indicator' => 'challengeIndicator', + 'device_channel' => 'deviceChannel', + 'device_render_options' => 'deviceRenderOptions', + 'home_phone' => 'homePhone', + 'mcc' => 'mcc', + 'merchant_name' => 'merchantName', + 'message_version' => 'messageVersion', + 'mobile_phone' => 'mobilePhone', + 'notification_url' => 'notificationURL', + 'pay_token_ind' => 'payTokenInd', + 'payment_authentication_use_case' => 'paymentAuthenticationUseCase', + 'purchase_instal_data' => 'purchaseInstalData', + 'recurring_expiry' => 'recurringExpiry', + 'recurring_frequency' => 'recurringFrequency', + 'sdk_app_id' => 'sdkAppID', + 'sdk_enc_data' => 'sdkEncData', + 'sdk_ephem_pub_key' => 'sdkEphemPubKey', + 'sdk_max_timeout' => 'sdkMaxTimeout', + 'sdk_reference_number' => 'sdkReferenceNumber', + 'sdk_trans_id' => 'sdkTransID', + 'sdk_version' => 'sdkVersion', + 'three_ds_comp_ind' => 'threeDSCompInd', + 'three_ds_requestor_authentication_ind' => 'threeDSRequestorAuthenticationInd', + 'three_ds_requestor_authentication_info' => 'threeDSRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'threeDSRequestorChallengeInd', + 'three_ds_requestor_id' => 'threeDSRequestorID', + 'three_ds_requestor_name' => 'threeDSRequestorName', + 'three_ds_requestor_prior_authentication_info' => 'threeDSRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'threeDSRequestorURL', + 'trans_type' => 'transType', + 'transaction_type' => 'transactionType', + 'white_list_status' => 'whiteListStatus', + 'work_phone' => 'workPhone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acct_info' => 'setAcctInfo', + 'acct_type' => 'setAcctType', + 'acquirer_bin' => 'setAcquirerBin', + 'acquirer_merchant_id' => 'setAcquirerMerchantId', + 'addr_match' => 'setAddrMatch', + 'authentication_only' => 'setAuthenticationOnly', + 'challenge_indicator' => 'setChallengeIndicator', + 'device_channel' => 'setDeviceChannel', + 'device_render_options' => 'setDeviceRenderOptions', + 'home_phone' => 'setHomePhone', + 'mcc' => 'setMcc', + 'merchant_name' => 'setMerchantName', + 'message_version' => 'setMessageVersion', + 'mobile_phone' => 'setMobilePhone', + 'notification_url' => 'setNotificationUrl', + 'pay_token_ind' => 'setPayTokenInd', + 'payment_authentication_use_case' => 'setPaymentAuthenticationUseCase', + 'purchase_instal_data' => 'setPurchaseInstalData', + 'recurring_expiry' => 'setRecurringExpiry', + 'recurring_frequency' => 'setRecurringFrequency', + 'sdk_app_id' => 'setSdkAppId', + 'sdk_enc_data' => 'setSdkEncData', + 'sdk_ephem_pub_key' => 'setSdkEphemPubKey', + 'sdk_max_timeout' => 'setSdkMaxTimeout', + 'sdk_reference_number' => 'setSdkReferenceNumber', + 'sdk_trans_id' => 'setSdkTransId', + 'sdk_version' => 'setSdkVersion', + 'three_ds_comp_ind' => 'setThreeDsCompInd', + 'three_ds_requestor_authentication_ind' => 'setThreeDsRequestorAuthenticationInd', + 'three_ds_requestor_authentication_info' => 'setThreeDsRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'setThreeDsRequestorChallengeInd', + 'three_ds_requestor_id' => 'setThreeDsRequestorId', + 'three_ds_requestor_name' => 'setThreeDsRequestorName', + 'three_ds_requestor_prior_authentication_info' => 'setThreeDsRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'setThreeDsRequestorUrl', + 'trans_type' => 'setTransType', + 'transaction_type' => 'setTransactionType', + 'white_list_status' => 'setWhiteListStatus', + 'work_phone' => 'setWorkPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acct_info' => 'getAcctInfo', + 'acct_type' => 'getAcctType', + 'acquirer_bin' => 'getAcquirerBin', + 'acquirer_merchant_id' => 'getAcquirerMerchantId', + 'addr_match' => 'getAddrMatch', + 'authentication_only' => 'getAuthenticationOnly', + 'challenge_indicator' => 'getChallengeIndicator', + 'device_channel' => 'getDeviceChannel', + 'device_render_options' => 'getDeviceRenderOptions', + 'home_phone' => 'getHomePhone', + 'mcc' => 'getMcc', + 'merchant_name' => 'getMerchantName', + 'message_version' => 'getMessageVersion', + 'mobile_phone' => 'getMobilePhone', + 'notification_url' => 'getNotificationUrl', + 'pay_token_ind' => 'getPayTokenInd', + 'payment_authentication_use_case' => 'getPaymentAuthenticationUseCase', + 'purchase_instal_data' => 'getPurchaseInstalData', + 'recurring_expiry' => 'getRecurringExpiry', + 'recurring_frequency' => 'getRecurringFrequency', + 'sdk_app_id' => 'getSdkAppId', + 'sdk_enc_data' => 'getSdkEncData', + 'sdk_ephem_pub_key' => 'getSdkEphemPubKey', + 'sdk_max_timeout' => 'getSdkMaxTimeout', + 'sdk_reference_number' => 'getSdkReferenceNumber', + 'sdk_trans_id' => 'getSdkTransId', + 'sdk_version' => 'getSdkVersion', + 'three_ds_comp_ind' => 'getThreeDsCompInd', + 'three_ds_requestor_authentication_ind' => 'getThreeDsRequestorAuthenticationInd', + 'three_ds_requestor_authentication_info' => 'getThreeDsRequestorAuthenticationInfo', + 'three_ds_requestor_challenge_ind' => 'getThreeDsRequestorChallengeInd', + 'three_ds_requestor_id' => 'getThreeDsRequestorId', + 'three_ds_requestor_name' => 'getThreeDsRequestorName', + 'three_ds_requestor_prior_authentication_info' => 'getThreeDsRequestorPriorAuthenticationInfo', + 'three_ds_requestor_url' => 'getThreeDsRequestorUrl', + 'trans_type' => 'getTransType', + 'transaction_type' => 'getTransactionType', + 'white_list_status' => 'getWhiteListStatus', + 'work_phone' => 'getWorkPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACCT_TYPE__01 = '01'; + public const ACCT_TYPE__02 = '02'; + public const ACCT_TYPE__03 = '03'; + public const ADDR_MATCH_Y = 'Y'; + public const ADDR_MATCH_N = 'N'; + public const CHALLENGE_INDICATOR_NO_PREFERENCE = 'noPreference'; + public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__01 = '01'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__02 = '02'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__03 = '03'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__04 = '04'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__05 = '05'; + public const THREE_DS_REQUESTOR_CHALLENGE_IND__06 = '06'; + public const TRANS_TYPE__01 = '01'; + public const TRANS_TYPE__03 = '03'; + public const TRANS_TYPE__10 = '10'; + public const TRANS_TYPE__11 = '11'; + public const TRANS_TYPE__28 = '28'; + public const TRANSACTION_TYPE_GOODS_OR_SERVICE_PURCHASE = 'goodsOrServicePurchase'; + public const TRANSACTION_TYPE_CHECK_ACCEPTANCE = 'checkAcceptance'; + public const TRANSACTION_TYPE_ACCOUNT_FUNDING = 'accountFunding'; + public const TRANSACTION_TYPE_QUASI_CASH_TRANSACTION = 'quasiCashTransaction'; + public const TRANSACTION_TYPE_PREPAID_ACTIVATION_AND_LOAD = 'prepaidActivationAndLoad'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAcctTypeAllowableValues() + { + return [ + self::ACCT_TYPE__01, + self::ACCT_TYPE__02, + self::ACCT_TYPE__03, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAddrMatchAllowableValues() + { + return [ + self::ADDR_MATCH_Y, + self::ADDR_MATCH_N, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeIndicatorAllowableValues() + { + return [ + self::CHALLENGE_INDICATOR_NO_PREFERENCE, + self::CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDsRequestorChallengeIndAllowableValues() + { + return [ + self::THREE_DS_REQUESTOR_CHALLENGE_IND__01, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__02, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__03, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__04, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__05, + self::THREE_DS_REQUESTOR_CHALLENGE_IND__06, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransTypeAllowableValues() + { + return [ + self::TRANS_TYPE__01, + self::TRANS_TYPE__03, + self::TRANS_TYPE__10, + self::TRANS_TYPE__11, + self::TRANS_TYPE__28, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTransactionTypeAllowableValues() + { + return [ + self::TRANSACTION_TYPE_GOODS_OR_SERVICE_PURCHASE, + self::TRANSACTION_TYPE_CHECK_ACCEPTANCE, + self::TRANSACTION_TYPE_ACCOUNT_FUNDING, + self::TRANSACTION_TYPE_QUASI_CASH_TRANSACTION, + self::TRANSACTION_TYPE_PREPAID_ACTIVATION_AND_LOAD, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('acct_info', $data ?? [], null); + $this->setIfExists('acct_type', $data ?? [], null); + $this->setIfExists('acquirer_bin', $data ?? [], null); + $this->setIfExists('acquirer_merchant_id', $data ?? [], null); + $this->setIfExists('addr_match', $data ?? [], null); + $this->setIfExists('authentication_only', $data ?? [], false); + $this->setIfExists('challenge_indicator', $data ?? [], null); + $this->setIfExists('device_channel', $data ?? [], null); + $this->setIfExists('device_render_options', $data ?? [], null); + $this->setIfExists('home_phone', $data ?? [], null); + $this->setIfExists('mcc', $data ?? [], null); + $this->setIfExists('merchant_name', $data ?? [], null); + $this->setIfExists('message_version', $data ?? [], '2.1.0'); + $this->setIfExists('mobile_phone', $data ?? [], null); + $this->setIfExists('notification_url', $data ?? [], null); + $this->setIfExists('pay_token_ind', $data ?? [], null); + $this->setIfExists('payment_authentication_use_case', $data ?? [], null); + $this->setIfExists('purchase_instal_data', $data ?? [], null); + $this->setIfExists('recurring_expiry', $data ?? [], null); + $this->setIfExists('recurring_frequency', $data ?? [], null); + $this->setIfExists('sdk_app_id', $data ?? [], null); + $this->setIfExists('sdk_enc_data', $data ?? [], null); + $this->setIfExists('sdk_ephem_pub_key', $data ?? [], null); + $this->setIfExists('sdk_max_timeout', $data ?? [], 60); + $this->setIfExists('sdk_reference_number', $data ?? [], null); + $this->setIfExists('sdk_trans_id', $data ?? [], null); + $this->setIfExists('sdk_version', $data ?? [], null); + $this->setIfExists('three_ds_comp_ind', $data ?? [], null); + $this->setIfExists('three_ds_requestor_authentication_ind', $data ?? [], null); + $this->setIfExists('three_ds_requestor_authentication_info', $data ?? [], null); + $this->setIfExists('three_ds_requestor_challenge_ind', $data ?? [], null); + $this->setIfExists('three_ds_requestor_id', $data ?? [], null); + $this->setIfExists('three_ds_requestor_name', $data ?? [], null); + $this->setIfExists('three_ds_requestor_prior_authentication_info', $data ?? [], null); + $this->setIfExists('three_ds_requestor_url', $data ?? [], null); + $this->setIfExists('trans_type', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('white_list_status', $data ?? [], null); + $this->setIfExists('work_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAcctTypeAllowableValues(); + if (!is_null($this->container['acct_type']) && !in_array($this->container['acct_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'acct_type', must be one of '%s'", + $this->container['acct_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAddrMatchAllowableValues(); + if (!is_null($this->container['addr_match']) && !in_array($this->container['addr_match'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'addr_match', must be one of '%s'", + $this->container['addr_match'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!is_null($this->container['challenge_indicator']) && !in_array($this->container['challenge_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $this->container['challenge_indicator'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['device_channel'] === null) { + $invalidProperties[] = "'device_channel' can't be null"; + } + $allowedValues = $this->getThreeDsRequestorChallengeIndAllowableValues(); + if (!is_null($this->container['three_ds_requestor_challenge_ind']) && !in_array($this->container['three_ds_requestor_challenge_ind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'three_ds_requestor_challenge_ind', must be one of '%s'", + $this->container['three_ds_requestor_challenge_ind'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTransTypeAllowableValues(); + if (!is_null($this->container['trans_type']) && !in_array($this->container['trans_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'trans_type', must be one of '%s'", + $this->container['trans_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTransactionTypeAllowableValues(); + if (!is_null($this->container['transaction_type']) && !in_array($this->container['transaction_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'transaction_type', must be one of '%s'", + $this->container['transaction_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 acct_info + * + * @return \Adyen\Model\Payments\AcctInfo|null + */ + public function getAcctInfo() + { + return $this->container['acct_info']; + } + + /** + * Sets acct_info + * + * @param \Adyen\Model\Payments\AcctInfo|null $acct_info acct_info + * + * @return self + */ + public function setAcctInfo($acct_info) + { + if (is_null($acct_info)) { + throw new \InvalidArgumentException('non-nullable acct_info cannot be null'); + } + $this->container['acct_info'] = $acct_info; + + return $this; + } + + /** + * Gets acct_type + * + * @return string|null + */ + public function getAcctType() + { + return $this->container['acct_type']; + } + + /** + * Sets acct_type + * + * @param string|null $acct_type Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + * + * @return self + */ + public function setAcctType($acct_type) + { + if (is_null($acct_type)) { + throw new \InvalidArgumentException('non-nullable acct_type cannot be null'); + } + $allowedValues = $this->getAcctTypeAllowableValues(); + if (!in_array($acct_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'acct_type', must be one of '%s'", + $acct_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['acct_type'] = $acct_type; + + return $this; + } + + /** + * Gets acquirer_bin + * + * @return string|null + */ + public function getAcquirerBin() + { + return $this->container['acquirer_bin']; + } + + /** + * Sets acquirer_bin + * + * @param string|null $acquirer_bin Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + * + * @return self + */ + public function setAcquirerBin($acquirer_bin) + { + if (is_null($acquirer_bin)) { + throw new \InvalidArgumentException('non-nullable acquirer_bin cannot be null'); + } + $this->container['acquirer_bin'] = $acquirer_bin; + + return $this; + } + + /** + * Gets acquirer_merchant_id + * + * @return string|null + */ + public function getAcquirerMerchantId() + { + return $this->container['acquirer_merchant_id']; + } + + /** + * Sets acquirer_merchant_id + * + * @param string|null $acquirer_merchant_id Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + * + * @return self + */ + public function setAcquirerMerchantId($acquirer_merchant_id) + { + if (is_null($acquirer_merchant_id)) { + throw new \InvalidArgumentException('non-nullable acquirer_merchant_id cannot be null'); + } + $this->container['acquirer_merchant_id'] = $acquirer_merchant_id; + + return $this; + } + + /** + * Gets addr_match + * + * @return string|null + */ + public function getAddrMatch() + { + return $this->container['addr_match']; + } + + /** + * Sets addr_match + * + * @param string|null $addr_match Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + * + * @return self + */ + public function setAddrMatch($addr_match) + { + if (is_null($addr_match)) { + throw new \InvalidArgumentException('non-nullable addr_match cannot be null'); + } + $allowedValues = $this->getAddrMatchAllowableValues(); + if (!in_array($addr_match, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'addr_match', must be one of '%s'", + $addr_match, + implode("', '", $allowedValues) + ) + ); + } + $this->container['addr_match'] = $addr_match; + + return $this; + } + + /** + * Gets authentication_only + * + * @return bool|null + * @deprecated + */ + public function getAuthenticationOnly() + { + return $this->container['authentication_only']; + } + + /** + * Sets authentication_only + * + * @param bool|null $authentication_only If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + * + * @return self + * @deprecated + */ + public function setAuthenticationOnly($authentication_only) + { + if (is_null($authentication_only)) { + throw new \InvalidArgumentException('non-nullable authentication_only cannot be null'); + } + $this->container['authentication_only'] = $authentication_only; + + return $this; + } + + /** + * Gets challenge_indicator + * + * @return string|null + * @deprecated + */ + public function getChallengeIndicator() + { + return $this->container['challenge_indicator']; + } + + /** + * Sets challenge_indicator + * + * @param string|null $challenge_indicator Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + * + * @return self + * @deprecated + */ + public function setChallengeIndicator($challenge_indicator) + { + if (is_null($challenge_indicator)) { + throw new \InvalidArgumentException('non-nullable challenge_indicator cannot be null'); + } + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!in_array($challenge_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $challenge_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_indicator'] = $challenge_indicator; + + return $this; + } + + /** + * Gets device_channel + * + * @return string + */ + public function getDeviceChannel() + { + return $this->container['device_channel']; + } + + /** + * Sets device_channel + * + * @param string $device_channel The environment of the shopper. Allowed values: * `app` * `browser` + * + * @return self + */ + public function setDeviceChannel($device_channel) + { + if (is_null($device_channel)) { + throw new \InvalidArgumentException('non-nullable device_channel cannot be null'); + } + $this->container['device_channel'] = $device_channel; + + return $this; + } + + /** + * Gets device_render_options + * + * @return \Adyen\Model\Payments\DeviceRenderOptions|null + */ + public function getDeviceRenderOptions() + { + return $this->container['device_render_options']; + } + + /** + * Sets device_render_options + * + * @param \Adyen\Model\Payments\DeviceRenderOptions|null $device_render_options device_render_options + * + * @return self + */ + public function setDeviceRenderOptions($device_render_options) + { + if (is_null($device_render_options)) { + throw new \InvalidArgumentException('non-nullable device_render_options cannot be null'); + } + $this->container['device_render_options'] = $device_render_options; + + return $this; + } + + /** + * Gets home_phone + * + * @return \Adyen\Model\Payments\Phone|null + */ + public function getHomePhone() + { + return $this->container['home_phone']; + } + + /** + * Sets home_phone + * + * @param \Adyen\Model\Payments\Phone|null $home_phone home_phone + * + * @return self + */ + public function setHomePhone($home_phone) + { + if (is_null($home_phone)) { + throw new \InvalidArgumentException('non-nullable home_phone cannot be null'); + } + $this->container['home_phone'] = $home_phone; + + return $this; + } + + /** + * Gets mcc + * + * @return string|null + */ + public function getMcc() + { + return $this->container['mcc']; + } + + /** + * Sets mcc + * + * @param string|null $mcc Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + * + * @return self + */ + public function setMcc($mcc) + { + if (is_null($mcc)) { + throw new \InvalidArgumentException('non-nullable mcc cannot be null'); + } + $this->container['mcc'] = $mcc; + + return $this; + } + + /** + * Gets merchant_name + * + * @return string|null + */ + public function getMerchantName() + { + return $this->container['merchant_name']; + } + + /** + * Sets merchant_name + * + * @param string|null $merchant_name Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + * + * @return self + */ + public function setMerchantName($merchant_name) + { + if (is_null($merchant_name)) { + throw new \InvalidArgumentException('non-nullable merchant_name cannot be null'); + } + $this->container['merchant_name'] = $merchant_name; + + return $this; + } + + /** + * Gets message_version + * + * @return string|null + */ + public function getMessageVersion() + { + return $this->container['message_version']; + } + + /** + * Sets message_version + * + * @param string|null $message_version The `messageVersion` value indicating the 3D Secure 2 protocol version. + * + * @return self + */ + public function setMessageVersion($message_version) + { + if (is_null($message_version)) { + throw new \InvalidArgumentException('non-nullable message_version cannot be null'); + } + $this->container['message_version'] = $message_version; + + return $this; + } + + /** + * Gets mobile_phone + * + * @return \Adyen\Model\Payments\Phone|null + */ + public function getMobilePhone() + { + return $this->container['mobile_phone']; + } + + /** + * Sets mobile_phone + * + * @param \Adyen\Model\Payments\Phone|null $mobile_phone mobile_phone + * + * @return self + */ + public function setMobilePhone($mobile_phone) + { + if (is_null($mobile_phone)) { + throw new \InvalidArgumentException('non-nullable mobile_phone cannot be null'); + } + $this->container['mobile_phone'] = $mobile_phone; + + return $this; + } + + /** + * Gets notification_url + * + * @return string|null + */ + public function getNotificationUrl() + { + return $this->container['notification_url']; + } + + /** + * Sets notification_url + * + * @param string|null $notification_url URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + * + * @return self + */ + public function setNotificationUrl($notification_url) + { + if (is_null($notification_url)) { + throw new \InvalidArgumentException('non-nullable notification_url cannot be null'); + } + $this->container['notification_url'] = $notification_url; + + return $this; + } + + /** + * Gets pay_token_ind + * + * @return bool|null + */ + public function getPayTokenInd() + { + return $this->container['pay_token_ind']; + } + + /** + * Sets pay_token_ind + * + * @param bool|null $pay_token_ind Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. + * + * @return self + */ + public function setPayTokenInd($pay_token_ind) + { + if (is_null($pay_token_ind)) { + throw new \InvalidArgumentException('non-nullable pay_token_ind cannot be null'); + } + $this->container['pay_token_ind'] = $pay_token_ind; + + return $this; + } + + /** + * Gets payment_authentication_use_case + * + * @return string|null + */ + public function getPaymentAuthenticationUseCase() + { + return $this->container['payment_authentication_use_case']; + } + + /** + * Sets payment_authentication_use_case + * + * @param string|null $payment_authentication_use_case Indicates the type of payment for which an authentication is requested (message extension) + * + * @return self + */ + public function setPaymentAuthenticationUseCase($payment_authentication_use_case) + { + if (is_null($payment_authentication_use_case)) { + throw new \InvalidArgumentException('non-nullable payment_authentication_use_case cannot be null'); + } + $this->container['payment_authentication_use_case'] = $payment_authentication_use_case; + + return $this; + } + + /** + * Gets purchase_instal_data + * + * @return string|null + */ + public function getPurchaseInstalData() + { + return $this->container['purchase_instal_data']; + } + + /** + * Sets purchase_instal_data + * + * @param string|null $purchase_instal_data Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + * + * @return self + */ + public function setPurchaseInstalData($purchase_instal_data) + { + if (is_null($purchase_instal_data)) { + throw new \InvalidArgumentException('non-nullable purchase_instal_data cannot be null'); + } + $this->container['purchase_instal_data'] = $purchase_instal_data; + + return $this; + } + + /** + * Gets recurring_expiry + * + * @return string|null + */ + public function getRecurringExpiry() + { + return $this->container['recurring_expiry']; + } + + /** + * Sets recurring_expiry + * + * @param string|null $recurring_expiry Date after which no further authorisations shall be performed. Format: YYYYMMDD + * + * @return self + */ + public function setRecurringExpiry($recurring_expiry) + { + if (is_null($recurring_expiry)) { + throw new \InvalidArgumentException('non-nullable recurring_expiry cannot be null'); + } + $this->container['recurring_expiry'] = $recurring_expiry; + + return $this; + } + + /** + * Gets recurring_frequency + * + * @return string|null + */ + public function getRecurringFrequency() + { + return $this->container['recurring_frequency']; + } + + /** + * Sets recurring_frequency + * + * @param string|null $recurring_frequency Indicates the minimum number of days between authorisations. Maximum length: 4 characters. + * + * @return self + */ + public function setRecurringFrequency($recurring_frequency) + { + if (is_null($recurring_frequency)) { + throw new \InvalidArgumentException('non-nullable recurring_frequency cannot be null'); + } + $this->container['recurring_frequency'] = $recurring_frequency; + + return $this; + } + + /** + * Gets sdk_app_id + * + * @return string|null + */ + public function getSdkAppId() + { + return $this->container['sdk_app_id']; + } + + /** + * Sets sdk_app_id + * + * @param string|null $sdk_app_id The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkAppId($sdk_app_id) + { + if (is_null($sdk_app_id)) { + throw new \InvalidArgumentException('non-nullable sdk_app_id cannot be null'); + } + $this->container['sdk_app_id'] = $sdk_app_id; + + return $this; + } + + /** + * Gets sdk_enc_data + * + * @return string|null + */ + public function getSdkEncData() + { + return $this->container['sdk_enc_data']; + } + + /** + * Sets sdk_enc_data + * + * @param string|null $sdk_enc_data The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkEncData($sdk_enc_data) + { + if (is_null($sdk_enc_data)) { + throw new \InvalidArgumentException('non-nullable sdk_enc_data cannot be null'); + } + $this->container['sdk_enc_data'] = $sdk_enc_data; + + return $this; + } + + /** + * Gets sdk_ephem_pub_key + * + * @return \Adyen\Model\Payments\SDKEphemPubKey|null + */ + public function getSdkEphemPubKey() + { + return $this->container['sdk_ephem_pub_key']; + } + + /** + * Sets sdk_ephem_pub_key + * + * @param \Adyen\Model\Payments\SDKEphemPubKey|null $sdk_ephem_pub_key sdk_ephem_pub_key + * + * @return self + */ + public function setSdkEphemPubKey($sdk_ephem_pub_key) + { + if (is_null($sdk_ephem_pub_key)) { + throw new \InvalidArgumentException('non-nullable sdk_ephem_pub_key cannot be null'); + } + $this->container['sdk_ephem_pub_key'] = $sdk_ephem_pub_key; + + return $this; + } + + /** + * Gets sdk_max_timeout + * + * @return int|null + */ + public function getSdkMaxTimeout() + { + return $this->container['sdk_max_timeout']; + } + + /** + * Sets sdk_max_timeout + * + * @param int|null $sdk_max_timeout The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. + * + * @return self + */ + public function setSdkMaxTimeout($sdk_max_timeout) + { + // Do nothing for nullable integers + $this->container['sdk_max_timeout'] = $sdk_max_timeout; + + return $this; + } + + /** + * Gets sdk_reference_number + * + * @return string|null + */ + public function getSdkReferenceNumber() + { + return $this->container['sdk_reference_number']; + } + + /** + * Sets sdk_reference_number + * + * @param string|null $sdk_reference_number The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkReferenceNumber($sdk_reference_number) + { + if (is_null($sdk_reference_number)) { + throw new \InvalidArgumentException('non-nullable sdk_reference_number cannot be null'); + } + $this->container['sdk_reference_number'] = $sdk_reference_number; + + return $this; + } + + /** + * Gets sdk_trans_id + * + * @return string|null + */ + public function getSdkTransId() + { + return $this->container['sdk_trans_id']; + } + + /** + * Sets sdk_trans_id + * + * @param string|null $sdk_trans_id The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkTransId($sdk_trans_id) + { + if (is_null($sdk_trans_id)) { + throw new \InvalidArgumentException('non-nullable sdk_trans_id cannot be null'); + } + $this->container['sdk_trans_id'] = $sdk_trans_id; + + return $this; + } + + /** + * Gets sdk_version + * + * @return string|null + */ + public function getSdkVersion() + { + return $this->container['sdk_version']; + } + + /** + * Sets sdk_version + * + * @param string|null $sdk_version Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. + * + * @return self + */ + public function setSdkVersion($sdk_version) + { + if (is_null($sdk_version)) { + throw new \InvalidArgumentException('non-nullable sdk_version cannot be null'); + } + $this->container['sdk_version'] = $sdk_version; + + return $this; + } + + /** + * Gets three_ds_comp_ind + * + * @return string|null + */ + public function getThreeDsCompInd() + { + return $this->container['three_ds_comp_ind']; + } + + /** + * Sets three_ds_comp_ind + * + * @param string|null $three_ds_comp_ind Completion indicator for the device fingerprinting. + * + * @return self + */ + public function setThreeDsCompInd($three_ds_comp_ind) + { + if (is_null($three_ds_comp_ind)) { + throw new \InvalidArgumentException('non-nullable three_ds_comp_ind cannot be null'); + } + $this->container['three_ds_comp_ind'] = $three_ds_comp_ind; + + return $this; + } + + /** + * Gets three_ds_requestor_authentication_ind + * + * @return string|null + */ + public function getThreeDsRequestorAuthenticationInd() + { + return $this->container['three_ds_requestor_authentication_ind']; + } + + /** + * Sets three_ds_requestor_authentication_ind + * + * @param string|null $three_ds_requestor_authentication_ind Indicates the type of Authentication request. + * + * @return self + */ + public function setThreeDsRequestorAuthenticationInd($three_ds_requestor_authentication_ind) + { + if (is_null($three_ds_requestor_authentication_ind)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_authentication_ind cannot be null'); + } + $this->container['three_ds_requestor_authentication_ind'] = $three_ds_requestor_authentication_ind; + + return $this; + } + + /** + * Gets three_ds_requestor_authentication_info + * + * @return \Adyen\Model\Payments\ThreeDSRequestorAuthenticationInfo|null + */ + public function getThreeDsRequestorAuthenticationInfo() + { + return $this->container['three_ds_requestor_authentication_info']; + } + + /** + * Sets three_ds_requestor_authentication_info + * + * @param \Adyen\Model\Payments\ThreeDSRequestorAuthenticationInfo|null $three_ds_requestor_authentication_info three_ds_requestor_authentication_info + * + * @return self + */ + public function setThreeDsRequestorAuthenticationInfo($three_ds_requestor_authentication_info) + { + if (is_null($three_ds_requestor_authentication_info)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_authentication_info cannot be null'); + } + $this->container['three_ds_requestor_authentication_info'] = $three_ds_requestor_authentication_info; + + return $this; + } + + /** + * Gets three_ds_requestor_challenge_ind + * + * @return string|null + */ + public function getThreeDsRequestorChallengeInd() + { + return $this->container['three_ds_requestor_challenge_ind']; + } + + /** + * Sets three_ds_requestor_challenge_ind + * + * @param string|null $three_ds_requestor_challenge_ind Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + * + * @return self + */ + public function setThreeDsRequestorChallengeInd($three_ds_requestor_challenge_ind) + { + if (is_null($three_ds_requestor_challenge_ind)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_challenge_ind cannot be null'); + } + $allowedValues = $this->getThreeDsRequestorChallengeIndAllowableValues(); + if (!in_array($three_ds_requestor_challenge_ind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'three_ds_requestor_challenge_ind', must be one of '%s'", + $three_ds_requestor_challenge_ind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['three_ds_requestor_challenge_ind'] = $three_ds_requestor_challenge_ind; + + return $this; + } + + /** + * Gets three_ds_requestor_id + * + * @return string|null + */ + public function getThreeDsRequestorId() + { + return $this->container['three_ds_requestor_id']; + } + + /** + * Sets three_ds_requestor_id + * + * @param string|null $three_ds_requestor_id Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + * + * @return self + */ + public function setThreeDsRequestorId($three_ds_requestor_id) + { + if (is_null($three_ds_requestor_id)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_id cannot be null'); + } + $this->container['three_ds_requestor_id'] = $three_ds_requestor_id; + + return $this; + } + + /** + * Gets three_ds_requestor_name + * + * @return string|null + */ + public function getThreeDsRequestorName() + { + return $this->container['three_ds_requestor_name']; + } + + /** + * Sets three_ds_requestor_name + * + * @param string|null $three_ds_requestor_name Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + * + * @return self + */ + public function setThreeDsRequestorName($three_ds_requestor_name) + { + if (is_null($three_ds_requestor_name)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_name cannot be null'); + } + $this->container['three_ds_requestor_name'] = $three_ds_requestor_name; + + return $this; + } + + /** + * Gets three_ds_requestor_prior_authentication_info + * + * @return \Adyen\Model\Payments\ThreeDSRequestorPriorAuthenticationInfo|null + */ + public function getThreeDsRequestorPriorAuthenticationInfo() + { + return $this->container['three_ds_requestor_prior_authentication_info']; + } + + /** + * Sets three_ds_requestor_prior_authentication_info + * + * @param \Adyen\Model\Payments\ThreeDSRequestorPriorAuthenticationInfo|null $three_ds_requestor_prior_authentication_info three_ds_requestor_prior_authentication_info + * + * @return self + */ + public function setThreeDsRequestorPriorAuthenticationInfo($three_ds_requestor_prior_authentication_info) + { + if (is_null($three_ds_requestor_prior_authentication_info)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_prior_authentication_info cannot be null'); + } + $this->container['three_ds_requestor_prior_authentication_info'] = $three_ds_requestor_prior_authentication_info; + + return $this; + } + + /** + * Gets three_ds_requestor_url + * + * @return string|null + */ + public function getThreeDsRequestorUrl() + { + return $this->container['three_ds_requestor_url']; + } + + /** + * Sets three_ds_requestor_url + * + * @param string|null $three_ds_requestor_url URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + * + * @return self + */ + public function setThreeDsRequestorUrl($three_ds_requestor_url) + { + if (is_null($three_ds_requestor_url)) { + throw new \InvalidArgumentException('non-nullable three_ds_requestor_url cannot be null'); + } + $this->container['three_ds_requestor_url'] = $three_ds_requestor_url; + + return $this; + } + + /** + * Gets trans_type + * + * @return string|null + */ + public function getTransType() + { + return $this->container['trans_type']; + } + + /** + * Sets trans_type + * + * @param string|null $trans_type Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + * + * @return self + */ + public function setTransType($trans_type) + { + if (is_null($trans_type)) { + throw new \InvalidArgumentException('non-nullable trans_type cannot be null'); + } + $allowedValues = $this->getTransTypeAllowableValues(); + if (!in_array($trans_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'trans_type', must be one of '%s'", + $trans_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['trans_type'] = $trans_type; + + return $this; + } + + /** + * Gets transaction_type + * + * @return string|null + */ + public function getTransactionType() + { + return $this->container['transaction_type']; + } + + /** + * Sets transaction_type + * + * @param string|null $transaction_type Identify the type of the transaction being authenticated. + * + * @return self + */ + public function setTransactionType($transaction_type) + { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } + $allowedValues = $this->getTransactionTypeAllowableValues(); + if (!in_array($transaction_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'transaction_type', must be one of '%s'", + $transaction_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['transaction_type'] = $transaction_type; + + return $this; + } + + /** + * Gets white_list_status + * + * @return string|null + */ + public function getWhiteListStatus() + { + return $this->container['white_list_status']; + } + + /** + * Sets white_list_status + * + * @param string|null $white_list_status The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + * + * @return self + */ + public function setWhiteListStatus($white_list_status) + { + if (is_null($white_list_status)) { + throw new \InvalidArgumentException('non-nullable white_list_status cannot be null'); + } + $this->container['white_list_status'] = $white_list_status; + + return $this; + } + + /** + * Gets work_phone + * + * @return \Adyen\Model\Payments\Phone|null + */ + public function getWorkPhone() + { + return $this->container['work_phone']; + } + + /** + * Sets work_phone + * + * @param \Adyen\Model\Payments\Phone|null $work_phone work_phone + * + * @return self + */ + public function setWorkPhone($work_phone) + { + if (is_null($work_phone)) { + throw new \InvalidArgumentException('non-nullable work_phone cannot be null'); + } + $this->container['work_phone'] = $work_phone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDS2Result.php b/src/Adyen/Model/Payments/ThreeDS2Result.php new file mode 100644 index 000000000..7cd48f66f --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDS2Result.php @@ -0,0 +1,944 @@ + + */ +class ThreeDS2Result implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2Result'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication_value' => 'string', + 'cavv_algorithm' => 'string', + 'challenge_cancel' => 'string', + 'challenge_indicator' => 'string', + 'ds_trans_id' => 'string', + 'eci' => 'string', + 'exemption_indicator' => 'string', + 'message_version' => 'string', + 'risk_score' => 'string', + 'three_ds_server_trans_id' => 'string', + 'timestamp' => 'string', + 'trans_status' => 'string', + 'trans_status_reason' => 'string', + 'white_list_status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication_value' => null, + 'cavv_algorithm' => null, + 'challenge_cancel' => null, + 'challenge_indicator' => null, + 'ds_trans_id' => null, + 'eci' => null, + 'exemption_indicator' => null, + 'message_version' => null, + 'risk_score' => null, + 'three_ds_server_trans_id' => null, + 'timestamp' => null, + 'trans_status' => null, + 'trans_status_reason' => null, + 'white_list_status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication_value' => false, + 'cavv_algorithm' => false, + 'challenge_cancel' => false, + 'challenge_indicator' => false, + 'ds_trans_id' => false, + 'eci' => false, + 'exemption_indicator' => false, + 'message_version' => false, + 'risk_score' => false, + 'three_ds_server_trans_id' => false, + 'timestamp' => false, + 'trans_status' => false, + 'trans_status_reason' => false, + 'white_list_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication_value' => 'authenticationValue', + 'cavv_algorithm' => 'cavvAlgorithm', + 'challenge_cancel' => 'challengeCancel', + 'challenge_indicator' => 'challengeIndicator', + 'ds_trans_id' => 'dsTransID', + 'eci' => 'eci', + 'exemption_indicator' => 'exemptionIndicator', + 'message_version' => 'messageVersion', + 'risk_score' => 'riskScore', + 'three_ds_server_trans_id' => 'threeDSServerTransID', + 'timestamp' => 'timestamp', + 'trans_status' => 'transStatus', + 'trans_status_reason' => 'transStatusReason', + 'white_list_status' => 'whiteListStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication_value' => 'setAuthenticationValue', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'challenge_cancel' => 'setChallengeCancel', + 'challenge_indicator' => 'setChallengeIndicator', + 'ds_trans_id' => 'setDsTransId', + 'eci' => 'setEci', + 'exemption_indicator' => 'setExemptionIndicator', + 'message_version' => 'setMessageVersion', + 'risk_score' => 'setRiskScore', + 'three_ds_server_trans_id' => 'setThreeDsServerTransId', + 'timestamp' => 'setTimestamp', + 'trans_status' => 'setTransStatus', + 'trans_status_reason' => 'setTransStatusReason', + 'white_list_status' => 'setWhiteListStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication_value' => 'getAuthenticationValue', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'challenge_cancel' => 'getChallengeCancel', + 'challenge_indicator' => 'getChallengeIndicator', + 'ds_trans_id' => 'getDsTransId', + 'eci' => 'getEci', + 'exemption_indicator' => 'getExemptionIndicator', + 'message_version' => 'getMessageVersion', + 'risk_score' => 'getRiskScore', + 'three_ds_server_trans_id' => 'getThreeDsServerTransId', + 'timestamp' => 'getTimestamp', + 'trans_status' => 'getTransStatus', + 'trans_status_reason' => 'getTransStatusReason', + 'white_list_status' => 'getWhiteListStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const CHALLENGE_CANCEL__01 = '01'; + public const CHALLENGE_CANCEL__02 = '02'; + public const CHALLENGE_CANCEL__03 = '03'; + public const CHALLENGE_CANCEL__04 = '04'; + public const CHALLENGE_CANCEL__05 = '05'; + public const CHALLENGE_CANCEL__06 = '06'; + public const CHALLENGE_CANCEL__07 = '07'; + public const CHALLENGE_INDICATOR_NO_PREFERENCE = 'noPreference'; + public const CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE = 'requestNoChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE = 'requestChallenge'; + public const CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE = 'requestChallengeAsMandate'; + public const EXEMPTION_INDICATOR_LOW_VALUE = 'lowValue'; + public const EXEMPTION_INDICATOR_SECURE_CORPORATE = 'secureCorporate'; + public const EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY = 'trustedBeneficiary'; + public const EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS = 'transactionRiskAnalysis'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeCancelAllowableValues() + { + return [ + self::CHALLENGE_CANCEL__01, + self::CHALLENGE_CANCEL__02, + self::CHALLENGE_CANCEL__03, + self::CHALLENGE_CANCEL__04, + self::CHALLENGE_CANCEL__05, + self::CHALLENGE_CANCEL__06, + self::CHALLENGE_CANCEL__07, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeIndicatorAllowableValues() + { + return [ + self::CHALLENGE_INDICATOR_NO_PREFERENCE, + self::CHALLENGE_INDICATOR_REQUEST_NO_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE, + self::CHALLENGE_INDICATOR_REQUEST_CHALLENGE_AS_MANDATE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExemptionIndicatorAllowableValues() + { + return [ + self::EXEMPTION_INDICATOR_LOW_VALUE, + self::EXEMPTION_INDICATOR_SECURE_CORPORATE, + self::EXEMPTION_INDICATOR_TRUSTED_BENEFICIARY, + self::EXEMPTION_INDICATOR_TRANSACTION_RISK_ANALYSIS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication_value', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('challenge_cancel', $data ?? [], null); + $this->setIfExists('challenge_indicator', $data ?? [], null); + $this->setIfExists('ds_trans_id', $data ?? [], null); + $this->setIfExists('eci', $data ?? [], null); + $this->setIfExists('exemption_indicator', $data ?? [], null); + $this->setIfExists('message_version', $data ?? [], null); + $this->setIfExists('risk_score', $data ?? [], null); + $this->setIfExists('three_ds_server_trans_id', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('trans_status', $data ?? [], null); + $this->setIfExists('trans_status_reason', $data ?? [], null); + $this->setIfExists('white_list_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!is_null($this->container['challenge_cancel']) && !in_array($this->container['challenge_cancel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $this->container['challenge_cancel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!is_null($this->container['challenge_indicator']) && !in_array($this->container['challenge_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $this->container['challenge_indicator'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!is_null($this->container['exemption_indicator']) && !in_array($this->container['exemption_indicator'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exemption_indicator', must be one of '%s'", + $this->container['exemption_indicator'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication_value + * + * @return string|null + */ + public function getAuthenticationValue() + { + return $this->container['authentication_value']; + } + + /** + * Sets authentication_value + * + * @param string|null $authentication_value The `authenticationValue` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setAuthenticationValue($authentication_value) + { + if (is_null($authentication_value)) { + throw new \InvalidArgumentException('non-nullable authentication_value cannot be null'); + } + $this->container['authentication_value'] = $authentication_value; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets challenge_cancel + * + * @return string|null + */ + public function getChallengeCancel() + { + return $this->container['challenge_cancel']; + } + + /** + * Sets challenge_cancel + * + * @param string|null $challenge_cancel Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + * + * @return self + */ + public function setChallengeCancel($challenge_cancel) + { + if (is_null($challenge_cancel)) { + throw new \InvalidArgumentException('non-nullable challenge_cancel cannot be null'); + } + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!in_array($challenge_cancel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $challenge_cancel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_cancel'] = $challenge_cancel; + + return $this; + } + + /** + * Gets challenge_indicator + * + * @return string|null + */ + public function getChallengeIndicator() + { + return $this->container['challenge_indicator']; + } + + /** + * Sets challenge_indicator + * + * @param string|null $challenge_indicator Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + * + * @return self + */ + public function setChallengeIndicator($challenge_indicator) + { + if (is_null($challenge_indicator)) { + throw new \InvalidArgumentException('non-nullable challenge_indicator cannot be null'); + } + $allowedValues = $this->getChallengeIndicatorAllowableValues(); + if (!in_array($challenge_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_indicator', must be one of '%s'", + $challenge_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_indicator'] = $challenge_indicator; + + return $this; + } + + /** + * Gets ds_trans_id + * + * @return string|null + */ + public function getDsTransId() + { + return $this->container['ds_trans_id']; + } + + /** + * Sets ds_trans_id + * + * @param string|null $ds_trans_id The `dsTransID` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setDsTransId($ds_trans_id) + { + if (is_null($ds_trans_id)) { + throw new \InvalidArgumentException('non-nullable ds_trans_id cannot be null'); + } + $this->container['ds_trans_id'] = $ds_trans_id; + + return $this; + } + + /** + * Gets eci + * + * @return string|null + */ + public function getEci() + { + return $this->container['eci']; + } + + /** + * Sets eci + * + * @param string|null $eci The `eci` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setEci($eci) + { + if (is_null($eci)) { + throw new \InvalidArgumentException('non-nullable eci cannot be null'); + } + $this->container['eci'] = $eci; + + return $this; + } + + /** + * Gets exemption_indicator + * + * @return string|null + */ + public function getExemptionIndicator() + { + return $this->container['exemption_indicator']; + } + + /** + * Sets exemption_indicator + * + * @param string|null $exemption_indicator Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + * + * @return self + */ + public function setExemptionIndicator($exemption_indicator) + { + if (is_null($exemption_indicator)) { + throw new \InvalidArgumentException('non-nullable exemption_indicator cannot be null'); + } + $allowedValues = $this->getExemptionIndicatorAllowableValues(); + if (!in_array($exemption_indicator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exemption_indicator', must be one of '%s'", + $exemption_indicator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exemption_indicator'] = $exemption_indicator; + + return $this; + } + + /** + * Gets message_version + * + * @return string|null + */ + public function getMessageVersion() + { + return $this->container['message_version']; + } + + /** + * Sets message_version + * + * @param string|null $message_version The `messageVersion` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setMessageVersion($message_version) + { + if (is_null($message_version)) { + throw new \InvalidArgumentException('non-nullable message_version cannot be null'); + } + $this->container['message_version'] = $message_version; + + return $this; + } + + /** + * Gets risk_score + * + * @return string|null + */ + public function getRiskScore() + { + return $this->container['risk_score']; + } + + /** + * Sets risk_score + * + * @param string|null $risk_score Risk score calculated by Cartes Bancaires Directory Server (DS). + * + * @return self + */ + public function setRiskScore($risk_score) + { + if (is_null($risk_score)) { + throw new \InvalidArgumentException('non-nullable risk_score cannot be null'); + } + $this->container['risk_score'] = $risk_score; + + return $this; + } + + /** + * Gets three_ds_server_trans_id + * + * @return string|null + */ + public function getThreeDsServerTransId() + { + return $this->container['three_ds_server_trans_id']; + } + + /** + * Sets three_ds_server_trans_id + * + * @param string|null $three_ds_server_trans_id The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setThreeDsServerTransId($three_ds_server_trans_id) + { + if (is_null($three_ds_server_trans_id)) { + throw new \InvalidArgumentException('non-nullable three_ds_server_trans_id cannot be null'); + } + $this->container['three_ds_server_trans_id'] = $three_ds_server_trans_id; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The `timestamp` value of the 3D Secure 2 authentication. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets trans_status + * + * @return string|null + */ + public function getTransStatus() + { + return $this->container['trans_status']; + } + + /** + * Sets trans_status + * + * @param string|null $trans_status The `transStatus` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setTransStatus($trans_status) + { + if (is_null($trans_status)) { + throw new \InvalidArgumentException('non-nullable trans_status cannot be null'); + } + $this->container['trans_status'] = $trans_status; + + return $this; + } + + /** + * Gets trans_status_reason + * + * @return string|null + */ + public function getTransStatusReason() + { + return $this->container['trans_status_reason']; + } + + /** + * Sets trans_status_reason + * + * @param string|null $trans_status_reason Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + * + * @return self + */ + public function setTransStatusReason($trans_status_reason) + { + if (is_null($trans_status_reason)) { + throw new \InvalidArgumentException('non-nullable trans_status_reason cannot be null'); + } + $this->container['trans_status_reason'] = $trans_status_reason; + + return $this; + } + + /** + * Gets white_list_status + * + * @return string|null + */ + public function getWhiteListStatus() + { + return $this->container['white_list_status']; + } + + /** + * Sets white_list_status + * + * @param string|null $white_list_status The `whiteListStatus` value as defined in the 3D Secure 2 specification. + * + * @return self + */ + public function setWhiteListStatus($white_list_status) + { + if (is_null($white_list_status)) { + throw new \InvalidArgumentException('non-nullable white_list_status cannot be null'); + } + $this->container['white_list_status'] = $white_list_status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDS2ResultRequest.php b/src/Adyen/Model/Payments/ThreeDS2ResultRequest.php new file mode 100644 index 000000000..337d25020 --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDS2ResultRequest.php @@ -0,0 +1,425 @@ + + */ +class ThreeDS2ResultRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2ResultRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_account' => 'string', + 'psp_reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_account' => null, + 'psp_reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_account' => false, + 'psp_reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_account' => 'merchantAccount', + 'psp_reference' => 'pspReference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_account' => 'setMerchantAccount', + 'psp_reference' => 'setPspReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_account' => 'getMerchantAccount', + 'psp_reference' => 'getPspReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' can't be null"; + } + if ($this->container['psp_reference'] === null) { + $invalidProperties[] = "'psp_reference' 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 merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account identifier, with which you want to process the transaction. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string $psp_reference The pspReference returned in the /authorise call. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDS2ResultResponse.php b/src/Adyen/Model/Payments/ThreeDS2ResultResponse.php new file mode 100644 index 000000000..a4c6e8a5b --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDS2ResultResponse.php @@ -0,0 +1,385 @@ + + */ +class ThreeDS2ResultResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDS2ResultResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'three_ds2_result' => '\Adyen\Model\Payments\ThreeDS2Result' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'three_ds2_result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'three_ds2_result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'three_ds2_result' => 'threeDS2Result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'three_ds2_result' => 'setThreeDs2Result' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'three_ds2_result' => 'getThreeDs2Result' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('three_ds2_result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets three_ds2_result + * + * @return \Adyen\Model\Payments\ThreeDS2Result|null + */ + public function getThreeDs2Result() + { + return $this->container['three_ds2_result']; + } + + /** + * Sets three_ds2_result + * + * @param \Adyen\Model\Payments\ThreeDS2Result|null $three_ds2_result three_ds2_result + * + * @return self + */ + public function setThreeDs2Result($three_ds2_result) + { + if (is_null($three_ds2_result)) { + throw new \InvalidArgumentException('non-nullable three_ds2_result cannot be null'); + } + $this->container['three_ds2_result'] = $three_ds2_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 + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDSRequestorAuthenticationInfo.php b/src/Adyen/Model/Payments/ThreeDSRequestorAuthenticationInfo.php new file mode 100644 index 000000000..c5ee4731c --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDSRequestorAuthenticationInfo.php @@ -0,0 +1,494 @@ + + */ +class ThreeDSRequestorAuthenticationInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDSRequestorAuthenticationInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'three_ds_req_auth_data' => 'string', + 'three_ds_req_auth_method' => 'string', + 'three_ds_req_auth_timestamp' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'three_ds_req_auth_data' => null, + 'three_ds_req_auth_method' => null, + 'three_ds_req_auth_timestamp' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'three_ds_req_auth_data' => false, + 'three_ds_req_auth_method' => false, + 'three_ds_req_auth_timestamp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'three_ds_req_auth_data' => 'threeDSReqAuthData', + 'three_ds_req_auth_method' => 'threeDSReqAuthMethod', + 'three_ds_req_auth_timestamp' => 'threeDSReqAuthTimestamp' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'three_ds_req_auth_data' => 'setThreeDsReqAuthData', + 'three_ds_req_auth_method' => 'setThreeDsReqAuthMethod', + 'three_ds_req_auth_timestamp' => 'setThreeDsReqAuthTimestamp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'three_ds_req_auth_data' => 'getThreeDsReqAuthData', + 'three_ds_req_auth_method' => 'getThreeDsReqAuthMethod', + 'three_ds_req_auth_timestamp' => 'getThreeDsReqAuthTimestamp' + ]; + + /** + * 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 THREE_DS_REQ_AUTH_METHOD__01 = '01'; + public const THREE_DS_REQ_AUTH_METHOD__02 = '02'; + public const THREE_DS_REQ_AUTH_METHOD__03 = '03'; + public const THREE_DS_REQ_AUTH_METHOD__04 = '04'; + public const THREE_DS_REQ_AUTH_METHOD__05 = '05'; + public const THREE_DS_REQ_AUTH_METHOD__06 = '06'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDsReqAuthMethodAllowableValues() + { + return [ + self::THREE_DS_REQ_AUTH_METHOD__01, + self::THREE_DS_REQ_AUTH_METHOD__02, + self::THREE_DS_REQ_AUTH_METHOD__03, + self::THREE_DS_REQ_AUTH_METHOD__04, + self::THREE_DS_REQ_AUTH_METHOD__05, + self::THREE_DS_REQ_AUTH_METHOD__06, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('three_ds_req_auth_data', $data ?? [], null); + $this->setIfExists('three_ds_req_auth_method', $data ?? [], null); + $this->setIfExists('three_ds_req_auth_timestamp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getThreeDsReqAuthMethodAllowableValues(); + if (!is_null($this->container['three_ds_req_auth_method']) && !in_array($this->container['three_ds_req_auth_method'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'three_ds_req_auth_method', must be one of '%s'", + $this->container['three_ds_req_auth_method'], + 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 three_ds_req_auth_data + * + * @return string|null + */ + public function getThreeDsReqAuthData() + { + return $this->container['three_ds_req_auth_data']; + } + + /** + * Sets three_ds_req_auth_data + * + * @param string|null $three_ds_req_auth_data Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + * + * @return self + */ + public function setThreeDsReqAuthData($three_ds_req_auth_data) + { + if (is_null($three_ds_req_auth_data)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_auth_data cannot be null'); + } + $this->container['three_ds_req_auth_data'] = $three_ds_req_auth_data; + + return $this; + } + + /** + * Gets three_ds_req_auth_method + * + * @return string|null + */ + public function getThreeDsReqAuthMethod() + { + return $this->container['three_ds_req_auth_method']; + } + + /** + * Sets three_ds_req_auth_method + * + * @param string|null $three_ds_req_auth_method Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. + * + * @return self + */ + public function setThreeDsReqAuthMethod($three_ds_req_auth_method) + { + if (is_null($three_ds_req_auth_method)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_auth_method cannot be null'); + } + $allowedValues = $this->getThreeDsReqAuthMethodAllowableValues(); + if (!in_array($three_ds_req_auth_method, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'three_ds_req_auth_method', must be one of '%s'", + $three_ds_req_auth_method, + implode("', '", $allowedValues) + ) + ); + } + $this->container['three_ds_req_auth_method'] = $three_ds_req_auth_method; + + return $this; + } + + /** + * Gets three_ds_req_auth_timestamp + * + * @return string|null + */ + public function getThreeDsReqAuthTimestamp() + { + return $this->container['three_ds_req_auth_timestamp']; + } + + /** + * Sets three_ds_req_auth_timestamp + * + * @param string|null $three_ds_req_auth_timestamp Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM + * + * @return self + */ + public function setThreeDsReqAuthTimestamp($three_ds_req_auth_timestamp) + { + if (is_null($three_ds_req_auth_timestamp)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_auth_timestamp cannot be null'); + } + $this->container['three_ds_req_auth_timestamp'] = $three_ds_req_auth_timestamp; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDSRequestorPriorAuthenticationInfo.php b/src/Adyen/Model/Payments/ThreeDSRequestorPriorAuthenticationInfo.php new file mode 100644 index 000000000..4406642b7 --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDSRequestorPriorAuthenticationInfo.php @@ -0,0 +1,524 @@ + + */ +class ThreeDSRequestorPriorAuthenticationInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDSRequestorPriorAuthenticationInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'three_ds_req_prior_auth_data' => 'string', + 'three_ds_req_prior_auth_method' => 'string', + 'three_ds_req_prior_auth_timestamp' => 'string', + 'three_ds_req_prior_ref' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'three_ds_req_prior_auth_data' => null, + 'three_ds_req_prior_auth_method' => null, + 'three_ds_req_prior_auth_timestamp' => null, + 'three_ds_req_prior_ref' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'three_ds_req_prior_auth_data' => false, + 'three_ds_req_prior_auth_method' => false, + 'three_ds_req_prior_auth_timestamp' => false, + 'three_ds_req_prior_ref' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'three_ds_req_prior_auth_data' => 'threeDSReqPriorAuthData', + 'three_ds_req_prior_auth_method' => 'threeDSReqPriorAuthMethod', + 'three_ds_req_prior_auth_timestamp' => 'threeDSReqPriorAuthTimestamp', + 'three_ds_req_prior_ref' => 'threeDSReqPriorRef' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'three_ds_req_prior_auth_data' => 'setThreeDsReqPriorAuthData', + 'three_ds_req_prior_auth_method' => 'setThreeDsReqPriorAuthMethod', + 'three_ds_req_prior_auth_timestamp' => 'setThreeDsReqPriorAuthTimestamp', + 'three_ds_req_prior_ref' => 'setThreeDsReqPriorRef' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'three_ds_req_prior_auth_data' => 'getThreeDsReqPriorAuthData', + 'three_ds_req_prior_auth_method' => 'getThreeDsReqPriorAuthMethod', + 'three_ds_req_prior_auth_timestamp' => 'getThreeDsReqPriorAuthTimestamp', + 'three_ds_req_prior_ref' => 'getThreeDsReqPriorRef' + ]; + + /** + * 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 THREE_DS_REQ_PRIOR_AUTH_METHOD__01 = '01'; + public const THREE_DS_REQ_PRIOR_AUTH_METHOD__02 = '02'; + public const THREE_DS_REQ_PRIOR_AUTH_METHOD__03 = '03'; + public const THREE_DS_REQ_PRIOR_AUTH_METHOD__04 = '04'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getThreeDsReqPriorAuthMethodAllowableValues() + { + return [ + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__01, + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__02, + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__03, + self::THREE_DS_REQ_PRIOR_AUTH_METHOD__04, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('three_ds_req_prior_auth_data', $data ?? [], null); + $this->setIfExists('three_ds_req_prior_auth_method', $data ?? [], null); + $this->setIfExists('three_ds_req_prior_auth_timestamp', $data ?? [], null); + $this->setIfExists('three_ds_req_prior_ref', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getThreeDsReqPriorAuthMethodAllowableValues(); + if (!is_null($this->container['three_ds_req_prior_auth_method']) && !in_array($this->container['three_ds_req_prior_auth_method'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'three_ds_req_prior_auth_method', must be one of '%s'", + $this->container['three_ds_req_prior_auth_method'], + 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 three_ds_req_prior_auth_data + * + * @return string|null + */ + public function getThreeDsReqPriorAuthData() + { + return $this->container['three_ds_req_prior_auth_data']; + } + + /** + * Sets three_ds_req_prior_auth_data + * + * @param string|null $three_ds_req_prior_auth_data Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + * + * @return self + */ + public function setThreeDsReqPriorAuthData($three_ds_req_prior_auth_data) + { + if (is_null($three_ds_req_prior_auth_data)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_auth_data cannot be null'); + } + $this->container['three_ds_req_prior_auth_data'] = $three_ds_req_prior_auth_data; + + return $this; + } + + /** + * Gets three_ds_req_prior_auth_method + * + * @return string|null + */ + public function getThreeDsReqPriorAuthMethod() + { + return $this->container['three_ds_req_prior_auth_method']; + } + + /** + * Sets three_ds_req_prior_auth_method + * + * @param string|null $three_ds_req_prior_auth_method Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. + * + * @return self + */ + public function setThreeDsReqPriorAuthMethod($three_ds_req_prior_auth_method) + { + if (is_null($three_ds_req_prior_auth_method)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_auth_method cannot be null'); + } + $allowedValues = $this->getThreeDsReqPriorAuthMethodAllowableValues(); + if (!in_array($three_ds_req_prior_auth_method, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'three_ds_req_prior_auth_method', must be one of '%s'", + $three_ds_req_prior_auth_method, + implode("', '", $allowedValues) + ) + ); + } + $this->container['three_ds_req_prior_auth_method'] = $three_ds_req_prior_auth_method; + + return $this; + } + + /** + * Gets three_ds_req_prior_auth_timestamp + * + * @return string|null + */ + public function getThreeDsReqPriorAuthTimestamp() + { + return $this->container['three_ds_req_prior_auth_timestamp']; + } + + /** + * Sets three_ds_req_prior_auth_timestamp + * + * @param string|null $three_ds_req_prior_auth_timestamp Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM + * + * @return self + */ + public function setThreeDsReqPriorAuthTimestamp($three_ds_req_prior_auth_timestamp) + { + if (is_null($three_ds_req_prior_auth_timestamp)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_auth_timestamp cannot be null'); + } + $this->container['three_ds_req_prior_auth_timestamp'] = $three_ds_req_prior_auth_timestamp; + + return $this; + } + + /** + * Gets three_ds_req_prior_ref + * + * @return string|null + */ + public function getThreeDsReqPriorRef() + { + return $this->container['three_ds_req_prior_ref']; + } + + /** + * Sets three_ds_req_prior_ref + * + * @param string|null $three_ds_req_prior_ref This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. + * + * @return self + */ + public function setThreeDsReqPriorRef($three_ds_req_prior_ref) + { + if (is_null($three_ds_req_prior_ref)) { + throw new \InvalidArgumentException('non-nullable three_ds_req_prior_ref cannot be null'); + } + $this->container['three_ds_req_prior_ref'] = $three_ds_req_prior_ref; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/ThreeDSecureData.php b/src/Adyen/Model/Payments/ThreeDSecureData.php new file mode 100644 index 000000000..c741bc690 --- /dev/null +++ b/src/Adyen/Model/Payments/ThreeDSecureData.php @@ -0,0 +1,884 @@ + + */ +class ThreeDSecureData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ThreeDSecureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication_response' => 'string', + 'cavv' => 'string', + 'cavv_algorithm' => 'string', + 'challenge_cancel' => 'string', + 'directory_response' => 'string', + 'ds_trans_id' => 'string', + 'eci' => 'string', + 'risk_score' => 'string', + 'three_ds_version' => 'string', + 'token_authentication_verification_value' => 'string', + 'trans_status_reason' => 'string', + 'xid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication_response' => null, + 'cavv' => 'byte', + 'cavv_algorithm' => null, + 'challenge_cancel' => null, + 'directory_response' => null, + 'ds_trans_id' => null, + 'eci' => null, + 'risk_score' => null, + 'three_ds_version' => null, + 'token_authentication_verification_value' => 'byte', + 'trans_status_reason' => null, + 'xid' => 'byte' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication_response' => false, + 'cavv' => false, + 'cavv_algorithm' => false, + 'challenge_cancel' => false, + 'directory_response' => false, + 'ds_trans_id' => false, + 'eci' => false, + 'risk_score' => false, + 'three_ds_version' => false, + 'token_authentication_verification_value' => false, + 'trans_status_reason' => false, + 'xid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication_response' => 'authenticationResponse', + 'cavv' => 'cavv', + 'cavv_algorithm' => 'cavvAlgorithm', + 'challenge_cancel' => 'challengeCancel', + 'directory_response' => 'directoryResponse', + 'ds_trans_id' => 'dsTransID', + 'eci' => 'eci', + 'risk_score' => 'riskScore', + 'three_ds_version' => 'threeDSVersion', + 'token_authentication_verification_value' => 'tokenAuthenticationVerificationValue', + 'trans_status_reason' => 'transStatusReason', + 'xid' => 'xid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication_response' => 'setAuthenticationResponse', + 'cavv' => 'setCavv', + 'cavv_algorithm' => 'setCavvAlgorithm', + 'challenge_cancel' => 'setChallengeCancel', + 'directory_response' => 'setDirectoryResponse', + 'ds_trans_id' => 'setDsTransId', + 'eci' => 'setEci', + 'risk_score' => 'setRiskScore', + 'three_ds_version' => 'setThreeDsVersion', + 'token_authentication_verification_value' => 'setTokenAuthenticationVerificationValue', + 'trans_status_reason' => 'setTransStatusReason', + 'xid' => 'setXid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication_response' => 'getAuthenticationResponse', + 'cavv' => 'getCavv', + 'cavv_algorithm' => 'getCavvAlgorithm', + 'challenge_cancel' => 'getChallengeCancel', + 'directory_response' => 'getDirectoryResponse', + 'ds_trans_id' => 'getDsTransId', + 'eci' => 'getEci', + 'risk_score' => 'getRiskScore', + 'three_ds_version' => 'getThreeDsVersion', + 'token_authentication_verification_value' => 'getTokenAuthenticationVerificationValue', + 'trans_status_reason' => 'getTransStatusReason', + 'xid' => 'getXid' + ]; + + /** + * 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 AUTHENTICATION_RESPONSE_Y = 'Y'; + public const AUTHENTICATION_RESPONSE_N = 'N'; + public const AUTHENTICATION_RESPONSE_U = 'U'; + public const AUTHENTICATION_RESPONSE_A = 'A'; + public const CHALLENGE_CANCEL__01 = '01'; + public const CHALLENGE_CANCEL__02 = '02'; + public const CHALLENGE_CANCEL__03 = '03'; + public const CHALLENGE_CANCEL__04 = '04'; + public const CHALLENGE_CANCEL__05 = '05'; + public const CHALLENGE_CANCEL__06 = '06'; + public const CHALLENGE_CANCEL__07 = '07'; + public const DIRECTORY_RESPONSE_A = 'A'; + public const DIRECTORY_RESPONSE_C = 'C'; + public const DIRECTORY_RESPONSE_D = 'D'; + public const DIRECTORY_RESPONSE_I = 'I'; + public const DIRECTORY_RESPONSE_N = 'N'; + public const DIRECTORY_RESPONSE_R = 'R'; + public const DIRECTORY_RESPONSE_U = 'U'; + public const DIRECTORY_RESPONSE_Y = 'Y'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAuthenticationResponseAllowableValues() + { + return [ + self::AUTHENTICATION_RESPONSE_Y, + self::AUTHENTICATION_RESPONSE_N, + self::AUTHENTICATION_RESPONSE_U, + self::AUTHENTICATION_RESPONSE_A, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getChallengeCancelAllowableValues() + { + return [ + self::CHALLENGE_CANCEL__01, + self::CHALLENGE_CANCEL__02, + self::CHALLENGE_CANCEL__03, + self::CHALLENGE_CANCEL__04, + self::CHALLENGE_CANCEL__05, + self::CHALLENGE_CANCEL__06, + self::CHALLENGE_CANCEL__07, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDirectoryResponseAllowableValues() + { + return [ + self::DIRECTORY_RESPONSE_A, + self::DIRECTORY_RESPONSE_C, + self::DIRECTORY_RESPONSE_D, + self::DIRECTORY_RESPONSE_I, + self::DIRECTORY_RESPONSE_N, + self::DIRECTORY_RESPONSE_R, + self::DIRECTORY_RESPONSE_U, + self::DIRECTORY_RESPONSE_Y, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication_response', $data ?? [], null); + $this->setIfExists('cavv', $data ?? [], null); + $this->setIfExists('cavv_algorithm', $data ?? [], null); + $this->setIfExists('challenge_cancel', $data ?? [], null); + $this->setIfExists('directory_response', $data ?? [], null); + $this->setIfExists('ds_trans_id', $data ?? [], null); + $this->setIfExists('eci', $data ?? [], null); + $this->setIfExists('risk_score', $data ?? [], null); + $this->setIfExists('three_ds_version', $data ?? [], null); + $this->setIfExists('token_authentication_verification_value', $data ?? [], null); + $this->setIfExists('trans_status_reason', $data ?? [], null); + $this->setIfExists('xid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAuthenticationResponseAllowableValues(); + if (!is_null($this->container['authentication_response']) && !in_array($this->container['authentication_response'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'authentication_response', must be one of '%s'", + $this->container['authentication_response'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!is_null($this->container['challenge_cancel']) && !in_array($this->container['challenge_cancel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $this->container['challenge_cancel'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getDirectoryResponseAllowableValues(); + if (!is_null($this->container['directory_response']) && !in_array($this->container['directory_response'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'directory_response', must be one of '%s'", + $this->container['directory_response'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication_response + * + * @return string|null + */ + public function getAuthenticationResponse() + { + return $this->container['authentication_response']; + } + + /** + * Sets authentication_response + * + * @param string|null $authentication_response In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. + * + * @return self + */ + public function setAuthenticationResponse($authentication_response) + { + if (is_null($authentication_response)) { + throw new \InvalidArgumentException('non-nullable authentication_response cannot be null'); + } + $allowedValues = $this->getAuthenticationResponseAllowableValues(); + if (!in_array($authentication_response, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'authentication_response', must be one of '%s'", + $authentication_response, + implode("', '", $allowedValues) + ) + ); + } + $this->container['authentication_response'] = $authentication_response; + + return $this; + } + + /** + * Gets cavv + * + * @return string|null + */ + public function getCavv() + { + return $this->container['cavv']; + } + + /** + * Sets cavv + * + * @param string|null $cavv The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). + * + * @return self + */ + public function setCavv($cavv) + { + if (is_null($cavv)) { + throw new \InvalidArgumentException('non-nullable cavv cannot be null'); + } + $this->container['cavv'] = $cavv; + + return $this; + } + + /** + * Gets cavv_algorithm + * + * @return string|null + */ + public function getCavvAlgorithm() + { + return $this->container['cavv_algorithm']; + } + + /** + * Sets cavv_algorithm + * + * @param string|null $cavv_algorithm The CAVV algorithm used. Include this only for 3D Secure 1. + * + * @return self + */ + public function setCavvAlgorithm($cavv_algorithm) + { + if (is_null($cavv_algorithm)) { + throw new \InvalidArgumentException('non-nullable cavv_algorithm cannot be null'); + } + $this->container['cavv_algorithm'] = $cavv_algorithm; + + return $this; + } + + /** + * Gets challenge_cancel + * + * @return string|null + */ + public function getChallengeCancel() + { + return $this->container['challenge_cancel']; + } + + /** + * Sets challenge_cancel + * + * @param string|null $challenge_cancel Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + * + * @return self + */ + public function setChallengeCancel($challenge_cancel) + { + if (is_null($challenge_cancel)) { + throw new \InvalidArgumentException('non-nullable challenge_cancel cannot be null'); + } + $allowedValues = $this->getChallengeCancelAllowableValues(); + if (!in_array($challenge_cancel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'challenge_cancel', must be one of '%s'", + $challenge_cancel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['challenge_cancel'] = $challenge_cancel; + + return $this; + } + + /** + * Gets directory_response + * + * @return string|null + */ + public function getDirectoryResponse() + { + return $this->container['directory_response']; + } + + /** + * Sets directory_response + * + * @param string|null $directory_response In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`. + * + * @return self + */ + public function setDirectoryResponse($directory_response) + { + if (is_null($directory_response)) { + throw new \InvalidArgumentException('non-nullable directory_response cannot be null'); + } + $allowedValues = $this->getDirectoryResponseAllowableValues(); + if (!in_array($directory_response, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'directory_response', must be one of '%s'", + $directory_response, + implode("', '", $allowedValues) + ) + ); + } + $this->container['directory_response'] = $directory_response; + + return $this; + } + + /** + * Gets ds_trans_id + * + * @return string|null + */ + public function getDsTransId() + { + return $this->container['ds_trans_id']; + } + + /** + * Sets ds_trans_id + * + * @param string|null $ds_trans_id Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. + * + * @return self + */ + public function setDsTransId($ds_trans_id) + { + if (is_null($ds_trans_id)) { + throw new \InvalidArgumentException('non-nullable ds_trans_id cannot be null'); + } + $this->container['ds_trans_id'] = $ds_trans_id; + + return $this; + } + + /** + * Gets eci + * + * @return string|null + */ + public function getEci() + { + return $this->container['eci']; + } + + /** + * Sets eci + * + * @param string|null $eci The electronic commerce indicator. + * + * @return self + */ + public function setEci($eci) + { + if (is_null($eci)) { + throw new \InvalidArgumentException('non-nullable eci cannot be null'); + } + $this->container['eci'] = $eci; + + return $this; + } + + /** + * Gets risk_score + * + * @return string|null + */ + public function getRiskScore() + { + return $this->container['risk_score']; + } + + /** + * Sets risk_score + * + * @param string|null $risk_score Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. + * + * @return self + */ + public function setRiskScore($risk_score) + { + if (is_null($risk_score)) { + throw new \InvalidArgumentException('non-nullable risk_score cannot be null'); + } + $this->container['risk_score'] = $risk_score; + + return $this; + } + + /** + * Gets three_ds_version + * + * @return string|null + */ + public function getThreeDsVersion() + { + return $this->container['three_ds_version']; + } + + /** + * Sets three_ds_version + * + * @param string|null $three_ds_version The version of the 3D Secure protocol. + * + * @return self + */ + public function setThreeDsVersion($three_ds_version) + { + if (is_null($three_ds_version)) { + throw new \InvalidArgumentException('non-nullable three_ds_version cannot be null'); + } + $this->container['three_ds_version'] = $three_ds_version; + + return $this; + } + + /** + * Gets token_authentication_verification_value + * + * @return string|null + */ + public function getTokenAuthenticationVerificationValue() + { + return $this->container['token_authentication_verification_value']; + } + + /** + * Sets token_authentication_verification_value + * + * @param string|null $token_authentication_verification_value Network token authentication verification value (TAVV). The network token cryptogram. + * + * @return self + */ + public function setTokenAuthenticationVerificationValue($token_authentication_verification_value) + { + if (is_null($token_authentication_verification_value)) { + throw new \InvalidArgumentException('non-nullable token_authentication_verification_value cannot be null'); + } + $this->container['token_authentication_verification_value'] = $token_authentication_verification_value; + + return $this; + } + + /** + * Gets trans_status_reason + * + * @return string|null + */ + public function getTransStatusReason() + { + return $this->container['trans_status_reason']; + } + + /** + * Sets trans_status_reason + * + * @param string|null $trans_status_reason Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + * + * @return self + */ + public function setTransStatusReason($trans_status_reason) + { + if (is_null($trans_status_reason)) { + throw new \InvalidArgumentException('non-nullable trans_status_reason cannot be null'); + } + $this->container['trans_status_reason'] = $trans_status_reason; + + return $this; + } + + /** + * Gets xid + * + * @return string|null + */ + public function getXid() + { + return $this->container['xid']; + } + + /** + * Sets xid + * + * @param string|null $xid Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). + * + * @return self + */ + public function setXid($xid) + { + if (is_null($xid)) { + throw new \InvalidArgumentException('non-nullable xid cannot be null'); + } + $this->container['xid'] = $xid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Payments/VoidPendingRefundRequest.php b/src/Adyen/Model/Payments/VoidPendingRefundRequest.php new file mode 100644 index 000000000..383b0410d --- /dev/null +++ b/src/Adyen/Model/Payments/VoidPendingRefundRequest.php @@ -0,0 +1,728 @@ + + */ +class VoidPendingRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VoidPendingRefundRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'additional_data' => 'array', + 'merchant_account' => 'string', + 'modification_amount' => '\Adyen\Model\Payments\Amount', + 'mpi_data' => '\Adyen\Model\Payments\ThreeDSecureData', + 'original_merchant_reference' => 'string', + 'original_reference' => 'string', + 'platform_chargeback_logic' => '\Adyen\Model\Payments\PlatformChargebackLogic', + 'reference' => 'string', + 'splits' => '\Adyen\Model\Payments\Split[]', + 'tender_reference' => 'string', + 'unique_terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'additional_data' => null, + 'merchant_account' => null, + 'modification_amount' => null, + 'mpi_data' => null, + 'original_merchant_reference' => null, + 'original_reference' => null, + 'platform_chargeback_logic' => null, + 'reference' => null, + 'splits' => null, + 'tender_reference' => null, + 'unique_terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'additional_data' => false, + 'merchant_account' => false, + 'modification_amount' => false, + 'mpi_data' => false, + 'original_merchant_reference' => false, + 'original_reference' => false, + 'platform_chargeback_logic' => false, + 'reference' => false, + 'splits' => false, + 'tender_reference' => false, + 'unique_terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'additional_data' => 'additionalData', + 'merchant_account' => 'merchantAccount', + 'modification_amount' => 'modificationAmount', + 'mpi_data' => 'mpiData', + 'original_merchant_reference' => 'originalMerchantReference', + 'original_reference' => 'originalReference', + 'platform_chargeback_logic' => 'platformChargebackLogic', + 'reference' => 'reference', + 'splits' => 'splits', + 'tender_reference' => 'tenderReference', + 'unique_terminal_id' => 'uniqueTerminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'additional_data' => 'setAdditionalData', + 'merchant_account' => 'setMerchantAccount', + 'modification_amount' => 'setModificationAmount', + 'mpi_data' => 'setMpiData', + 'original_merchant_reference' => 'setOriginalMerchantReference', + 'original_reference' => 'setOriginalReference', + 'platform_chargeback_logic' => 'setPlatformChargebackLogic', + 'reference' => 'setReference', + 'splits' => 'setSplits', + 'tender_reference' => 'setTenderReference', + 'unique_terminal_id' => 'setUniqueTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'additional_data' => 'getAdditionalData', + 'merchant_account' => 'getMerchantAccount', + 'modification_amount' => 'getModificationAmount', + 'mpi_data' => 'getMpiData', + 'original_merchant_reference' => 'getOriginalMerchantReference', + 'original_reference' => 'getOriginalReference', + 'platform_chargeback_logic' => 'getPlatformChargebackLogic', + 'reference' => 'getReference', + 'splits' => 'getSplits', + 'tender_reference' => 'getTenderReference', + 'unique_terminal_id' => 'getUniqueTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('additional_data', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('modification_amount', $data ?? [], null); + $this->setIfExists('mpi_data', $data ?? [], null); + $this->setIfExists('original_merchant_reference', $data ?? [], null); + $this->setIfExists('original_reference', $data ?? [], null); + $this->setIfExists('platform_chargeback_logic', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); + $this->setIfExists('tender_reference', $data ?? [], null); + $this->setIfExists('unique_terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' 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 additional_data + * + * @return array|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param array|null $additional_data This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. + * + * @return self + */ + public function setAdditionalData($additional_data) + { + if (is_null($additional_data)) { + throw new \InvalidArgumentException('non-nullable additional_data cannot be null'); + } + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account that is used to process the payment. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets modification_amount + * + * @return \Adyen\Model\Payments\Amount|null + */ + public function getModificationAmount() + { + return $this->container['modification_amount']; + } + + /** + * Sets modification_amount + * + * @param \Adyen\Model\Payments\Amount|null $modification_amount modification_amount + * + * @return self + */ + public function setModificationAmount($modification_amount) + { + if (is_null($modification_amount)) { + throw new \InvalidArgumentException('non-nullable modification_amount cannot be null'); + } + $this->container['modification_amount'] = $modification_amount; + + return $this; + } + + /** + * Gets mpi_data + * + * @return \Adyen\Model\Payments\ThreeDSecureData|null + */ + public function getMpiData() + { + return $this->container['mpi_data']; + } + + /** + * Sets mpi_data + * + * @param \Adyen\Model\Payments\ThreeDSecureData|null $mpi_data mpi_data + * + * @return self + */ + public function setMpiData($mpi_data) + { + if (is_null($mpi_data)) { + throw new \InvalidArgumentException('non-nullable mpi_data cannot be null'); + } + $this->container['mpi_data'] = $mpi_data; + + return $this; + } + + /** + * Gets original_merchant_reference + * + * @return string|null + */ + public function getOriginalMerchantReference() + { + return $this->container['original_merchant_reference']; + } + + /** + * Sets original_merchant_reference + * + * @param string|null $original_merchant_reference The original merchant reference to cancel. + * + * @return self + */ + public function setOriginalMerchantReference($original_merchant_reference) + { + if (is_null($original_merchant_reference)) { + throw new \InvalidArgumentException('non-nullable original_merchant_reference cannot be null'); + } + $this->container['original_merchant_reference'] = $original_merchant_reference; + + return $this; + } + + /** + * Gets original_reference + * + * @return string|null + */ + public function getOriginalReference() + { + return $this->container['original_reference']; + } + + /** + * Sets original_reference + * + * @param string|null $original_reference The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + * + * @return self + */ + public function setOriginalReference($original_reference) + { + if (is_null($original_reference)) { + throw new \InvalidArgumentException('non-nullable original_reference cannot be null'); + } + $this->container['original_reference'] = $original_reference; + + return $this; + } + + /** + * Gets platform_chargeback_logic + * + * @return \Adyen\Model\Payments\PlatformChargebackLogic|null + */ + public function getPlatformChargebackLogic() + { + return $this->container['platform_chargeback_logic']; + } + + /** + * Sets platform_chargeback_logic + * + * @param \Adyen\Model\Payments\PlatformChargebackLogic|null $platform_chargeback_logic platform_chargeback_logic + * + * @return self + */ + public function setPlatformChargebackLogic($platform_chargeback_logic) + { + if (is_null($platform_chargeback_logic)) { + throw new \InvalidArgumentException('non-nullable platform_chargeback_logic cannot be null'); + } + $this->container['platform_chargeback_logic'] = $platform_chargeback_logic; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets splits + * + * @return \Adyen\Model\Payments\Split[]|null + */ + public function getSplits() + { + return $this->container['splits']; + } + + /** + * Sets splits + * + * @param \Adyen\Model\Payments\Split[]|null $splits An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * + * @return self + */ + public function setSplits($splits) + { + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); + } + $this->container['splits'] = $splits; + + return $this; + } + + /** + * Gets tender_reference + * + * @return string|null + */ + public function getTenderReference() + { + return $this->container['tender_reference']; + } + + /** + * Sets tender_reference + * + * @param string|null $tender_reference The transaction reference provided by the PED. For point-of-sale integrations only. + * + * @return self + */ + public function setTenderReference($tender_reference) + { + if (is_null($tender_reference)) { + throw new \InvalidArgumentException('non-nullable tender_reference cannot be null'); + } + $this->container['tender_reference'] = $tender_reference; + + return $this; + } + + /** + * Gets unique_terminal_id + * + * @return string|null + */ + public function getUniqueTerminalId() + { + return $this->container['unique_terminal_id']; + } + + /** + * Sets unique_terminal_id + * + * @param string|null $unique_terminal_id Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + * + * @return self + */ + public function setUniqueTerminalId($unique_terminal_id) + { + if (is_null($unique_terminal_id)) { + throw new \InvalidArgumentException('non-nullable unique_terminal_id cannot be null'); + } + $this->container['unique_terminal_id'] = $unique_terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Service/Payments/GeneralApi.php b/src/Adyen/Service/Payments/GeneralApi.php new file mode 100644 index 000000000..299f3fe3f --- /dev/null +++ b/src/Adyen/Service/Payments/GeneralApi.php @@ -0,0 +1,117 @@ +baseURL = $this->createBaseUrl("https://pal-test.adyen.com/pal/servlet/Payment/v68"); + } + + /** + * Create an authorisation + * + * @param \Adyen\Model\Payments\PaymentRequest $paymentRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\PaymentResult + * @throws AdyenException + */ + public function authorise(\Adyen\Model\Payments\PaymentRequest $paymentRequest, array $requestOptions = null): \Adyen\Model\Payments\PaymentResult + { + $endpoint = $this->baseURL . "/authorise"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\PaymentResult::class); + } + + /** + * Complete a 3DS authorisation + * + * @param \Adyen\Model\Payments\PaymentRequest3d $paymentRequest3d + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\PaymentResult + * @throws AdyenException + */ + public function authorise3d(\Adyen\Model\Payments\PaymentRequest3d $paymentRequest3d, array $requestOptions = null): \Adyen\Model\Payments\PaymentResult + { + $endpoint = $this->baseURL . "/authorise3d"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRequest3d->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\PaymentResult::class); + } + + /** + * Complete a 3DS2 authorisation + * + * @param \Adyen\Model\Payments\PaymentRequest3ds2 $paymentRequest3ds2 + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\PaymentResult + * @throws AdyenException + */ + public function authorise3ds2(\Adyen\Model\Payments\PaymentRequest3ds2 $paymentRequest3ds2, array $requestOptions = null): \Adyen\Model\Payments\PaymentResult + { + $endpoint = $this->baseURL . "/authorise3ds2"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentRequest3ds2->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\PaymentResult::class); + } + + /** + * Get the 3DS authentication result + * + * @param \Adyen\Model\Payments\AuthenticationResultRequest $authenticationResultRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\AuthenticationResultResponse + * @throws AdyenException + */ + public function getAuthenticationResult(\Adyen\Model\Payments\AuthenticationResultRequest $authenticationResultRequest, array $requestOptions = null): \Adyen\Model\Payments\AuthenticationResultResponse + { + $endpoint = $this->baseURL . "/getAuthenticationResult"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $authenticationResultRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\AuthenticationResultResponse::class); + } + + /** + * Get the 3DS2 authentication result + * + * @param \Adyen\Model\Payments\ThreeDS2ResultRequest $threeDs2ResultRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ThreeDS2ResultResponse + * @throws AdyenException + */ + public function retrieve3ds2Result(\Adyen\Model\Payments\ThreeDS2ResultRequest $threeDs2ResultRequest, array $requestOptions = null): \Adyen\Model\Payments\ThreeDS2ResultResponse + { + $endpoint = $this->baseURL . "/retrieve3ds2Result"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $threeDs2ResultRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ThreeDS2ResultResponse::class); + } +} diff --git a/src/Adyen/Service/Payments/ModificationsApi.php b/src/Adyen/Service/Payments/ModificationsApi.php new file mode 100644 index 000000000..773f156ae --- /dev/null +++ b/src/Adyen/Service/Payments/ModificationsApi.php @@ -0,0 +1,162 @@ +baseURL = $this->createBaseUrl("https://pal-test.adyen.com/pal/servlet/Payment/v68"); + } + + /** + * Change the authorised amount + * + * @param \Adyen\Model\Payments\AdjustAuthorisationRequest $adjustAuthorisationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function adjustAuthorisation(\Adyen\Model\Payments\AdjustAuthorisationRequest $adjustAuthorisationRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/adjustAuthorisation"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $adjustAuthorisationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } + + /** + * Cancel an authorisation + * + * @param \Adyen\Model\Payments\CancelRequest $cancelRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function cancel(\Adyen\Model\Payments\CancelRequest $cancelRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/cancel"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } + + /** + * Cancel or refund a payment + * + * @param \Adyen\Model\Payments\CancelOrRefundRequest $cancelOrRefundRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function cancelOrRefund(\Adyen\Model\Payments\CancelOrRefundRequest $cancelOrRefundRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/cancelOrRefund"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelOrRefundRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } + + /** + * Capture an authorisation + * + * @param \Adyen\Model\Payments\CaptureRequest $captureRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function capture(\Adyen\Model\Payments\CaptureRequest $captureRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/capture"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $captureRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } + + /** + * Create a donation + * + * @param \Adyen\Model\Payments\DonationRequest $donationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function donate(\Adyen\Model\Payments\DonationRequest $donationRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/donate"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $donationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } + + /** + * Refund a captured payment + * + * @param \Adyen\Model\Payments\RefundRequest $refundRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function refund(\Adyen\Model\Payments\RefundRequest $refundRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/refund"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $refundRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } + + /** + * Cancel an authorisation using your reference + * + * @param \Adyen\Model\Payments\TechnicalCancelRequest $technicalCancelRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function technicalCancel(\Adyen\Model\Payments\TechnicalCancelRequest $technicalCancelRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/technicalCancel"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $technicalCancelRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } + + /** + * Cancel an in-person refund + * + * @param \Adyen\Model\Payments\VoidPendingRefundRequest $voidPendingRefundRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Payments\ModificationResult + * @throws AdyenException + */ + public function voidPendingRefund(\Adyen\Model\Payments\VoidPendingRefundRequest $voidPendingRefundRequest, array $requestOptions = null): \Adyen\Model\Payments\ModificationResult + { + $endpoint = $this->baseURL . "/voidPendingRefund"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $voidPendingRefundRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Payments\ModificationResult::class); + } +} diff --git a/templates/partial_header.mustache b/templates/partial_header.mustache index 8c135f042..0b64df089 100644 --- a/templates/partial_header.mustache +++ b/templates/partial_header.mustache @@ -3,10 +3,6 @@ * {{{.}}} * {{/appName}} - {{#appDescription}} - * {{{.}}} - * - {{/appDescription}} {{#version}} * The version of the OpenAPI document: {{{.}}} {{/version}} diff --git a/tests/Resources/ModelBasedPayments/adjust-auth.json b/tests/Resources/ModelBasedPayments/adjust-auth.json new file mode 100644 index 000000000..90df28db8 --- /dev/null +++ b/tests/Resources/ModelBasedPayments/adjust-auth.json @@ -0,0 +1,4 @@ +{ + "pspReference": "851617892360718D", + "response": "[adjustAuthorisation-received]" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedPayments/authorise-success.json b/tests/Resources/ModelBasedPayments/authorise-success.json new file mode 100644 index 000000000..266356e62 --- /dev/null +++ b/tests/Resources/ModelBasedPayments/authorise-success.json @@ -0,0 +1,29 @@ +{ + "additionalData": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "authCode": "string", + "dccAmount": { + "currency": "str", + "value": 0 + }, + "dccSignature": "string", + "fraudResult": { + "accountScore": 0, + "results": [ + { + "accountScore": 0, + "checkId": 0, + "name": "string" + } + ] + }, + "issuerUrl": "string", + "md": "string", + "paRequest": "string", + "pspReference": "string", + "refusalReason": "string", + "resultCode": "AuthenticationFinished" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedPayments/authorise3d-success.json b/tests/Resources/ModelBasedPayments/authorise3d-success.json new file mode 100644 index 000000000..266356e62 --- /dev/null +++ b/tests/Resources/ModelBasedPayments/authorise3d-success.json @@ -0,0 +1,29 @@ +{ + "additionalData": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "authCode": "string", + "dccAmount": { + "currency": "str", + "value": 0 + }, + "dccSignature": "string", + "fraudResult": { + "accountScore": 0, + "results": [ + { + "accountScore": 0, + "checkId": 0, + "name": "string" + } + ] + }, + "issuerUrl": "string", + "md": "string", + "paRequest": "string", + "pspReference": "string", + "refusalReason": "string", + "resultCode": "AuthenticationFinished" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedPayments/authorise3ds2-success.json b/tests/Resources/ModelBasedPayments/authorise3ds2-success.json new file mode 100644 index 000000000..266356e62 --- /dev/null +++ b/tests/Resources/ModelBasedPayments/authorise3ds2-success.json @@ -0,0 +1,29 @@ +{ + "additionalData": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "authCode": "string", + "dccAmount": { + "currency": "str", + "value": 0 + }, + "dccSignature": "string", + "fraudResult": { + "accountScore": 0, + "results": [ + { + "accountScore": 0, + "checkId": 0, + "name": "string" + } + ] + }, + "issuerUrl": "string", + "md": "string", + "paRequest": "string", + "pspReference": "string", + "refusalReason": "string", + "resultCode": "AuthenticationFinished" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedPayments/cancel.json b/tests/Resources/ModelBasedPayments/cancel.json new file mode 100644 index 000000000..787957cfa --- /dev/null +++ b/tests/Resources/ModelBasedPayments/cancel.json @@ -0,0 +1,9 @@ +{ + "additionalData": { + "additionalProp1": "string", + "additionalProp2": "string", + "additionalProp3": "string" + }, + "pspReference": "string", + "response": "[capture-received]" +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedPayments/connected-terminals.json b/tests/Resources/ModelBasedPayments/connected-terminals.json new file mode 100644 index 000000000..9953895a9 --- /dev/null +++ b/tests/Resources/ModelBasedPayments/connected-terminals.json @@ -0,0 +1,9 @@ +{ + "uniqueTerminalIds" : [ + "MX915-284251016", + "MX925-260390740", + "V400m-324688136", + "V400m-324688178", + "V400m-324688181" + ] +} \ No newline at end of file diff --git a/tests/Resources/ModelBasedPayments/invalid-merchant-account.json b/tests/Resources/ModelBasedPayments/invalid-merchant-account.json new file mode 100644 index 000000000..28afc9887 --- /dev/null +++ b/tests/Resources/ModelBasedPayments/invalid-merchant-account.json @@ -0,0 +1,6 @@ +{ + "status": 403, + "errorCode": "901", + "message": "Invalid Merchant Account", + "errorType": "security" +} \ No newline at end of file diff --git a/tests/Unit/ModelBasedPaymentsTest.php b/tests/Unit/ModelBasedPaymentsTest.php new file mode 100644 index 000000000..5d4dc787c --- /dev/null +++ b/tests/Unit/ModelBasedPaymentsTest.php @@ -0,0 +1,119 @@ +createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new GeneralApi($client); + + $result = $service->authorise(new PaymentRequest()); + + $this->assertArrayHasKey('resultCode', (array)$result->jsonSerialize()); + $this->assertEquals('AuthenticationFinished', $result->getResultCode()); + $this->assertEquals('string', $result->getAuthCode()); + } + + public static function successAuthoriseProvider() + { + return array( + array('tests/Resources/ModelBasedPayments/authorise-success.json', 200), + ); + } + + /** + * @dataProvider successAuthoriseProvider3d + */ + public function testAuthorise3dSuccess($jsonFile, $httpStatus) + { + // create client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new GeneralApi($client); + + $result = $service->authorise3d(new PaymentRequest3d()); + + $this->assertArrayHasKey('resultCode', (array)$result->jsonSerialize()); + $this->assertEquals('AuthenticationFinished', $result->getResultCode()); + } + + public static function successAuthoriseProvider3d() + { + return array( + array('tests/Resources/ModelBasedPayments/authorise3d-success.json', 200), + ); + } + + /** + * @dataProvider successAuthoriseProvider3ds2 + */ + public function testAuthorise3ds2Success($jsonFile, $httpStatus) + { + // create client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new GeneralApi($client); + + $result = $service->authorise3ds2(new PaymentRequest3ds2()); + + $this->assertArrayHasKey('resultCode', (array)$result->jsonSerialize()); + $this->assertEquals('AuthenticationFinished', $result->getResultCode()); + } + + public static function successAuthoriseProvider3ds2() + { + return array( + array('tests/Resources/ModelBasedPayments/authorise3ds2-success.json', 200), + ); + } + + public function testAdjustAuthorisation() + { + // create client + $client = $this->createMockClient('tests/Resources/ModelBasedPayments/adjust-auth.json', 200); + + // initialize service + $service = new ModificationsApi($client); + + $result = $service->adjustAuthorisation(new AdjustAuthorisationRequest()); + + $this->assertArrayHasKey('pspReference', (array)$result->jsonSerialize()); + $this->assertEquals('[adjustAuthorisation-received]', $result->getResponse()); + } + + public function testCancel() + { + // create client + $client = $this->createMockClient('tests/Resources/ModelBasedPayments/cancel.json', 200); + + // initialize service + $service = new ModificationsApi($client); + + $result = $service->cancel(new CancelRequest()); + + $this->assertArrayHasKey('additionalData', (array)$result->jsonSerialize()); + $this->assertEquals('[capture-received]', $result->getResponse()); + } +} From f913d3024145c7284065ad2d71bf9968c46cfbd9 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 7 Apr 2023 11:02:39 +0200 Subject: [PATCH 13/33] [ITT-405] Model Based Management Endpoints (#468) * new models/CI * generate management * UT and codesniffer * merge main and generate again * recover sonar.properties file * remove long description from service --- .../Model/Management/AdditionalSettings.php | 419 ++++++ .../Management/AdditionalSettingsResponse.php | 453 ++++++ src/Adyen/Model/Management/Address.php | 589 ++++++++ src/Adyen/Model/Management/AllowedOrigin.php | 456 ++++++ .../Management/AllowedOriginsResponse.php | 385 +++++ src/Adyen/Model/Management/Amount.php | 425 ++++++ src/Adyen/Model/Management/AndroidApp.php | 593 ++++++++ .../Model/Management/AndroidAppsResponse.php | 385 +++++ .../Model/Management/AndroidCertificate.php | 592 ++++++++ .../AndroidCertificatesResponse.php | 385 +++++ src/Adyen/Model/Management/ApiCredential.php | 675 +++++++++ .../Model/Management/ApiCredentialLinks.php | 558 ++++++++ src/Adyen/Model/Management/ApplePayInfo.php | 385 +++++ src/Adyen/Model/Management/BcmcInfo.php | 385 +++++ .../Management/BillingEntitiesResponse.php | 385 +++++ src/Adyen/Model/Management/BillingEntity.php | 521 +++++++ .../Model/Management/CardholderReceipt.php | 385 +++++ .../Model/Management/CartesBancairesInfo.php | 388 +++++ src/Adyen/Model/Management/Company.php | 589 ++++++++ .../Model/Management/CompanyApiCredential.php | 709 ++++++++++ src/Adyen/Model/Management/CompanyLinks.php | 490 +++++++ src/Adyen/Model/Management/CompanyUser.php | 740 ++++++++++ src/Adyen/Model/Management/Configuration.php | 459 ++++++ src/Adyen/Model/Management/Connectivity.php | 418 ++++++ src/Adyen/Model/Management/Contact.php | 521 +++++++ .../Management/CreateAllowedOriginRequest.php | 456 ++++++ .../CreateApiCredentialResponse.php | 749 ++++++++++ .../CreateCompanyApiCredentialRequest.php | 487 +++++++ .../CreateCompanyApiCredentialResponse.php | 786 ++++++++++ .../Management/CreateCompanyUserRequest.php | 632 +++++++++ .../Management/CreateCompanyUserResponse.php | 740 ++++++++++ .../CreateCompanyWebhookRequest.php | 1061 ++++++++++++++ .../CreateMerchantApiCredentialRequest.php | 453 ++++++ .../Management/CreateMerchantRequest.php | 592 ++++++++ .../Management/CreateMerchantResponse.php | 589 ++++++++ .../Management/CreateMerchantUserRequest.php | 598 ++++++++ .../CreateMerchantWebhookRequest.php | 952 +++++++++++++ .../Model/Management/CreateUserResponse.php | 706 +++++++++ src/Adyen/Model/Management/Currency.php | 454 ++++++ .../Model/Management/CustomNotification.php | 589 ++++++++ src/Adyen/Model/Management/DataCenter.php | 419 ++++++ src/Adyen/Model/Management/EventUrl.php | 419 ++++++ .../Management/ExternalTerminalAction.php | 623 ++++++++ src/Adyen/Model/Management/File.php | 425 ++++++ .../Management/GenerateApiKeyResponse.php | 388 +++++ .../Management/GenerateClientKeyResponse.php | 388 +++++ .../Management/GenerateHmacKeyResponse.php | 388 +++++ src/Adyen/Model/Management/GiroPayInfo.php | 388 +++++ src/Adyen/Model/Management/GooglePayInfo.php | 422 ++++++ src/Adyen/Model/Management/Gratuity.php | 487 +++++++ src/Adyen/Model/Management/Hardware.php | 383 +++++ src/Adyen/Model/Management/IdName.php | 419 ++++++ .../Management/InstallAndroidAppDetails.php | 450 ++++++ .../InstallAndroidCertificateDetails.php | 450 ++++++ src/Adyen/Model/Management/InvalidField.php | 462 ++++++ src/Adyen/Model/Management/JSONObject.php | 419 ++++++ src/Adyen/Model/Management/JSONPath.php | 385 +++++ src/Adyen/Model/Management/Key.php | 451 ++++++ src/Adyen/Model/Management/KlarnaInfo.php | 530 +++++++ src/Adyen/Model/Management/Links.php | 388 +++++ src/Adyen/Model/Management/LinksElement.php | 385 +++++ .../ListCompanyApiCredentialsResponse.php | 489 +++++++ .../Model/Management/ListCompanyResponse.php | 489 +++++++ .../Management/ListCompanyUsersResponse.php | 489 +++++++ .../ListExternalTerminalActionsResponse.php | 385 +++++ .../ListMerchantApiCredentialsResponse.php | 489 +++++++ .../Model/Management/ListMerchantResponse.php | 489 +++++++ .../Management/ListMerchantUsersResponse.php | 489 +++++++ .../Model/Management/ListStoresResponse.php | 489 +++++++ .../Management/ListTerminalsResponse.php | 385 +++++ .../Model/Management/ListWebhooksResponse.php | 523 +++++++ src/Adyen/Model/Management/Logo.php | 385 +++++ .../Model/Management/MeApiCredential.php | 743 ++++++++++ .../Model/Management/MealVoucherFRInfo.php | 462 ++++++ src/Adyen/Model/Management/Merchant.php | 827 +++++++++++ src/Adyen/Model/Management/MerchantLinks.php | 490 +++++++ .../Management/MinorUnitsMonetaryValue.php | 417 ++++++ src/Adyen/Model/Management/ModelInterface.php | 93 ++ src/Adyen/Model/Management/Name.php | 425 ++++++ src/Adyen/Model/Management/Name2.php | 419 ++++++ src/Adyen/Model/Management/Nexo.php | 489 +++++++ .../Model/Management/NotificationUrl.php | 419 ++++++ .../Model/Management/ObjectSerializer.php | 318 +++++ .../Model/Management/OfflineProcessing.php | 417 ++++++ src/Adyen/Model/Management/Opi.php | 453 ++++++ src/Adyen/Model/Management/OrderItem.php | 485 +++++++ .../Model/Management/PaginationLinks.php | 530 +++++++ src/Adyen/Model/Management/Passcodes.php | 487 +++++++ src/Adyen/Model/Management/PayAtTable.php | 452 ++++++ src/Adyen/Model/Management/PayPalInfo.php | 459 ++++++ src/Adyen/Model/Management/Payment.php | 385 +++++ src/Adyen/Model/Management/PaymentMethod.php | 1173 +++++++++++++++ .../Management/PaymentMethodResponse.php | 638 +++++++++ .../Management/PaymentMethodSetupInfo.php | 1159 +++++++++++++++ src/Adyen/Model/Management/PayoutSettings.php | 667 +++++++++ .../Management/PayoutSettingsRequest.php | 456 ++++++ .../Management/PayoutSettingsResponse.php | 385 +++++ src/Adyen/Model/Management/Profile.php | 973 +++++++++++++ src/Adyen/Model/Management/ReceiptOptions.php | 419 ++++++ .../Model/Management/ReceiptPrinting.php | 895 ++++++++++++ .../Model/Management/ReleaseUpdateDetails.php | 450 ++++++ .../Management/RequestActivationResponse.php | 419 ++++++ .../Model/Management/RestServiceError.php | 670 +++++++++ .../ScheduleTerminalActionsRequest.php | 487 +++++++ ...uleTerminalActionsRequestActionDetails.php | 488 +++++++ .../ScheduleTerminalActionsResponse.php | 621 ++++++++ src/Adyen/Model/Management/Settings.php | 451 ++++++ .../Model/Management/ShippingLocation.php | 487 +++++++ .../Management/ShippingLocationsResponse.php | 385 +++++ .../Model/Management/ShopperStatement.php | 454 ++++++ src/Adyen/Model/Management/Signature.php | 487 +++++++ src/Adyen/Model/Management/SofortInfo.php | 425 ++++++ src/Adyen/Model/Management/Standalone.php | 419 ++++++ src/Adyen/Model/Management/Store.php | 794 +++++++++++ .../Model/Management/StoreCreationRequest.php | 635 +++++++++ .../StoreCreationWithMerchantCodeRequest.php | 672 +++++++++ src/Adyen/Model/Management/StoreLocation.php | 592 ++++++++ .../Management/StoreSplitConfiguration.php | 419 ++++++ src/Adyen/Model/Management/Surcharge.php | 419 ++++++ src/Adyen/Model/Management/SwishInfo.php | 385 +++++ src/Adyen/Model/Management/Terminal.php | 1099 ++++++++++++++ .../TerminalActionScheduleDetail.php | 419 ++++++ .../Management/TerminalModelsResponse.php | 385 +++++ src/Adyen/Model/Management/TerminalOrder.php | 623 ++++++++ .../Model/Management/TerminalOrderRequest.php | 521 +++++++ .../Management/TerminalOrdersResponse.php | 385 +++++ .../Model/Management/TerminalProduct.php | 521 +++++++ .../Model/Management/TerminalProductPrice.php | 419 ++++++ .../Management/TerminalProductsResponse.php | 385 +++++ .../Model/Management/TerminalSettings.php | 929 ++++++++++++ .../Management/TestCompanyWebhookRequest.php | 453 ++++++ src/Adyen/Model/Management/TestOutput.php | 558 ++++++++ .../Model/Management/TestWebhookRequest.php | 419 ++++++ .../Model/Management/TestWebhookResponse.php | 385 +++++ src/Adyen/Model/Management/Timeouts.php | 383 +++++ .../Management/UninstallAndroidAppDetails.php | 450 ++++++ .../UninstallAndroidCertificateDetails.php | 450 ++++++ .../Model/Management/UpdatableAddress.php | 555 ++++++++ .../UpdateCompanyApiCredentialRequest.php | 521 +++++++ .../Management/UpdateCompanyUserRequest.php | 657 +++++++++ .../UpdateCompanyWebhookRequest.php | 1009 +++++++++++++ .../UpdateMerchantApiCredentialRequest.php | 487 +++++++ .../Management/UpdateMerchantUserRequest.php | 623 ++++++++ .../UpdateMerchantWebhookRequest.php | 906 ++++++++++++ .../Management/UpdatePaymentMethodInfo.php | 555 ++++++++ .../UpdatePayoutSettingsRequest.php | 385 +++++ .../Model/Management/UpdateStoreRequest.php | 590 ++++++++ src/Adyen/Model/Management/Url.php | 487 +++++++ src/Adyen/Model/Management/User.php | 706 +++++++++ src/Adyen/Model/Management/VippsInfo.php | 422 ++++++ src/Adyen/Model/Management/Webhook.php | 1259 +++++++++++++++++ src/Adyen/Model/Management/WebhookLinks.php | 530 +++++++ src/Adyen/Model/Management/WifiProfiles.php | 419 ++++++ .../APICredentialsCompanyLevelApi.php | 106 ++ .../APICredentialsMerchantLevelApi.php | 106 ++ .../Management/APIKeyCompanyLevelApi.php | 58 + .../Management/APIKeyMerchantLevelApi.php | 58 + .../Management/AccountCompanyLevelApi.php | 86 ++ .../Management/AccountMerchantLevelApi.php | 101 ++ .../Management/AccountStoreLevelApi.php | 166 +++ .../AllowedOriginsCompanyLevelApi.php | 108 ++ .../AllowedOriginsMerchantLevelApi.php | 108 ++ .../Management/ClientKeyCompanyLevelApi.php | 58 + .../Management/ClientKeyMerchantLevelApi.php | 58 + .../Service/Management/MyAPICredentialApi.php | 114 ++ .../PaymentMethodsMerchantLevelApi.php | 138 ++ .../PayoutSettingsMerchantLevelApi.php | 121 ++ .../TerminalActionsCompanyLevelApi.php | 103 ++ .../TerminalActionsTerminalLevelApi.php | 57 + .../TerminalOrdersCompanyLevelApi.php | 198 +++ .../TerminalOrdersMerchantLevelApi.php | 198 +++ .../TerminalSettingsCompanyLevelApi.php | 104 ++ .../TerminalSettingsMerchantLevelApi.php | 104 ++ .../TerminalSettingsStoreLevelApi.php | 170 +++ .../TerminalSettingsTerminalLevelApi.php | 104 ++ .../Management/TerminalsTerminalLevelApi.php | 56 + .../Management/UsersCompanyLevelApi.php | 106 ++ .../Management/UsersMerchantLevelApi.php | 106 ++ .../Management/WebhooksCompanyLevelApi.php | 154 ++ .../Management/WebhooksMerchantLevelApi.php | 154 ++ .../get-merchants-success.json | 81 ++ ...rchants-webhooks-generateHmac-success.json | 3 + .../ModelBasedManagement/terminal-logo.json | 3 + tests/Unit/ModelBasedManagementTest.php | 129 ++ 184 files changed, 84109 insertions(+) create mode 100644 src/Adyen/Model/Management/AdditionalSettings.php create mode 100644 src/Adyen/Model/Management/AdditionalSettingsResponse.php create mode 100644 src/Adyen/Model/Management/Address.php create mode 100644 src/Adyen/Model/Management/AllowedOrigin.php create mode 100644 src/Adyen/Model/Management/AllowedOriginsResponse.php create mode 100644 src/Adyen/Model/Management/Amount.php create mode 100644 src/Adyen/Model/Management/AndroidApp.php create mode 100644 src/Adyen/Model/Management/AndroidAppsResponse.php create mode 100644 src/Adyen/Model/Management/AndroidCertificate.php create mode 100644 src/Adyen/Model/Management/AndroidCertificatesResponse.php create mode 100644 src/Adyen/Model/Management/ApiCredential.php create mode 100644 src/Adyen/Model/Management/ApiCredentialLinks.php create mode 100644 src/Adyen/Model/Management/ApplePayInfo.php create mode 100644 src/Adyen/Model/Management/BcmcInfo.php create mode 100644 src/Adyen/Model/Management/BillingEntitiesResponse.php create mode 100644 src/Adyen/Model/Management/BillingEntity.php create mode 100644 src/Adyen/Model/Management/CardholderReceipt.php create mode 100644 src/Adyen/Model/Management/CartesBancairesInfo.php create mode 100644 src/Adyen/Model/Management/Company.php create mode 100644 src/Adyen/Model/Management/CompanyApiCredential.php create mode 100644 src/Adyen/Model/Management/CompanyLinks.php create mode 100644 src/Adyen/Model/Management/CompanyUser.php create mode 100644 src/Adyen/Model/Management/Configuration.php create mode 100644 src/Adyen/Model/Management/Connectivity.php create mode 100644 src/Adyen/Model/Management/Contact.php create mode 100644 src/Adyen/Model/Management/CreateAllowedOriginRequest.php create mode 100644 src/Adyen/Model/Management/CreateApiCredentialResponse.php create mode 100644 src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php create mode 100644 src/Adyen/Model/Management/CreateCompanyApiCredentialResponse.php create mode 100644 src/Adyen/Model/Management/CreateCompanyUserRequest.php create mode 100644 src/Adyen/Model/Management/CreateCompanyUserResponse.php create mode 100644 src/Adyen/Model/Management/CreateCompanyWebhookRequest.php create mode 100644 src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php create mode 100644 src/Adyen/Model/Management/CreateMerchantRequest.php create mode 100644 src/Adyen/Model/Management/CreateMerchantResponse.php create mode 100644 src/Adyen/Model/Management/CreateMerchantUserRequest.php create mode 100644 src/Adyen/Model/Management/CreateMerchantWebhookRequest.php create mode 100644 src/Adyen/Model/Management/CreateUserResponse.php create mode 100644 src/Adyen/Model/Management/Currency.php create mode 100644 src/Adyen/Model/Management/CustomNotification.php create mode 100644 src/Adyen/Model/Management/DataCenter.php create mode 100644 src/Adyen/Model/Management/EventUrl.php create mode 100644 src/Adyen/Model/Management/ExternalTerminalAction.php create mode 100644 src/Adyen/Model/Management/File.php create mode 100644 src/Adyen/Model/Management/GenerateApiKeyResponse.php create mode 100644 src/Adyen/Model/Management/GenerateClientKeyResponse.php create mode 100644 src/Adyen/Model/Management/GenerateHmacKeyResponse.php create mode 100644 src/Adyen/Model/Management/GiroPayInfo.php create mode 100644 src/Adyen/Model/Management/GooglePayInfo.php create mode 100644 src/Adyen/Model/Management/Gratuity.php create mode 100644 src/Adyen/Model/Management/Hardware.php create mode 100644 src/Adyen/Model/Management/IdName.php create mode 100644 src/Adyen/Model/Management/InstallAndroidAppDetails.php create mode 100644 src/Adyen/Model/Management/InstallAndroidCertificateDetails.php create mode 100644 src/Adyen/Model/Management/InvalidField.php create mode 100644 src/Adyen/Model/Management/JSONObject.php create mode 100644 src/Adyen/Model/Management/JSONPath.php create mode 100644 src/Adyen/Model/Management/Key.php create mode 100644 src/Adyen/Model/Management/KlarnaInfo.php create mode 100644 src/Adyen/Model/Management/Links.php create mode 100644 src/Adyen/Model/Management/LinksElement.php create mode 100644 src/Adyen/Model/Management/ListCompanyApiCredentialsResponse.php create mode 100644 src/Adyen/Model/Management/ListCompanyResponse.php create mode 100644 src/Adyen/Model/Management/ListCompanyUsersResponse.php create mode 100644 src/Adyen/Model/Management/ListExternalTerminalActionsResponse.php create mode 100644 src/Adyen/Model/Management/ListMerchantApiCredentialsResponse.php create mode 100644 src/Adyen/Model/Management/ListMerchantResponse.php create mode 100644 src/Adyen/Model/Management/ListMerchantUsersResponse.php create mode 100644 src/Adyen/Model/Management/ListStoresResponse.php create mode 100644 src/Adyen/Model/Management/ListTerminalsResponse.php create mode 100644 src/Adyen/Model/Management/ListWebhooksResponse.php create mode 100644 src/Adyen/Model/Management/Logo.php create mode 100644 src/Adyen/Model/Management/MeApiCredential.php create mode 100644 src/Adyen/Model/Management/MealVoucherFRInfo.php create mode 100644 src/Adyen/Model/Management/Merchant.php create mode 100644 src/Adyen/Model/Management/MerchantLinks.php create mode 100644 src/Adyen/Model/Management/MinorUnitsMonetaryValue.php create mode 100644 src/Adyen/Model/Management/ModelInterface.php create mode 100644 src/Adyen/Model/Management/Name.php create mode 100644 src/Adyen/Model/Management/Name2.php create mode 100644 src/Adyen/Model/Management/Nexo.php create mode 100644 src/Adyen/Model/Management/NotificationUrl.php create mode 100644 src/Adyen/Model/Management/ObjectSerializer.php create mode 100644 src/Adyen/Model/Management/OfflineProcessing.php create mode 100644 src/Adyen/Model/Management/Opi.php create mode 100644 src/Adyen/Model/Management/OrderItem.php create mode 100644 src/Adyen/Model/Management/PaginationLinks.php create mode 100644 src/Adyen/Model/Management/Passcodes.php create mode 100644 src/Adyen/Model/Management/PayAtTable.php create mode 100644 src/Adyen/Model/Management/PayPalInfo.php create mode 100644 src/Adyen/Model/Management/Payment.php create mode 100644 src/Adyen/Model/Management/PaymentMethod.php create mode 100644 src/Adyen/Model/Management/PaymentMethodResponse.php create mode 100644 src/Adyen/Model/Management/PaymentMethodSetupInfo.php create mode 100644 src/Adyen/Model/Management/PayoutSettings.php create mode 100644 src/Adyen/Model/Management/PayoutSettingsRequest.php create mode 100644 src/Adyen/Model/Management/PayoutSettingsResponse.php create mode 100644 src/Adyen/Model/Management/Profile.php create mode 100644 src/Adyen/Model/Management/ReceiptOptions.php create mode 100644 src/Adyen/Model/Management/ReceiptPrinting.php create mode 100644 src/Adyen/Model/Management/ReleaseUpdateDetails.php create mode 100644 src/Adyen/Model/Management/RequestActivationResponse.php create mode 100644 src/Adyen/Model/Management/RestServiceError.php create mode 100644 src/Adyen/Model/Management/ScheduleTerminalActionsRequest.php create mode 100644 src/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.php create mode 100644 src/Adyen/Model/Management/ScheduleTerminalActionsResponse.php create mode 100644 src/Adyen/Model/Management/Settings.php create mode 100644 src/Adyen/Model/Management/ShippingLocation.php create mode 100644 src/Adyen/Model/Management/ShippingLocationsResponse.php create mode 100644 src/Adyen/Model/Management/ShopperStatement.php create mode 100644 src/Adyen/Model/Management/Signature.php create mode 100644 src/Adyen/Model/Management/SofortInfo.php create mode 100644 src/Adyen/Model/Management/Standalone.php create mode 100644 src/Adyen/Model/Management/Store.php create mode 100644 src/Adyen/Model/Management/StoreCreationRequest.php create mode 100644 src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php create mode 100644 src/Adyen/Model/Management/StoreLocation.php create mode 100644 src/Adyen/Model/Management/StoreSplitConfiguration.php create mode 100644 src/Adyen/Model/Management/Surcharge.php create mode 100644 src/Adyen/Model/Management/SwishInfo.php create mode 100644 src/Adyen/Model/Management/Terminal.php create mode 100644 src/Adyen/Model/Management/TerminalActionScheduleDetail.php create mode 100644 src/Adyen/Model/Management/TerminalModelsResponse.php create mode 100644 src/Adyen/Model/Management/TerminalOrder.php create mode 100644 src/Adyen/Model/Management/TerminalOrderRequest.php create mode 100644 src/Adyen/Model/Management/TerminalOrdersResponse.php create mode 100644 src/Adyen/Model/Management/TerminalProduct.php create mode 100644 src/Adyen/Model/Management/TerminalProductPrice.php create mode 100644 src/Adyen/Model/Management/TerminalProductsResponse.php create mode 100644 src/Adyen/Model/Management/TerminalSettings.php create mode 100644 src/Adyen/Model/Management/TestCompanyWebhookRequest.php create mode 100644 src/Adyen/Model/Management/TestOutput.php create mode 100644 src/Adyen/Model/Management/TestWebhookRequest.php create mode 100644 src/Adyen/Model/Management/TestWebhookResponse.php create mode 100644 src/Adyen/Model/Management/Timeouts.php create mode 100644 src/Adyen/Model/Management/UninstallAndroidAppDetails.php create mode 100644 src/Adyen/Model/Management/UninstallAndroidCertificateDetails.php create mode 100644 src/Adyen/Model/Management/UpdatableAddress.php create mode 100644 src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php create mode 100644 src/Adyen/Model/Management/UpdateCompanyUserRequest.php create mode 100644 src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php create mode 100644 src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php create mode 100644 src/Adyen/Model/Management/UpdateMerchantUserRequest.php create mode 100644 src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php create mode 100644 src/Adyen/Model/Management/UpdatePaymentMethodInfo.php create mode 100644 src/Adyen/Model/Management/UpdatePayoutSettingsRequest.php create mode 100644 src/Adyen/Model/Management/UpdateStoreRequest.php create mode 100644 src/Adyen/Model/Management/Url.php create mode 100644 src/Adyen/Model/Management/User.php create mode 100644 src/Adyen/Model/Management/VippsInfo.php create mode 100644 src/Adyen/Model/Management/Webhook.php create mode 100644 src/Adyen/Model/Management/WebhookLinks.php create mode 100644 src/Adyen/Model/Management/WifiProfiles.php create mode 100644 src/Adyen/Service/Management/APICredentialsCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/APICredentialsMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/APIKeyCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/APIKeyMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/AccountCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/AccountMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/AccountStoreLevelApi.php create mode 100644 src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/ClientKeyCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/ClientKeyMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/MyAPICredentialApi.php create mode 100644 src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalActionsTerminalLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalOrdersCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalOrdersMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalSettingsCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalSettingsMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalSettingsStoreLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalSettingsTerminalLevelApi.php create mode 100644 src/Adyen/Service/Management/TerminalsTerminalLevelApi.php create mode 100644 src/Adyen/Service/Management/UsersCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/UsersMerchantLevelApi.php create mode 100644 src/Adyen/Service/Management/WebhooksCompanyLevelApi.php create mode 100644 src/Adyen/Service/Management/WebhooksMerchantLevelApi.php create mode 100644 tests/Resources/ModelBasedManagement/get-merchants-success.json create mode 100644 tests/Resources/ModelBasedManagement/post-merchants-webhooks-generateHmac-success.json create mode 100644 tests/Resources/ModelBasedManagement/terminal-logo.json create mode 100644 tests/Unit/ModelBasedManagementTest.php diff --git a/src/Adyen/Model/Management/AdditionalSettings.php b/src/Adyen/Model/Management/AdditionalSettings.php new file mode 100644 index 000000000..2a850fa8b --- /dev/null +++ b/src/Adyen/Model/Management/AdditionalSettings.php @@ -0,0 +1,419 @@ + + */ +class AdditionalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'include_event_codes' => 'string[]', + 'properties' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'include_event_codes' => null, + 'properties' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'include_event_codes' => false, + 'properties' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'include_event_codes' => 'includeEventCodes', + 'properties' => 'properties' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'include_event_codes' => 'setIncludeEventCodes', + 'properties' => 'setProperties' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'include_event_codes' => 'getIncludeEventCodes', + 'properties' => 'getProperties' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('include_event_codes', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets include_event_codes + * + * @return string[]|null + */ + public function getIncludeEventCodes() + { + return $this->container['include_event_codes']; + } + + /** + * Sets include_event_codes + * + * @param string[]|null $include_event_codes Object containing list of event codes for which the notifcation will be sent. + * + * @return self + */ + public function setIncludeEventCodes($include_event_codes) + { + if (is_null($include_event_codes)) { + throw new \InvalidArgumentException('non-nullable include_event_codes cannot be null'); + } + $this->container['include_event_codes'] = $include_event_codes; + + return $this; + } + + /** + * Gets properties + * + * @return array|null + */ + public function getProperties() + { + return $this->container['properties']; + } + + /** + * Sets properties + * + * @param array|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. + * + * @return self + */ + public function setProperties($properties) + { + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); + } + $this->container['properties'] = $properties; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AdditionalSettingsResponse.php b/src/Adyen/Model/Management/AdditionalSettingsResponse.php new file mode 100644 index 000000000..5a8bda496 --- /dev/null +++ b/src/Adyen/Model/Management/AdditionalSettingsResponse.php @@ -0,0 +1,453 @@ + + */ +class AdditionalSettingsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AdditionalSettingsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'exclude_event_codes' => 'string[]', + 'include_event_codes' => 'string[]', + 'properties' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'exclude_event_codes' => null, + 'include_event_codes' => null, + 'properties' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'exclude_event_codes' => false, + 'include_event_codes' => false, + 'properties' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'exclude_event_codes' => 'excludeEventCodes', + 'include_event_codes' => 'includeEventCodes', + 'properties' => 'properties' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'exclude_event_codes' => 'setExcludeEventCodes', + 'include_event_codes' => 'setIncludeEventCodes', + 'properties' => 'setProperties' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'exclude_event_codes' => 'getExcludeEventCodes', + 'include_event_codes' => 'getIncludeEventCodes', + 'properties' => 'getProperties' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('exclude_event_codes', $data ?? [], null); + $this->setIfExists('include_event_codes', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets exclude_event_codes + * + * @return string[]|null + */ + public function getExcludeEventCodes() + { + return $this->container['exclude_event_codes']; + } + + /** + * Sets exclude_event_codes + * + * @param string[]|null $exclude_event_codes Object containing list of event codes for which the notifcation will not be sent. + * + * @return self + */ + public function setExcludeEventCodes($exclude_event_codes) + { + if (is_null($exclude_event_codes)) { + throw new \InvalidArgumentException('non-nullable exclude_event_codes cannot be null'); + } + $this->container['exclude_event_codes'] = $exclude_event_codes; + + return $this; + } + + /** + * Gets include_event_codes + * + * @return string[]|null + */ + public function getIncludeEventCodes() + { + return $this->container['include_event_codes']; + } + + /** + * Sets include_event_codes + * + * @param string[]|null $include_event_codes Object containing list of event codes for which the notifcation will be sent. + * + * @return self + */ + public function setIncludeEventCodes($include_event_codes) + { + if (is_null($include_event_codes)) { + throw new \InvalidArgumentException('non-nullable include_event_codes cannot be null'); + } + $this->container['include_event_codes'] = $include_event_codes; + + return $this; + } + + /** + * Gets properties + * + * @return array|null + */ + public function getProperties() + { + return $this->container['properties']; + } + + /** + * Sets properties + * + * @param array|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. + * + * @return self + */ + public function setProperties($properties) + { + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); + } + $this->container['properties'] = $properties; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Address.php b/src/Adyen/Model/Management/Address.php new file mode 100644 index 000000000..f7d88d45b --- /dev/null +++ b/src/Adyen/Model/Management/Address.php @@ -0,0 +1,589 @@ + + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'company_name' => 'string', + 'country' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string', + 'street_address' => 'string', + 'street_address2' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'company_name' => null, + 'country' => null, + 'postal_code' => null, + 'state_or_province' => null, + 'street_address' => null, + 'street_address2' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'company_name' => false, + 'country' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street_address' => false, + 'street_address2' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'company_name' => 'companyName', + 'country' => 'country', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince', + 'street_address' => 'streetAddress', + 'street_address2' => 'streetAddress2' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'company_name' => 'setCompanyName', + 'country' => 'setCountry', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince', + 'street_address' => 'setStreetAddress', + 'street_address2' => 'setStreetAddress2' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'company_name' => 'getCompanyName', + 'country' => 'getCountry', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince', + 'street_address' => 'getStreetAddress', + 'street_address2' => 'getStreetAddress2' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + $this->setIfExists('street_address', $data ?? [], null); + $this->setIfExists('street_address2', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets company_name + * + * @return string|null + */ + public function getCompanyName() + { + return $this->container['company_name']; + } + + /** + * Sets company_name + * + * @param string|null $company_name The name of the company. + * + * @return self + */ + public function setCompanyName($company_name) + { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } + $this->container['company_name'] = $company_name; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The two-letter country code, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code The postal code. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The state or province as defined in [ISO 3166-2](https://www.iso.org/standard/72483.html). For example, **ON** for Ontario, Canada. Applicable for the following countries: - Australia - Brazil - Canada - India - Mexico - New Zealand - United States + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + + /** + * Gets street_address + * + * @return string|null + */ + public function getStreetAddress() + { + return $this->container['street_address']; + } + + /** + * Sets street_address + * + * @param string|null $street_address The name of the street, and the house or building number. + * + * @return self + */ + public function setStreetAddress($street_address) + { + if (is_null($street_address)) { + throw new \InvalidArgumentException('non-nullable street_address cannot be null'); + } + $this->container['street_address'] = $street_address; + + return $this; + } + + /** + * Gets street_address2 + * + * @return string|null + */ + public function getStreetAddress2() + { + return $this->container['street_address2']; + } + + /** + * Sets street_address2 + * + * @param string|null $street_address2 Additional address details, if any. + * + * @return self + */ + public function setStreetAddress2($street_address2) + { + if (is_null($street_address2)) { + throw new \InvalidArgumentException('non-nullable street_address2 cannot be null'); + } + $this->container['street_address2'] = $street_address2; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AllowedOrigin.php b/src/Adyen/Model/Management/AllowedOrigin.php new file mode 100644 index 000000000..d84239177 --- /dev/null +++ b/src/Adyen/Model/Management/AllowedOrigin.php @@ -0,0 +1,456 @@ + + */ +class AllowedOrigin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AllowedOrigin'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\Links', + 'domain' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'domain' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'domain' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'domain' => 'domain', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'domain' => 'setDomain', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'domain' => 'getDomain', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('domain', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' 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 _links + * + * @return \Adyen\Model\Management\Links|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\Links|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Domain of the allowed origin. + * + * @return self + */ + public function setDomain($domain) + { + if (is_null($domain)) { + throw new \InvalidArgumentException('non-nullable domain cannot be null'); + } + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Unique identifier of the allowed origin. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AllowedOriginsResponse.php b/src/Adyen/Model/Management/AllowedOriginsResponse.php new file mode 100644 index 000000000..3c6c5559c --- /dev/null +++ b/src/Adyen/Model/Management/AllowedOriginsResponse.php @@ -0,0 +1,385 @@ + + */ +class AllowedOriginsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AllowedOriginsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\AllowedOrigin[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\AllowedOrigin[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\AllowedOrigin[]|null $data List of allowed origins. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Amount.php b/src/Adyen/Model/Management/Amount.php new file mode 100644 index 000000000..9e20d2047 --- /dev/null +++ b/src/Adyen/Model/Management/Amount.php @@ -0,0 +1,425 @@ + + */ +class Amount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Amount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AndroidApp.php b/src/Adyen/Model/Management/AndroidApp.php new file mode 100644 index 000000000..7aa025fc5 --- /dev/null +++ b/src/Adyen/Model/Management/AndroidApp.php @@ -0,0 +1,593 @@ + + */ +class AndroidApp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AndroidApp'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'label' => 'string', + 'package_name' => 'string', + 'status' => 'string', + 'version_code' => 'int', + 'version_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'label' => null, + 'package_name' => null, + 'status' => null, + 'version_code' => 'int32', + 'version_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'label' => false, + 'package_name' => false, + 'status' => false, + 'version_code' => true, + 'version_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'label' => 'label', + 'package_name' => 'packageName', + 'status' => 'status', + 'version_code' => 'versionCode', + 'version_name' => 'versionName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'label' => 'setLabel', + 'package_name' => 'setPackageName', + 'status' => 'setStatus', + 'version_code' => 'setVersionCode', + 'version_name' => 'setVersionName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'label' => 'getLabel', + 'package_name' => 'getPackageName', + 'status' => 'getStatus', + 'version_code' => 'getVersionCode', + 'version_name' => 'getVersionName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('package_name', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('version_code', $data ?? [], null); + $this->setIfExists('version_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description that was provided when uploading the app. The description is not shown on the terminal. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the app. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The app name that is shown on the terminal. + * + * @return self + */ + public function setLabel($label) + { + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); + } + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets package_name + * + * @return string|null + */ + public function getPackageName() + { + return $this->container['package_name']; + } + + /** + * Sets package_name + * + * @param string|null $package_name The package name of the app. + * + * @return self + */ + public function setPackageName($package_name) + { + if (is_null($package_name)) { + throw new \InvalidArgumentException('non-nullable package_name cannot be null'); + } + $this->container['package_name'] = $package_name; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the app. Possible values: * `processing`: The app is being signed and converted to a format that the terminal can handle. * `error`: Something went wrong. Check that the app matches the [requirements](https://docs.adyen.com/point-of-sale/android-terminals/app-requirements). * `invalid`: There is something wrong with the APK file of the app. * `ready`: The app has been signed and converted. * `archived`: The app is no longer available. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets version_code + * + * @return int|null + */ + public function getVersionCode() + { + return $this->container['version_code']; + } + + /** + * Sets version_code + * + * @param int|null $version_code The internal version number of the app. + * + * @return self + */ + public function setVersionCode($version_code) + { + // Do nothing for nullable integers + $this->container['version_code'] = $version_code; + + return $this; + } + + /** + * Gets version_name + * + * @return string|null + */ + public function getVersionName() + { + return $this->container['version_name']; + } + + /** + * Sets version_name + * + * @param string|null $version_name The app version number that is shown on the terminal. + * + * @return self + */ + public function setVersionName($version_name) + { + if (is_null($version_name)) { + throw new \InvalidArgumentException('non-nullable version_name cannot be null'); + } + $this->container['version_name'] = $version_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 + ); + } +} diff --git a/src/Adyen/Model/Management/AndroidAppsResponse.php b/src/Adyen/Model/Management/AndroidAppsResponse.php new file mode 100644 index 000000000..52a25eada --- /dev/null +++ b/src/Adyen/Model/Management/AndroidAppsResponse.php @@ -0,0 +1,385 @@ + + */ +class AndroidAppsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AndroidAppsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\AndroidApp[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\AndroidApp[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\AndroidApp[]|null $data Apps uploaded for Android payment terminals. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AndroidCertificate.php b/src/Adyen/Model/Management/AndroidCertificate.php new file mode 100644 index 000000000..9e26a649a --- /dev/null +++ b/src/Adyen/Model/Management/AndroidCertificate.php @@ -0,0 +1,592 @@ + + */ +class AndroidCertificate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AndroidCertificate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'extension' => 'string', + 'id' => 'string', + 'name' => 'string', + 'not_after' => '\DateTime', + 'not_before' => '\DateTime', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'extension' => null, + 'id' => null, + 'name' => null, + 'not_after' => 'date-time', + 'not_before' => 'date-time', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'extension' => false, + 'id' => false, + 'name' => false, + 'not_after' => false, + 'not_before' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'extension' => 'extension', + 'id' => 'id', + 'name' => 'name', + 'not_after' => 'notAfter', + 'not_before' => 'notBefore', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'extension' => 'setExtension', + 'id' => 'setId', + 'name' => 'setName', + 'not_after' => 'setNotAfter', + 'not_before' => 'setNotBefore', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'extension' => 'getExtension', + 'id' => 'getId', + 'name' => 'getName', + 'not_after' => 'getNotAfter', + 'not_before' => 'getNotBefore', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('extension', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('not_after', $data ?? [], null); + $this->setIfExists('not_before', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description that was provided when uploading the certificate. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets extension + * + * @return string|null + */ + public function getExtension() + { + return $this->container['extension']; + } + + /** + * Sets extension + * + * @param string|null $extension The file format of the certificate, as indicated by the file extension. For example, **.cert** or **.pem**. + * + * @return self + */ + public function setExtension($extension) + { + if (is_null($extension)) { + throw new \InvalidArgumentException('non-nullable extension cannot be null'); + } + $this->container['extension'] = $extension; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the certificate. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The file name of the certificate. For example, **mycert**. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets not_after + * + * @return \DateTime|null + */ + public function getNotAfter() + { + return $this->container['not_after']; + } + + /** + * Sets not_after + * + * @param \DateTime|null $not_after The date when the certificate stops to be valid. + * + * @return self + */ + public function setNotAfter($not_after) + { + if (is_null($not_after)) { + throw new \InvalidArgumentException('non-nullable not_after cannot be null'); + } + $this->container['not_after'] = $not_after; + + return $this; + } + + /** + * Gets not_before + * + * @return \DateTime|null + */ + public function getNotBefore() + { + return $this->container['not_before']; + } + + /** + * Sets not_before + * + * @param \DateTime|null $not_before The date when the certificate starts to be valid. + * + * @return self + */ + public function setNotBefore($not_before) + { + if (is_null($not_before)) { + throw new \InvalidArgumentException('non-nullable not_before cannot be null'); + } + $this->container['not_before'] = $not_before; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the certificate. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/AndroidCertificatesResponse.php b/src/Adyen/Model/Management/AndroidCertificatesResponse.php new file mode 100644 index 000000000..e4de2302c --- /dev/null +++ b/src/Adyen/Model/Management/AndroidCertificatesResponse.php @@ -0,0 +1,385 @@ + + */ +class AndroidCertificatesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AndroidCertificatesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\AndroidCertificate[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\AndroidCertificate[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\AndroidCertificate[]|null $data Uploaded Android certificates for Android payment terminals. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ApiCredential.php b/src/Adyen/Model/Management/ApiCredential.php new file mode 100644 index 000000000..319833a98 --- /dev/null +++ b/src/Adyen/Model/Management/ApiCredential.php @@ -0,0 +1,675 @@ + + */ +class ApiCredential implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApiCredential'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\ApiCredentialLinks', + 'active' => 'bool', + 'allowed_ip_addresses' => 'string[]', + 'allowed_origins' => '\Adyen\Model\Management\AllowedOrigin[]', + 'client_key' => 'string', + 'description' => 'string', + 'id' => 'string', + 'roles' => 'string[]', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'active' => null, + 'allowed_ip_addresses' => null, + 'allowed_origins' => null, + 'client_key' => null, + 'description' => null, + 'id' => null, + 'roles' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'active' => false, + 'allowed_ip_addresses' => false, + 'allowed_origins' => false, + 'client_key' => false, + 'description' => false, + 'id' => false, + 'roles' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'active' => 'active', + 'allowed_ip_addresses' => 'allowedIpAddresses', + 'allowed_origins' => 'allowedOrigins', + 'client_key' => 'clientKey', + 'description' => 'description', + 'id' => 'id', + 'roles' => 'roles', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'active' => 'setActive', + 'allowed_ip_addresses' => 'setAllowedIpAddresses', + 'allowed_origins' => 'setAllowedOrigins', + 'client_key' => 'setClientKey', + 'description' => 'setDescription', + 'id' => 'setId', + 'roles' => 'setRoles', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'active' => 'getActive', + 'allowed_ip_addresses' => 'getAllowedIpAddresses', + 'allowed_origins' => 'getAllowedOrigins', + 'client_key' => 'getClientKey', + 'description' => 'getDescription', + 'id' => 'getId', + 'roles' => 'getRoles', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('allowed_ip_addresses', $data ?? [], null); + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('client_key', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['allowed_ip_addresses'] === null) { + $invalidProperties[] = "'allowed_ip_addresses' can't be null"; + } + if ($this->container['client_key'] === null) { + $invalidProperties[] = "'client_key' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\ApiCredentialLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\ApiCredentialLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the API credential is enabled. Must be set to **true** to use the credential in your integration. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets allowed_ip_addresses + * + * @return string[] + */ + public function getAllowedIpAddresses() + { + return $this->container['allowed_ip_addresses']; + } + + /** + * Sets allowed_ip_addresses + * + * @param string[] $allowed_ip_addresses List of IP addresses from which your client can make requests. If the list is empty, we allow requests from any IP. If the list is not empty and we get a request from an IP which is not on the list, you get a security error. + * + * @return self + */ + public function setAllowedIpAddresses($allowed_ip_addresses) + { + if (is_null($allowed_ip_addresses)) { + throw new \InvalidArgumentException('non-nullable allowed_ip_addresses cannot be null'); + } + $this->container['allowed_ip_addresses'] = $allowed_ip_addresses; + + return $this; + } + + /** + * Gets allowed_origins + * + * @return \Adyen\Model\Management\AllowedOrigin[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param \Adyen\Model\Management\AllowedOrigin[]|null $allowed_origins List containing the [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) linked to the API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets client_key + * + * @return string + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string $client_key Public key used for [client-side authentication](https://docs.adyen.com/development-resources/client-side-authentication). The client key is required for Drop-in and Components integrations. + * + * @return self + */ + public function setClientKey($client_key) + { + if (is_null($client_key)) { + throw new \InvalidArgumentException('non-nullable client_key cannot be null'); + } + $this->container['client_key'] = $client_key; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of the API credential. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The name of the [API credential](https://docs.adyen.com/development-resources/api-credentials), for example **ws@Company.TestCompany**. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ApiCredentialLinks.php b/src/Adyen/Model/Management/ApiCredentialLinks.php new file mode 100644 index 000000000..36a8f10f5 --- /dev/null +++ b/src/Adyen/Model/Management/ApiCredentialLinks.php @@ -0,0 +1,558 @@ + + */ +class ApiCredentialLinks implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApiCredentialLinks'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed_origins' => '\Adyen\Model\Management\LinksElement', + 'company' => '\Adyen\Model\Management\LinksElement', + 'generate_api_key' => '\Adyen\Model\Management\LinksElement', + 'generate_client_key' => '\Adyen\Model\Management\LinksElement', + 'merchant' => '\Adyen\Model\Management\LinksElement', + 'self' => '\Adyen\Model\Management\LinksElement' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed_origins' => null, + 'company' => null, + 'generate_api_key' => null, + 'generate_client_key' => null, + 'merchant' => null, + 'self' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed_origins' => false, + 'company' => false, + 'generate_api_key' => false, + 'generate_client_key' => false, + 'merchant' => false, + 'self' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_origins' => 'allowedOrigins', + 'company' => 'company', + 'generate_api_key' => 'generateApiKey', + 'generate_client_key' => 'generateClientKey', + 'merchant' => 'merchant', + 'self' => 'self' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_origins' => 'setAllowedOrigins', + 'company' => 'setCompany', + 'generate_api_key' => 'setGenerateApiKey', + 'generate_client_key' => 'setGenerateClientKey', + 'merchant' => 'setMerchant', + 'self' => 'setSelf' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_origins' => 'getAllowedOrigins', + 'company' => 'getCompany', + 'generate_api_key' => 'getGenerateApiKey', + 'generate_client_key' => 'getGenerateClientKey', + 'merchant' => 'getMerchant', + 'self' => 'getSelf' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('generate_api_key', $data ?? [], null); + $this->setIfExists('generate_client_key', $data ?? [], null); + $this->setIfExists('merchant', $data ?? [], null); + $this->setIfExists('self', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['self'] === null) { + $invalidProperties[] = "'self' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed_origins + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param \Adyen\Model\Management\LinksElement|null $allowed_origins allowed_origins + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets company + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param \Adyen\Model\Management\LinksElement|null $company company + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets generate_api_key + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getGenerateApiKey() + { + return $this->container['generate_api_key']; + } + + /** + * Sets generate_api_key + * + * @param \Adyen\Model\Management\LinksElement|null $generate_api_key generate_api_key + * + * @return self + */ + public function setGenerateApiKey($generate_api_key) + { + if (is_null($generate_api_key)) { + throw new \InvalidArgumentException('non-nullable generate_api_key cannot be null'); + } + $this->container['generate_api_key'] = $generate_api_key; + + return $this; + } + + /** + * Gets generate_client_key + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getGenerateClientKey() + { + return $this->container['generate_client_key']; + } + + /** + * Sets generate_client_key + * + * @param \Adyen\Model\Management\LinksElement|null $generate_client_key generate_client_key + * + * @return self + */ + public function setGenerateClientKey($generate_client_key) + { + if (is_null($generate_client_key)) { + throw new \InvalidArgumentException('non-nullable generate_client_key cannot be null'); + } + $this->container['generate_client_key'] = $generate_client_key; + + return $this; + } + + /** + * Gets merchant + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getMerchant() + { + return $this->container['merchant']; + } + + /** + * Sets merchant + * + * @param \Adyen\Model\Management\LinksElement|null $merchant merchant + * + * @return self + */ + public function setMerchant($merchant) + { + if (is_null($merchant)) { + throw new \InvalidArgumentException('non-nullable merchant cannot be null'); + } + $this->container['merchant'] = $merchant; + + return $this; + } + + /** + * Gets self + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getSelf() + { + return $this->container['self']; + } + + /** + * Sets self + * + * @param \Adyen\Model\Management\LinksElement $self self + * + * @return self + */ + public function setSelf($self) + { + if (is_null($self)) { + throw new \InvalidArgumentException('non-nullable self cannot be null'); + } + $this->container['self'] = $self; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ApplePayInfo.php b/src/Adyen/Model/Management/ApplePayInfo.php new file mode 100644 index 000000000..c6606b510 --- /dev/null +++ b/src/Adyen/Model/Management/ApplePayInfo.php @@ -0,0 +1,385 @@ + + */ +class ApplePayInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApplePayInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'domains' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'domains' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'domains' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domains' => 'domains' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domains' => 'setDomains' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domains' => 'getDomains' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('domains', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets domains + * + * @return string[]|null + */ + public function getDomains() + { + return $this->container['domains']; + } + + /** + * Sets domains + * + * @param string[]|null $domains The list of merchant domains. Maximum: 99 domains per request. For more information, see [Apple Pay documentation](https://docs.adyen.com/payment-methods/apple-pay/web-drop-in?tab=adyen-certificate-live_1#going-live). + * + * @return self + */ + public function setDomains($domains) + { + if (is_null($domains)) { + throw new \InvalidArgumentException('non-nullable domains cannot be null'); + } + $this->container['domains'] = $domains; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/BcmcInfo.php b/src/Adyen/Model/Management/BcmcInfo.php new file mode 100644 index 000000000..abd035a42 --- /dev/null +++ b/src/Adyen/Model/Management/BcmcInfo.php @@ -0,0 +1,385 @@ + + */ +class BcmcInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BcmcInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enable_bcmc_mobile' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enable_bcmc_mobile' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enable_bcmc_mobile' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enable_bcmc_mobile' => 'enableBcmcMobile' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enable_bcmc_mobile' => 'setEnableBcmcMobile' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enable_bcmc_mobile' => 'getEnableBcmcMobile' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enable_bcmc_mobile', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enable_bcmc_mobile + * + * @return bool|null + */ + public function getEnableBcmcMobile() + { + return $this->container['enable_bcmc_mobile']; + } + + /** + * Sets enable_bcmc_mobile + * + * @param bool|null $enable_bcmc_mobile Indicates if [Bancontact mobile](https://docs.adyen.com/payment-methods/bancontact/bancontact-mobile) is enabled. + * + * @return self + */ + public function setEnableBcmcMobile($enable_bcmc_mobile) + { + if (is_null($enable_bcmc_mobile)) { + throw new \InvalidArgumentException('non-nullable enable_bcmc_mobile cannot be null'); + } + $this->container['enable_bcmc_mobile'] = $enable_bcmc_mobile; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/BillingEntitiesResponse.php b/src/Adyen/Model/Management/BillingEntitiesResponse.php new file mode 100644 index 000000000..064df854c --- /dev/null +++ b/src/Adyen/Model/Management/BillingEntitiesResponse.php @@ -0,0 +1,385 @@ + + */ +class BillingEntitiesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillingEntitiesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\BillingEntity[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\BillingEntity[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\BillingEntity[]|null $data List of legal entities that can be used for the billing of orders. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/BillingEntity.php b/src/Adyen/Model/Management/BillingEntity.php new file mode 100644 index 000000000..4754177b9 --- /dev/null +++ b/src/Adyen/Model/Management/BillingEntity.php @@ -0,0 +1,521 @@ + + */ +class BillingEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BillingEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\Management\Address', + 'email' => 'string', + 'id' => 'string', + 'name' => 'string', + 'tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'email' => null, + 'id' => null, + 'name' => null, + 'tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'email' => false, + 'id' => false, + 'name' => false, + 'tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'email' => 'email', + 'id' => 'id', + 'name' => 'name', + 'tax_id' => 'taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'email' => 'setEmail', + 'id' => 'setId', + 'name' => 'setName', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'email' => 'getEmail', + 'id' => 'getId', + 'name' => 'getName', + '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->setIfExists('address', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\Management\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Management\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address of the billing entity. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the billing entity, for use as `billingEntityId` when creating an order. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The unique name of the billing entity. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tax_id + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param string|null $tax_id The tax number of the billing entity. + * + * @return self + */ + public function setTaxId($tax_id) + { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } + $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 + ); + } +} diff --git a/src/Adyen/Model/Management/CardholderReceipt.php b/src/Adyen/Model/Management/CardholderReceipt.php new file mode 100644 index 000000000..b1b83bc07 --- /dev/null +++ b/src/Adyen/Model/Management/CardholderReceipt.php @@ -0,0 +1,385 @@ + + */ +class CardholderReceipt implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CardholderReceipt'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'header_for_authorized_receipt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'header_for_authorized_receipt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'header_for_authorized_receipt' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'header_for_authorized_receipt' => 'headerForAuthorizedReceipt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'header_for_authorized_receipt' => 'setHeaderForAuthorizedReceipt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'header_for_authorized_receipt' => 'getHeaderForAuthorizedReceipt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('header_for_authorized_receipt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets header_for_authorized_receipt + * + * @return string|null + */ + public function getHeaderForAuthorizedReceipt() + { + return $this->container['header_for_authorized_receipt']; + } + + /** + * Sets header_for_authorized_receipt + * + * @param string|null $header_for_authorized_receipt A custom header to show on the shopper receipt for an authorised transaction. Allows one or two comma-separated header lines, and blank lines. For example, `header,header,filler` + * + * @return self + */ + public function setHeaderForAuthorizedReceipt($header_for_authorized_receipt) + { + if (is_null($header_for_authorized_receipt)) { + throw new \InvalidArgumentException('non-nullable header_for_authorized_receipt cannot be null'); + } + $this->container['header_for_authorized_receipt'] = $header_for_authorized_receipt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CartesBancairesInfo.php b/src/Adyen/Model/Management/CartesBancairesInfo.php new file mode 100644 index 000000000..f4ad12dfe --- /dev/null +++ b/src/Adyen/Model/Management/CartesBancairesInfo.php @@ -0,0 +1,388 @@ + + */ +class CartesBancairesInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CartesBancairesInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'siret' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'siret' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'siret' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'siret' => 'siret' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'siret' => 'setSiret' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'siret' => 'getSiret' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('siret', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['siret'] === null) { + $invalidProperties[] = "'siret' 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 siret + * + * @return string + */ + public function getSiret() + { + return $this->container['siret']; + } + + /** + * Sets siret + * + * @param string $siret Cartes Bancaires SIRET. Format: 14 digits. + * + * @return self + */ + public function setSiret($siret) + { + if (is_null($siret)) { + throw new \InvalidArgumentException('non-nullable siret cannot be null'); + } + $this->container['siret'] = $siret; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Company.php b/src/Adyen/Model/Management/Company.php new file mode 100644 index 000000000..992594799 --- /dev/null +++ b/src/Adyen/Model/Management/Company.php @@ -0,0 +1,589 @@ + + */ +class Company implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Company'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\CompanyLinks', + 'data_centers' => '\Adyen\Model\Management\DataCenter[]', + 'description' => 'string', + 'id' => 'string', + 'name' => 'string', + 'reference' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data_centers' => null, + 'description' => null, + 'id' => null, + 'name' => null, + 'reference' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data_centers' => false, + 'description' => false, + 'id' => false, + 'name' => false, + 'reference' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data_centers' => 'dataCenters', + 'description' => 'description', + 'id' => 'id', + 'name' => 'name', + 'reference' => 'reference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data_centers' => 'setDataCenters', + 'description' => 'setDescription', + 'id' => 'setId', + 'name' => 'setName', + 'reference' => 'setReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data_centers' => 'getDataCenters', + 'description' => 'getDescription', + 'id' => 'getId', + 'name' => 'getName', + 'reference' => 'getReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data_centers', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 _links + * + * @return \Adyen\Model\Management\CompanyLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\CompanyLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data_centers + * + * @return \Adyen\Model\Management\DataCenter[]|null + */ + public function getDataCenters() + { + return $this->container['data_centers']; + } + + /** + * Sets data_centers + * + * @param \Adyen\Model\Management\DataCenter[]|null $data_centers List of available data centers. Adyen has several data centers around the world.In the URL that you use for making API requests, we recommend you use the live URL prefix from the data center closest to your shoppers. + * + * @return self + */ + public function setDataCenters($data_centers) + { + if (is_null($data_centers)) { + throw new \InvalidArgumentException('non-nullable data_centers cannot be null'); + } + $this->container['data_centers'] = $data_centers; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the company account, maximum 300 characters + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the company account. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The legal or trading name of the company. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference to the account + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the company account. Possible values: * **Active**: Users can log in. Processing and payout capabilities depend on the status of the merchant account. * **Inactive**: Users can log in. Payment processing and payouts are disabled. * **Closed**: The company account is closed and this cannot be reversed. Users cannot log in. Payment processing and payouts are disabled. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CompanyApiCredential.php b/src/Adyen/Model/Management/CompanyApiCredential.php new file mode 100644 index 000000000..bb100e7cd --- /dev/null +++ b/src/Adyen/Model/Management/CompanyApiCredential.php @@ -0,0 +1,709 @@ + + */ +class CompanyApiCredential implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CompanyApiCredential'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\ApiCredentialLinks', + 'active' => 'bool', + 'allowed_ip_addresses' => 'string[]', + 'allowed_origins' => '\Adyen\Model\Management\AllowedOrigin[]', + 'associated_merchant_accounts' => 'string[]', + 'client_key' => 'string', + 'description' => 'string', + 'id' => 'string', + 'roles' => 'string[]', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'active' => null, + 'allowed_ip_addresses' => null, + 'allowed_origins' => null, + 'associated_merchant_accounts' => null, + 'client_key' => null, + 'description' => null, + 'id' => null, + 'roles' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'active' => false, + 'allowed_ip_addresses' => false, + 'allowed_origins' => false, + 'associated_merchant_accounts' => false, + 'client_key' => false, + 'description' => false, + 'id' => false, + 'roles' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'active' => 'active', + 'allowed_ip_addresses' => 'allowedIpAddresses', + 'allowed_origins' => 'allowedOrigins', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'client_key' => 'clientKey', + 'description' => 'description', + 'id' => 'id', + 'roles' => 'roles', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'active' => 'setActive', + 'allowed_ip_addresses' => 'setAllowedIpAddresses', + 'allowed_origins' => 'setAllowedOrigins', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'client_key' => 'setClientKey', + 'description' => 'setDescription', + 'id' => 'setId', + 'roles' => 'setRoles', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'active' => 'getActive', + 'allowed_ip_addresses' => 'getAllowedIpAddresses', + 'allowed_origins' => 'getAllowedOrigins', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'client_key' => 'getClientKey', + 'description' => 'getDescription', + 'id' => 'getId', + 'roles' => 'getRoles', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('allowed_ip_addresses', $data ?? [], null); + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('client_key', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['allowed_ip_addresses'] === null) { + $invalidProperties[] = "'allowed_ip_addresses' can't be null"; + } + if ($this->container['client_key'] === null) { + $invalidProperties[] = "'client_key' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\ApiCredentialLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\ApiCredentialLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the API credential is enabled. Must be set to **true** to use the credential in your integration. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets allowed_ip_addresses + * + * @return string[] + */ + public function getAllowedIpAddresses() + { + return $this->container['allowed_ip_addresses']; + } + + /** + * Sets allowed_ip_addresses + * + * @param string[] $allowed_ip_addresses List of IP addresses from which your client can make requests. If the list is empty, we allow requests from any IP. If the list is not empty and we get a request from an IP which is not on the list, you get a security error. + * + * @return self + */ + public function setAllowedIpAddresses($allowed_ip_addresses) + { + if (is_null($allowed_ip_addresses)) { + throw new \InvalidArgumentException('non-nullable allowed_ip_addresses cannot be null'); + } + $this->container['allowed_ip_addresses'] = $allowed_ip_addresses; + + return $this; + } + + /** + * Gets allowed_origins + * + * @return \Adyen\Model\Management\AllowedOrigin[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param \Adyen\Model\Management\AllowedOrigin[]|null $allowed_origins List containing the [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) linked to the API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts List of merchant accounts that the API credential has explicit access to. If the credential has access to a company, this implies access to all merchant accounts and no merchants for that company will be included. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets client_key + * + * @return string + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string $client_key Public key used for [client-side authentication](https://docs.adyen.com/development-resources/client-side-authentication). The client key is required for Drop-in and Components integrations. + * + * @return self + */ + public function setClientKey($client_key) + { + if (is_null($client_key)) { + throw new \InvalidArgumentException('non-nullable client_key cannot be null'); + } + $this->container['client_key'] = $client_key; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of the API credential. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The name of the [API credential](https://docs.adyen.com/development-resources/api-credentials), for example **ws@Company.TestCompany**. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CompanyLinks.php b/src/Adyen/Model/Management/CompanyLinks.php new file mode 100644 index 000000000..2cb0292c0 --- /dev/null +++ b/src/Adyen/Model/Management/CompanyLinks.php @@ -0,0 +1,490 @@ + + */ +class CompanyLinks implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CompanyLinks'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'api_credentials' => '\Adyen\Model\Management\LinksElement', + 'self' => '\Adyen\Model\Management\LinksElement', + 'users' => '\Adyen\Model\Management\LinksElement', + 'webhooks' => '\Adyen\Model\Management\LinksElement' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'api_credentials' => null, + 'self' => null, + 'users' => null, + 'webhooks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'api_credentials' => false, + 'self' => false, + 'users' => false, + 'webhooks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'api_credentials' => 'apiCredentials', + 'self' => 'self', + 'users' => 'users', + 'webhooks' => 'webhooks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'api_credentials' => 'setApiCredentials', + 'self' => 'setSelf', + 'users' => 'setUsers', + 'webhooks' => 'setWebhooks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'api_credentials' => 'getApiCredentials', + 'self' => 'getSelf', + 'users' => 'getUsers', + 'webhooks' => 'getWebhooks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('api_credentials', $data ?? [], null); + $this->setIfExists('self', $data ?? [], null); + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('webhooks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['self'] === null) { + $invalidProperties[] = "'self' 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 api_credentials + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getApiCredentials() + { + return $this->container['api_credentials']; + } + + /** + * Sets api_credentials + * + * @param \Adyen\Model\Management\LinksElement|null $api_credentials api_credentials + * + * @return self + */ + public function setApiCredentials($api_credentials) + { + if (is_null($api_credentials)) { + throw new \InvalidArgumentException('non-nullable api_credentials cannot be null'); + } + $this->container['api_credentials'] = $api_credentials; + + return $this; + } + + /** + * Gets self + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getSelf() + { + return $this->container['self']; + } + + /** + * Sets self + * + * @param \Adyen\Model\Management\LinksElement $self self + * + * @return self + */ + public function setSelf($self) + { + if (is_null($self)) { + throw new \InvalidArgumentException('non-nullable self cannot be null'); + } + $this->container['self'] = $self; + + return $this; + } + + /** + * Gets users + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \Adyen\Model\Management\LinksElement|null $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets webhooks + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getWebhooks() + { + return $this->container['webhooks']; + } + + /** + * Sets webhooks + * + * @param \Adyen\Model\Management\LinksElement|null $webhooks webhooks + * + * @return self + */ + public function setWebhooks($webhooks) + { + if (is_null($webhooks)) { + throw new \InvalidArgumentException('non-nullable webhooks cannot be null'); + } + $this->container['webhooks'] = $webhooks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CompanyUser.php b/src/Adyen/Model/Management/CompanyUser.php new file mode 100644 index 000000000..fc57f003d --- /dev/null +++ b/src/Adyen/Model/Management/CompanyUser.php @@ -0,0 +1,740 @@ + + */ +class CompanyUser implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CompanyUser'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\Links', + 'account_groups' => 'string[]', + 'active' => 'bool', + 'associated_merchant_accounts' => 'string[]', + 'authn_apps' => 'string[]', + 'email' => 'string', + 'id' => 'string', + 'name' => '\Adyen\Model\Management\Name', + 'roles' => 'string[]', + 'time_zone_code' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'account_groups' => null, + 'active' => null, + 'associated_merchant_accounts' => null, + 'authn_apps' => null, + 'email' => null, + 'id' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'account_groups' => false, + 'active' => false, + 'associated_merchant_accounts' => false, + 'authn_apps' => false, + 'email' => false, + 'id' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'account_groups' => 'accountGroups', + 'active' => 'active', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'authn_apps' => 'authnApps', + 'email' => 'email', + 'id' => 'id', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'account_groups' => 'setAccountGroups', + 'active' => 'setActive', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'authn_apps' => 'setAuthnApps', + 'email' => 'setEmail', + 'id' => 'setId', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'account_groups' => 'getAccountGroups', + 'active' => 'getActive', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'authn_apps' => 'getAuthnApps', + 'email' => 'getEmail', + 'id' => 'getId', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('authn_apps', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['time_zone_code'] === null) { + $invalidProperties[] = "'time_zone_code' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\Links|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\Links|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates whether this user is active. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets authn_apps + * + * @return string[]|null + */ + public function getAuthnApps() + { + return $this->container['authn_apps']; + } + + /** + * Sets authn_apps + * + * @param string[]|null $authn_apps Set of authn apps available to this user + * + * @return self + */ + public function setAuthnApps($authn_apps) + { + if (is_null($authn_apps)) { + throw new \InvalidArgumentException('non-nullable authn_apps cannot be null'); + } + $this->container['authn_apps'] = $authn_apps; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the user. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The username for this user. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Configuration.php b/src/Adyen/Model/Management/Configuration.php new file mode 100644 index 000000000..143ad5209 --- /dev/null +++ b/src/Adyen/Model/Management/Configuration.php @@ -0,0 +1,459 @@ + + */ +class Configuration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Configuration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'brand' => 'string', + 'currencies' => '\Adyen\Model\Management\Currency[]', + 'sources' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'brand' => null, + 'currencies' => null, + 'sources' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'brand' => false, + 'currencies' => false, + 'sources' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'brand' => 'brand', + 'currencies' => 'currencies', + 'sources' => 'sources' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'brand' => 'setBrand', + 'currencies' => 'setCurrencies', + 'sources' => 'setSources' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'brand' => 'getBrand', + 'currencies' => 'getCurrencies', + 'sources' => 'getSources' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('brand', $data ?? [], null); + $this->setIfExists('currencies', $data ?? [], null); + $this->setIfExists('sources', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['brand'] === null) { + $invalidProperties[] = "'brand' can't be null"; + } + if ($this->container['currencies'] === null) { + $invalidProperties[] = "'currencies' 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 brand + * + * @return string + */ + public function getBrand() + { + return $this->container['brand']; + } + + /** + * Sets brand + * + * @param string $brand Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * + * @return self + */ + public function setBrand($brand) + { + if (is_null($brand)) { + throw new \InvalidArgumentException('non-nullable brand cannot be null'); + } + $this->container['brand'] = $brand; + + return $this; + } + + /** + * Gets currencies + * + * @return \Adyen\Model\Management\Currency[] + */ + public function getCurrencies() + { + return $this->container['currencies']; + } + + /** + * Sets currencies + * + * @param \Adyen\Model\Management\Currency[] $currencies Currency, and surcharge percentage or amount. + * + * @return self + */ + public function setCurrencies($currencies) + { + if (is_null($currencies)) { + throw new \InvalidArgumentException('non-nullable currencies cannot be null'); + } + $this->container['currencies'] = $currencies; + + return $this; + } + + /** + * Gets sources + * + * @return string[]|null + */ + public function getSources() + { + return $this->container['sources']; + } + + /** + * Sets sources + * + * @param string[]|null $sources Funding source. Possible values: * **Credit** * **Debit** + * + * @return self + */ + public function setSources($sources) + { + if (is_null($sources)) { + throw new \InvalidArgumentException('non-nullable sources cannot be null'); + } + $this->container['sources'] = $sources; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Connectivity.php b/src/Adyen/Model/Management/Connectivity.php new file mode 100644 index 000000000..65f3f5275 --- /dev/null +++ b/src/Adyen/Model/Management/Connectivity.php @@ -0,0 +1,418 @@ + + */ +class Connectivity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Connectivity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'simcard_status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'simcard_status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'simcard_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'simcard_status' => 'simcardStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'simcard_status' => 'setSimcardStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'simcard_status' => 'getSimcardStatus' + ]; + + /** + * 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 SIMCARD_STATUS_ACTIVATED = 'ACTIVATED'; + public const SIMCARD_STATUS_INVENTORY = 'INVENTORY'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSimcardStatusAllowableValues() + { + return [ + self::SIMCARD_STATUS_ACTIVATED, + self::SIMCARD_STATUS_INVENTORY, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('simcard_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSimcardStatusAllowableValues(); + if (!is_null($this->container['simcard_status']) && !in_array($this->container['simcard_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'simcard_status', must be one of '%s'", + $this->container['simcard_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets simcard_status + * + * @return string|null + */ + public function getSimcardStatus() + { + return $this->container['simcard_status']; + } + + /** + * Sets simcard_status + * + * @param string|null $simcard_status Indicates the status of the SIM card in the payment terminal. Can be updated and received only at terminal level, and only for models that support cellular connectivity. Possible values: * **ACTIVATED**: the SIM card is activated. Cellular connectivity may still need to be enabled on the terminal itself, in the **Network** settings. * **INVENTORY**: the SIM card is not activated. The terminal can't use cellular connectivity. + * + * @return self + */ + public function setSimcardStatus($simcard_status) + { + if (is_null($simcard_status)) { + throw new \InvalidArgumentException('non-nullable simcard_status cannot be null'); + } + $allowedValues = $this->getSimcardStatusAllowableValues(); + if (!in_array($simcard_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'simcard_status', must be one of '%s'", + $simcard_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['simcard_status'] = $simcard_status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Contact.php b/src/Adyen/Model/Management/Contact.php new file mode 100644 index 000000000..5de504788 --- /dev/null +++ b/src/Adyen/Model/Management/Contact.php @@ -0,0 +1,521 @@ + + */ +class Contact implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Contact'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'email' => 'string', + 'first_name' => 'string', + 'infix' => 'string', + 'last_name' => 'string', + 'phone_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email' => null, + 'first_name' => null, + 'infix' => null, + 'last_name' => null, + 'phone_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'email' => false, + 'first_name' => false, + 'infix' => false, + 'last_name' => false, + 'phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'first_name' => 'firstName', + 'infix' => 'infix', + 'last_name' => 'lastName', + 'phone_number' => 'phoneNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'first_name' => 'setFirstName', + 'infix' => 'setInfix', + 'last_name' => 'setLastName', + 'phone_number' => 'setPhoneNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'first_name' => 'getFirstName', + 'infix' => 'getInfix', + 'last_name' => 'getLastName', + 'phone_number' => 'getPhoneNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('infix', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The individual's email address. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The individual's first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets infix + * + * @return string|null + */ + public function getInfix() + { + return $this->container['infix']; + } + + /** + * Sets infix + * + * @param string|null $infix The infix in the individual's name, if any. + * + * @return self + */ + public function setInfix($infix) + { + if (is_null($infix)) { + throw new \InvalidArgumentException('non-nullable infix cannot be null'); + } + $this->container['infix'] = $infix; + + 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 individual's last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_name; + + 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 individual's phone number, specified as 10-14 digits with an optional `+` prefix. + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateAllowedOriginRequest.php b/src/Adyen/Model/Management/CreateAllowedOriginRequest.php new file mode 100644 index 000000000..96cd3b845 --- /dev/null +++ b/src/Adyen/Model/Management/CreateAllowedOriginRequest.php @@ -0,0 +1,456 @@ + + */ +class CreateAllowedOriginRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateAllowedOriginRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\Links', + 'domain' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'domain' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'domain' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'domain' => 'domain', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'domain' => 'setDomain', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'domain' => 'getDomain', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('domain', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' 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 _links + * + * @return \Adyen\Model\Management\Links|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\Links|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Domain of the allowed origin. + * + * @return self + */ + public function setDomain($domain) + { + if (is_null($domain)) { + throw new \InvalidArgumentException('non-nullable domain cannot be null'); + } + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Unique identifier of the allowed origin. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateApiCredentialResponse.php b/src/Adyen/Model/Management/CreateApiCredentialResponse.php new file mode 100644 index 000000000..623c5e1ee --- /dev/null +++ b/src/Adyen/Model/Management/CreateApiCredentialResponse.php @@ -0,0 +1,749 @@ + + */ +class CreateApiCredentialResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateApiCredentialResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\ApiCredentialLinks', + 'active' => 'bool', + 'allowed_ip_addresses' => 'string[]', + 'allowed_origins' => '\Adyen\Model\Management\AllowedOrigin[]', + 'api_key' => 'string', + 'client_key' => 'string', + 'description' => 'string', + 'id' => 'string', + 'password' => 'string', + 'roles' => 'string[]', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'active' => null, + 'allowed_ip_addresses' => null, + 'allowed_origins' => null, + 'api_key' => null, + 'client_key' => null, + 'description' => null, + 'id' => null, + 'password' => null, + 'roles' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'active' => false, + 'allowed_ip_addresses' => false, + 'allowed_origins' => false, + 'api_key' => false, + 'client_key' => false, + 'description' => false, + 'id' => false, + 'password' => false, + 'roles' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'active' => 'active', + 'allowed_ip_addresses' => 'allowedIpAddresses', + 'allowed_origins' => 'allowedOrigins', + 'api_key' => 'apiKey', + 'client_key' => 'clientKey', + 'description' => 'description', + 'id' => 'id', + 'password' => 'password', + 'roles' => 'roles', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'active' => 'setActive', + 'allowed_ip_addresses' => 'setAllowedIpAddresses', + 'allowed_origins' => 'setAllowedOrigins', + 'api_key' => 'setApiKey', + 'client_key' => 'setClientKey', + 'description' => 'setDescription', + 'id' => 'setId', + 'password' => 'setPassword', + 'roles' => 'setRoles', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'active' => 'getActive', + 'allowed_ip_addresses' => 'getAllowedIpAddresses', + 'allowed_origins' => 'getAllowedOrigins', + 'api_key' => 'getApiKey', + 'client_key' => 'getClientKey', + 'description' => 'getDescription', + 'id' => 'getId', + 'password' => 'getPassword', + 'roles' => 'getRoles', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('allowed_ip_addresses', $data ?? [], null); + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('api_key', $data ?? [], null); + $this->setIfExists('client_key', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['allowed_ip_addresses'] === null) { + $invalidProperties[] = "'allowed_ip_addresses' can't be null"; + } + if ($this->container['api_key'] === null) { + $invalidProperties[] = "'api_key' can't be null"; + } + if ($this->container['client_key'] === null) { + $invalidProperties[] = "'client_key' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['password'] === null) { + $invalidProperties[] = "'password' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\ApiCredentialLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\ApiCredentialLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the API credential is enabled. Must be set to **true** to use the credential in your integration. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets allowed_ip_addresses + * + * @return string[] + */ + public function getAllowedIpAddresses() + { + return $this->container['allowed_ip_addresses']; + } + + /** + * Sets allowed_ip_addresses + * + * @param string[] $allowed_ip_addresses List of IP addresses from which your client can make requests. If the list is empty, we allow requests from any IP. If the list is not empty and we get a request from an IP which is not on the list, you get a security error. + * + * @return self + */ + public function setAllowedIpAddresses($allowed_ip_addresses) + { + if (is_null($allowed_ip_addresses)) { + throw new \InvalidArgumentException('non-nullable allowed_ip_addresses cannot be null'); + } + $this->container['allowed_ip_addresses'] = $allowed_ip_addresses; + + return $this; + } + + /** + * Gets allowed_origins + * + * @return \Adyen\Model\Management\AllowedOrigin[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param \Adyen\Model\Management\AllowedOrigin[]|null $allowed_origins List containing the [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) linked to the API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets api_key + * + * @return string + */ + public function getApiKey() + { + return $this->container['api_key']; + } + + /** + * Sets api_key + * + * @param string $api_key The API key for the API credential that was created. + * + * @return self + */ + public function setApiKey($api_key) + { + if (is_null($api_key)) { + throw new \InvalidArgumentException('non-nullable api_key cannot be null'); + } + $this->container['api_key'] = $api_key; + + return $this; + } + + /** + * Gets client_key + * + * @return string + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string $client_key Public key used for [client-side authentication](https://docs.adyen.com/development-resources/client-side-authentication). The client key is required for Drop-in and Components integrations. + * + * @return self + */ + public function setClientKey($client_key) + { + if (is_null($client_key)) { + throw new \InvalidArgumentException('non-nullable client_key cannot be null'); + } + $this->container['client_key'] = $client_key; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of the API credential. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password The password for the API credential that was created. + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The name of the [API credential](https://docs.adyen.com/development-resources/api-credentials), for example **ws@Company.TestCompany**. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php b/src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php new file mode 100644 index 000000000..349e04f53 --- /dev/null +++ b/src/Adyen/Model/Management/CreateCompanyApiCredentialRequest.php @@ -0,0 +1,487 @@ + + */ +class CreateCompanyApiCredentialRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateCompanyApiCredentialRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed_origins' => 'string[]', + 'associated_merchant_accounts' => 'string[]', + 'description' => 'string', + 'roles' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed_origins' => null, + 'associated_merchant_accounts' => null, + 'description' => null, + 'roles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed_origins' => false, + 'associated_merchant_accounts' => false, + 'description' => false, + 'roles' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_origins' => 'allowedOrigins', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'description' => 'description', + 'roles' => 'roles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_origins' => 'setAllowedOrigins', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'description' => 'setDescription', + 'roles' => 'setRoles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_origins' => 'getAllowedOrigins', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'description' => 'getDescription', + 'roles' => 'getRoles' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed_origins + * + * @return string[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param string[]|null $allowed_origins List of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts List of merchant accounts that the API credential has access to. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) of the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateCompanyApiCredentialResponse.php b/src/Adyen/Model/Management/CreateCompanyApiCredentialResponse.php new file mode 100644 index 000000000..a2b2bd53a --- /dev/null +++ b/src/Adyen/Model/Management/CreateCompanyApiCredentialResponse.php @@ -0,0 +1,786 @@ + + */ +class CreateCompanyApiCredentialResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateCompanyApiCredentialResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\ApiCredentialLinks', + 'active' => 'bool', + 'allowed_ip_addresses' => 'string[]', + 'allowed_origins' => '\Adyen\Model\Management\AllowedOrigin[]', + 'api_key' => 'string', + 'associated_merchant_accounts' => 'string[]', + 'client_key' => 'string', + 'description' => 'string', + 'id' => 'string', + 'password' => 'string', + 'roles' => 'string[]', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'active' => null, + 'allowed_ip_addresses' => null, + 'allowed_origins' => null, + 'api_key' => null, + 'associated_merchant_accounts' => null, + 'client_key' => null, + 'description' => null, + 'id' => null, + 'password' => null, + 'roles' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'active' => false, + 'allowed_ip_addresses' => false, + 'allowed_origins' => false, + 'api_key' => false, + 'associated_merchant_accounts' => false, + 'client_key' => false, + 'description' => false, + 'id' => false, + 'password' => false, + 'roles' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'active' => 'active', + 'allowed_ip_addresses' => 'allowedIpAddresses', + 'allowed_origins' => 'allowedOrigins', + 'api_key' => 'apiKey', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'client_key' => 'clientKey', + 'description' => 'description', + 'id' => 'id', + 'password' => 'password', + 'roles' => 'roles', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'active' => 'setActive', + 'allowed_ip_addresses' => 'setAllowedIpAddresses', + 'allowed_origins' => 'setAllowedOrigins', + 'api_key' => 'setApiKey', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'client_key' => 'setClientKey', + 'description' => 'setDescription', + 'id' => 'setId', + 'password' => 'setPassword', + 'roles' => 'setRoles', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'active' => 'getActive', + 'allowed_ip_addresses' => 'getAllowedIpAddresses', + 'allowed_origins' => 'getAllowedOrigins', + 'api_key' => 'getApiKey', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'client_key' => 'getClientKey', + 'description' => 'getDescription', + 'id' => 'getId', + 'password' => 'getPassword', + 'roles' => 'getRoles', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('allowed_ip_addresses', $data ?? [], null); + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('api_key', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('client_key', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['allowed_ip_addresses'] === null) { + $invalidProperties[] = "'allowed_ip_addresses' can't be null"; + } + if ($this->container['api_key'] === null) { + $invalidProperties[] = "'api_key' can't be null"; + } + if ($this->container['associated_merchant_accounts'] === null) { + $invalidProperties[] = "'associated_merchant_accounts' can't be null"; + } + if ($this->container['client_key'] === null) { + $invalidProperties[] = "'client_key' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['password'] === null) { + $invalidProperties[] = "'password' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\ApiCredentialLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\ApiCredentialLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the API credential is enabled. Must be set to **true** to use the credential in your integration. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets allowed_ip_addresses + * + * @return string[] + */ + public function getAllowedIpAddresses() + { + return $this->container['allowed_ip_addresses']; + } + + /** + * Sets allowed_ip_addresses + * + * @param string[] $allowed_ip_addresses List of IP addresses from which your client can make requests. If the list is empty, we allow requests from any IP. If the list is not empty and we get a request from an IP which is not on the list, you get a security error. + * + * @return self + */ + public function setAllowedIpAddresses($allowed_ip_addresses) + { + if (is_null($allowed_ip_addresses)) { + throw new \InvalidArgumentException('non-nullable allowed_ip_addresses cannot be null'); + } + $this->container['allowed_ip_addresses'] = $allowed_ip_addresses; + + return $this; + } + + /** + * Gets allowed_origins + * + * @return \Adyen\Model\Management\AllowedOrigin[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param \Adyen\Model\Management\AllowedOrigin[]|null $allowed_origins List containing the [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) linked to the API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets api_key + * + * @return string + */ + public function getApiKey() + { + return $this->container['api_key']; + } + + /** + * Sets api_key + * + * @param string $api_key The API key for the API credential that was created. + * + * @return self + */ + public function setApiKey($api_key) + { + if (is_null($api_key)) { + throw new \InvalidArgumentException('non-nullable api_key cannot be null'); + } + $this->container['api_key'] = $api_key; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[] + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[] $associated_merchant_accounts List of merchant accounts that the API credential has access to. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets client_key + * + * @return string + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string $client_key Public key used for [client-side authentication](https://docs.adyen.com/development-resources/client-side-authentication). The client key is required for Drop-in and Components integrations. + * + * @return self + */ + public function setClientKey($client_key) + { + if (is_null($client_key)) { + throw new \InvalidArgumentException('non-nullable client_key cannot be null'); + } + $this->container['client_key'] = $client_key; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of the API credential. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password The password for the API credential that was created. + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The name of the [API credential](https://docs.adyen.com/development-resources/api-credentials), for example **ws@Company.TestCompany**. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateCompanyUserRequest.php b/src/Adyen/Model/Management/CreateCompanyUserRequest.php new file mode 100644 index 000000000..606e626d1 --- /dev/null +++ b/src/Adyen/Model/Management/CreateCompanyUserRequest.php @@ -0,0 +1,632 @@ + + */ +class CreateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateCompanyUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_groups' => 'string[]', + 'associated_merchant_accounts' => 'string[]', + 'authn_apps' => 'string[]', + 'email' => 'string', + 'name' => '\Adyen\Model\Management\Name', + 'roles' => 'string[]', + 'time_zone_code' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_groups' => null, + 'associated_merchant_accounts' => null, + 'authn_apps' => null, + 'email' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_groups' => false, + 'associated_merchant_accounts' => false, + 'authn_apps' => false, + 'email' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_groups' => 'accountGroups', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'authn_apps' => 'authnApps', + 'email' => 'email', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_groups' => 'setAccountGroups', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'authn_apps' => 'setAuthnApps', + 'email' => 'setEmail', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_groups' => 'getAccountGroups', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'authn_apps' => 'getAuthnApps', + 'email' => 'getEmail', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('authn_apps', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets authn_apps + * + * @return string[]|null + */ + public function getAuthnApps() + { + return $this->container['authn_apps']; + } + + /** + * Sets authn_apps + * + * @param string[]|null $authn_apps Set of authn apps to add to this user + * + * @return self + */ + public function setAuthnApps($authn_apps) + { + if (is_null($authn_apps)) { + throw new \InvalidArgumentException('non-nullable authn_apps cannot be null'); + } + $this->container['authn_apps'] = $authn_apps; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string|null + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string|null $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The username for this user. Allowed length: 255 alphanumeric characters. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateCompanyUserResponse.php b/src/Adyen/Model/Management/CreateCompanyUserResponse.php new file mode 100644 index 000000000..12c593502 --- /dev/null +++ b/src/Adyen/Model/Management/CreateCompanyUserResponse.php @@ -0,0 +1,740 @@ + + */ +class CreateCompanyUserResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateCompanyUserResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\Links', + 'account_groups' => 'string[]', + 'active' => 'bool', + 'associated_merchant_accounts' => 'string[]', + 'authn_apps' => 'string[]', + 'email' => 'string', + 'id' => 'string', + 'name' => '\Adyen\Model\Management\Name', + 'roles' => 'string[]', + 'time_zone_code' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'account_groups' => null, + 'active' => null, + 'associated_merchant_accounts' => null, + 'authn_apps' => null, + 'email' => null, + 'id' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'account_groups' => false, + 'active' => false, + 'associated_merchant_accounts' => false, + 'authn_apps' => false, + 'email' => false, + 'id' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'account_groups' => 'accountGroups', + 'active' => 'active', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'authn_apps' => 'authnApps', + 'email' => 'email', + 'id' => 'id', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'account_groups' => 'setAccountGroups', + 'active' => 'setActive', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'authn_apps' => 'setAuthnApps', + 'email' => 'setEmail', + 'id' => 'setId', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'account_groups' => 'getAccountGroups', + 'active' => 'getActive', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'authn_apps' => 'getAuthnApps', + 'email' => 'getEmail', + 'id' => 'getId', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('authn_apps', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['time_zone_code'] === null) { + $invalidProperties[] = "'time_zone_code' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\Links|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\Links|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates whether this user is active. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets authn_apps + * + * @return string[]|null + */ + public function getAuthnApps() + { + return $this->container['authn_apps']; + } + + /** + * Sets authn_apps + * + * @param string[]|null $authn_apps Set of authn apps available to this user + * + * @return self + */ + public function setAuthnApps($authn_apps) + { + if (is_null($authn_apps)) { + throw new \InvalidArgumentException('non-nullable authn_apps cannot be null'); + } + $this->container['authn_apps'] = $authn_apps; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the user. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The username for this user. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php new file mode 100644 index 000000000..7bd39e8b8 --- /dev/null +++ b/src/Adyen/Model/Management/CreateCompanyWebhookRequest.php @@ -0,0 +1,1061 @@ + + */ +class CreateCompanyWebhookRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateCompanyWebhookRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accepts_expired_certificate' => 'bool', + 'accepts_self_signed_certificate' => 'bool', + 'accepts_untrusted_root_certificate' => 'bool', + 'active' => 'bool', + 'additional_settings' => '\Adyen\Model\Management\AdditionalSettings', + 'communication_format' => 'string', + 'description' => 'string', + 'filter_merchant_account_type' => 'string', + 'filter_merchant_accounts' => 'string[]', + 'network_type' => 'string', + 'password' => 'string', + 'populate_soap_action_header' => 'bool', + 'ssl_version' => 'string', + 'type' => 'string', + 'url' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accepts_expired_certificate' => null, + 'accepts_self_signed_certificate' => null, + 'accepts_untrusted_root_certificate' => null, + 'active' => null, + 'additional_settings' => null, + 'communication_format' => null, + 'description' => null, + 'filter_merchant_account_type' => null, + 'filter_merchant_accounts' => null, + 'network_type' => null, + 'password' => null, + 'populate_soap_action_header' => null, + 'ssl_version' => null, + 'type' => null, + 'url' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accepts_expired_certificate' => false, + 'accepts_self_signed_certificate' => false, + 'accepts_untrusted_root_certificate' => false, + 'active' => false, + 'additional_settings' => false, + 'communication_format' => false, + 'description' => false, + 'filter_merchant_account_type' => false, + 'filter_merchant_accounts' => false, + 'network_type' => false, + 'password' => false, + 'populate_soap_action_header' => false, + 'ssl_version' => false, + 'type' => false, + 'url' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accepts_expired_certificate' => 'acceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'acceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'acceptsUntrustedRootCertificate', + 'active' => 'active', + 'additional_settings' => 'additionalSettings', + 'communication_format' => 'communicationFormat', + 'description' => 'description', + 'filter_merchant_account_type' => 'filterMerchantAccountType', + 'filter_merchant_accounts' => 'filterMerchantAccounts', + 'network_type' => 'networkType', + 'password' => 'password', + 'populate_soap_action_header' => 'populateSoapActionHeader', + 'ssl_version' => 'sslVersion', + 'type' => 'type', + 'url' => 'url', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accepts_expired_certificate' => 'setAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'setAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'setAcceptsUntrustedRootCertificate', + 'active' => 'setActive', + 'additional_settings' => 'setAdditionalSettings', + 'communication_format' => 'setCommunicationFormat', + 'description' => 'setDescription', + 'filter_merchant_account_type' => 'setFilterMerchantAccountType', + 'filter_merchant_accounts' => 'setFilterMerchantAccounts', + 'network_type' => 'setNetworkType', + 'password' => 'setPassword', + 'populate_soap_action_header' => 'setPopulateSoapActionHeader', + 'ssl_version' => 'setSslVersion', + 'type' => 'setType', + 'url' => 'setUrl', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accepts_expired_certificate' => 'getAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'getAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'getAcceptsUntrustedRootCertificate', + 'active' => 'getActive', + 'additional_settings' => 'getAdditionalSettings', + 'communication_format' => 'getCommunicationFormat', + 'description' => 'getDescription', + 'filter_merchant_account_type' => 'getFilterMerchantAccountType', + 'filter_merchant_accounts' => 'getFilterMerchantAccounts', + 'network_type' => 'getNetworkType', + 'password' => 'getPassword', + 'populate_soap_action_header' => 'getPopulateSoapActionHeader', + 'ssl_version' => 'getSslVersion', + 'type' => 'getType', + 'url' => 'getUrl', + 'username' => 'getUsername' + ]; + + /** + * 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 COMMUNICATION_FORMAT_HTTP = 'http'; + public const COMMUNICATION_FORMAT_JSON = 'json'; + public const COMMUNICATION_FORMAT_SOAP = 'soap'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS = 'allAccounts'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS = 'excludeAccounts'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS = 'includeAccounts'; + public const NETWORK_TYPE_LOCAL = 'LOCAL'; + public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const SSL_VERSION_HTTP = 'HTTP'; + public const SSL_VERSION_SSL = 'SSL'; + public const SSL_VERSION_SSLV3 = 'SSLv3'; + public const SSL_VERSION_TLS = 'TLS'; + public const SSL_VERSION_TLSV1 = 'TLSv1'; + public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; + public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; + public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCommunicationFormatAllowableValues() + { + return [ + self::COMMUNICATION_FORMAT_HTTP, + self::COMMUNICATION_FORMAT_JSON, + self::COMMUNICATION_FORMAT_SOAP, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFilterMerchantAccountTypeAllowableValues() + { + return [ + self::FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS, + self::FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS, + self::FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNetworkTypeAllowableValues() + { + return [ + self::NETWORK_TYPE_LOCAL, + self::NETWORK_TYPE__PUBLIC, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSslVersionAllowableValues() + { + return [ + self::SSL_VERSION_HTTP, + self::SSL_VERSION_SSL, + self::SSL_VERSION_SSLV3, + self::SSL_VERSION_TLS, + self::SSL_VERSION_TLSV1, + self::SSL_VERSION_TLSV1_1, + self::SSL_VERSION_TLSV1_2, + self::SSL_VERSION_TLSV1_3, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accepts_expired_certificate', $data ?? [], null); + $this->setIfExists('accepts_self_signed_certificate', $data ?? [], null); + $this->setIfExists('accepts_untrusted_root_certificate', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('additional_settings', $data ?? [], null); + $this->setIfExists('communication_format', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('filter_merchant_account_type', $data ?? [], null); + $this->setIfExists('filter_merchant_accounts', $data ?? [], null); + $this->setIfExists('network_type', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('populate_soap_action_header', $data ?? [], null); + $this->setIfExists('ssl_version', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['communication_format'] === null) { + $invalidProperties[] = "'communication_format' can't be null"; + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!is_null($this->container['communication_format']) && !in_array($this->container['communication_format'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'communication_format', must be one of '%s'", + $this->container['communication_format'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['filter_merchant_account_type'] === null) { + $invalidProperties[] = "'filter_merchant_account_type' can't be null"; + } + $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); + if (!is_null($this->container['filter_merchant_account_type']) && !in_array($this->container['filter_merchant_account_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'filter_merchant_account_type', must be one of '%s'", + $this->container['filter_merchant_account_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['filter_merchant_accounts'] === null) { + $invalidProperties[] = "'filter_merchant_accounts' can't be null"; + } + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!is_null($this->container['network_type']) && !in_array($this->container['network_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'network_type', must be one of '%s'", + $this->container['network_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSslVersionAllowableValues(); + if (!is_null($this->container['ssl_version']) && !in_array($this->container['ssl_version'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ssl_version', must be one of '%s'", + $this->container['ssl_version'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' 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 accepts_expired_certificate + * + * @return bool|null + */ + public function getAcceptsExpiredCertificate() + { + return $this->container['accepts_expired_certificate']; + } + + /** + * Sets accepts_expired_certificate + * + * @param bool|null $accepts_expired_certificate Indicates if expired SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsExpiredCertificate($accepts_expired_certificate) + { + if (is_null($accepts_expired_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_expired_certificate cannot be null'); + } + $this->container['accepts_expired_certificate'] = $accepts_expired_certificate; + + return $this; + } + + /** + * Gets accepts_self_signed_certificate + * + * @return bool|null + */ + public function getAcceptsSelfSignedCertificate() + { + return $this->container['accepts_self_signed_certificate']; + } + + /** + * Sets accepts_self_signed_certificate + * + * @param bool|null $accepts_self_signed_certificate Indicates if self-signed SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsSelfSignedCertificate($accepts_self_signed_certificate) + { + if (is_null($accepts_self_signed_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_self_signed_certificate cannot be null'); + } + $this->container['accepts_self_signed_certificate'] = $accepts_self_signed_certificate; + + return $this; + } + + /** + * Gets accepts_untrusted_root_certificate + * + * @return bool|null + */ + public function getAcceptsUntrustedRootCertificate() + { + return $this->container['accepts_untrusted_root_certificate']; + } + + /** + * Sets accepts_untrusted_root_certificate + * + * @param bool|null $accepts_untrusted_root_certificate Indicates if untrusted SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsUntrustedRootCertificate($accepts_untrusted_root_certificate) + { + if (is_null($accepts_untrusted_root_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_untrusted_root_certificate cannot be null'); + } + $this->container['accepts_untrusted_root_certificate'] = $accepts_untrusted_root_certificate; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets additional_settings + * + * @return \Adyen\Model\Management\AdditionalSettings|null + */ + public function getAdditionalSettings() + { + return $this->container['additional_settings']; + } + + /** + * Sets additional_settings + * + * @param \Adyen\Model\Management\AdditionalSettings|null $additional_settings additional_settings + * + * @return self + */ + public function setAdditionalSettings($additional_settings) + { + if (is_null($additional_settings)) { + throw new \InvalidArgumentException('non-nullable additional_settings cannot be null'); + } + $this->container['additional_settings'] = $additional_settings; + + return $this; + } + + /** + * Gets communication_format + * + * @return string + */ + public function getCommunicationFormat() + { + return $this->container['communication_format']; + } + + /** + * Sets communication_format + * + * @param string $communication_format Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + * + * @return self + */ + public function setCommunicationFormat($communication_format) + { + if (is_null($communication_format)) { + throw new \InvalidArgumentException('non-nullable communication_format cannot be null'); + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!in_array($communication_format, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'communication_format', must be one of '%s'", + $communication_format, + implode("', '", $allowedValues) + ) + ); + } + $this->container['communication_format'] = $communication_format; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for this webhook configuration. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets filter_merchant_account_type + * + * @return string + */ + public function getFilterMerchantAccountType() + { + return $this->container['filter_merchant_account_type']; + } + + /** + * Sets filter_merchant_account_type + * + * @param string $filter_merchant_account_type Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **includeAccounts**: The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts**: The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. * **allAccounts**: Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. + * + * @return self + */ + public function setFilterMerchantAccountType($filter_merchant_account_type) + { + if (is_null($filter_merchant_account_type)) { + throw new \InvalidArgumentException('non-nullable filter_merchant_account_type cannot be null'); + } + $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); + if (!in_array($filter_merchant_account_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_merchant_account_type', must be one of '%s'", + $filter_merchant_account_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_merchant_account_type'] = $filter_merchant_account_type; + + return $this; + } + + /** + * Gets filter_merchant_accounts + * + * @return string[] + */ + public function getFilterMerchantAccounts() + { + return $this->container['filter_merchant_accounts']; + } + + /** + * Sets filter_merchant_accounts + * + * @param string[] $filter_merchant_accounts A list of merchant account names that are included or excluded from receiving the webhook. Inclusion or exclusion is based on the value defined for `filterMerchantAccountType`. Required if `filterMerchantAccountType` is either: * **includeAccounts** * **excludeAccounts** Not needed for `filterMerchantAccountType`: **allAccounts**. + * + * @return self + */ + public function setFilterMerchantAccounts($filter_merchant_accounts) + { + if (is_null($filter_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable filter_merchant_accounts cannot be null'); + } + $this->container['filter_merchant_accounts'] = $filter_merchant_accounts; + + return $this; + } + + /** + * Gets network_type + * + * @return string|null + */ + public function getNetworkType() + { + return $this->container['network_type']; + } + + /** + * Sets network_type + * + * @param string|null $network_type Network type for Terminal API notification webhooks. Possible values: * **public** * **local** Default Value: **public**. + * + * @return self + */ + public function setNetworkType($network_type) + { + if (is_null($network_type)) { + throw new \InvalidArgumentException('non-nullable network_type cannot be null'); + } + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!in_array($network_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'network_type', must be one of '%s'", + $network_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['network_type'] = $network_type; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password Password to access the webhook URL. + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets populate_soap_action_header + * + * @return bool|null + */ + public function getPopulateSoapActionHeader() + { + return $this->container['populate_soap_action_header']; + } + + /** + * Sets populate_soap_action_header + * + * @param bool|null $populate_soap_action_header Indicates if the SOAP action header needs to be populated. Default value: **false**. Only applies if `communicationFormat`: **soap**. + * + * @return self + */ + public function setPopulateSoapActionHeader($populate_soap_action_header) + { + if (is_null($populate_soap_action_header)) { + throw new \InvalidArgumentException('non-nullable populate_soap_action_header cannot be null'); + } + $this->container['populate_soap_action_header'] = $populate_soap_action_header; + + return $this; + } + + /** + * Gets ssl_version + * + * @return string|null + */ + public function getSslVersion() + { + return $this->container['ssl_version']; + } + + /** + * Sets ssl_version + * + * @param string|null $ssl_version SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. + * + * @return self + */ + public function setSslVersion($ssl_version) + { + if (is_null($ssl_version)) { + throw new \InvalidArgumentException('non-nullable ssl_version cannot be null'); + } + $allowedValues = $this->getSslVersionAllowableValues(); + if (!in_array($ssl_version, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ssl_version', must be one of '%s'", + $ssl_version, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ssl_version'] = $ssl_version; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username Username to access the webhook URL. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php b/src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php new file mode 100644 index 000000000..6ef904054 --- /dev/null +++ b/src/Adyen/Model/Management/CreateMerchantApiCredentialRequest.php @@ -0,0 +1,453 @@ + + */ +class CreateMerchantApiCredentialRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateMerchantApiCredentialRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed_origins' => 'string[]', + 'description' => 'string', + 'roles' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed_origins' => null, + 'description' => null, + 'roles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed_origins' => false, + 'description' => false, + 'roles' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed_origins' => 'allowedOrigins', + 'description' => 'description', + 'roles' => 'roles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed_origins' => 'setAllowedOrigins', + 'description' => 'setDescription', + 'roles' => 'setRoles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed_origins' => 'getAllowedOrigins', + 'description' => 'getDescription', + 'roles' => 'getRoles' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed_origins + * + * @return string[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param string[]|null $allowed_origins The list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the new API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateMerchantRequest.php b/src/Adyen/Model/Management/CreateMerchantRequest.php new file mode 100644 index 000000000..33e98e330 --- /dev/null +++ b/src/Adyen/Model/Management/CreateMerchantRequest.php @@ -0,0 +1,592 @@ + + */ +class CreateMerchantRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateMerchantRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_line_id' => 'string', + 'company_id' => 'string', + 'description' => 'string', + 'legal_entity_id' => 'string', + 'pricing_plan' => 'string', + 'reference' => 'string', + 'sales_channels' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_line_id' => null, + 'company_id' => null, + 'description' => null, + 'legal_entity_id' => null, + 'pricing_plan' => null, + 'reference' => null, + 'sales_channels' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'business_line_id' => false, + 'company_id' => false, + 'description' => false, + 'legal_entity_id' => false, + 'pricing_plan' => false, + 'reference' => false, + 'sales_channels' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_line_id' => 'businessLineId', + 'company_id' => 'companyId', + 'description' => 'description', + 'legal_entity_id' => 'legalEntityId', + 'pricing_plan' => 'pricingPlan', + 'reference' => 'reference', + 'sales_channels' => 'salesChannels' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_line_id' => 'setBusinessLineId', + 'company_id' => 'setCompanyId', + 'description' => 'setDescription', + 'legal_entity_id' => 'setLegalEntityId', + 'pricing_plan' => 'setPricingPlan', + 'reference' => 'setReference', + 'sales_channels' => 'setSalesChannels' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_line_id' => 'getBusinessLineId', + 'company_id' => 'getCompanyId', + 'description' => 'getDescription', + 'legal_entity_id' => 'getLegalEntityId', + 'pricing_plan' => 'getPricingPlan', + 'reference' => 'getReference', + 'sales_channels' => 'getSalesChannels' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('business_line_id', $data ?? [], null); + $this->setIfExists('company_id', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('legal_entity_id', $data ?? [], null); + $this->setIfExists('pricing_plan', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('sales_channels', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['company_id'] === null) { + $invalidProperties[] = "'company_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_line_id + * + * @return string|null + */ + public function getBusinessLineId() + { + return $this->container['business_line_id']; + } + + /** + * Sets business_line_id + * + * @param string|null $business_line_id The unique identifier of the [business line](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines). Required for an Adyen for Platforms Manage integration. + * + * @return self + */ + public function setBusinessLineId($business_line_id) + { + if (is_null($business_line_id)) { + throw new \InvalidArgumentException('non-nullable business_line_id cannot be null'); + } + $this->container['business_line_id'] = $business_line_id; + + return $this; + } + + /** + * Gets company_id + * + * @return string + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param string $company_id The unique identifier of the company account. + * + * @return self + */ + public function setCompanyId($company_id) + { + if (is_null($company_id)) { + throw new \InvalidArgumentException('non-nullable company_id cannot be null'); + } + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the merchant account, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets legal_entity_id + * + * @return string|null + */ + public function getLegalEntityId() + { + return $this->container['legal_entity_id']; + } + + /** + * Sets legal_entity_id + * + * @param string|null $legal_entity_id The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities). Required for an Adyen for Platforms Manage integration. + * + * @return self + */ + public function setLegalEntityId($legal_entity_id) + { + if (is_null($legal_entity_id)) { + throw new \InvalidArgumentException('non-nullable legal_entity_id cannot be null'); + } + $this->container['legal_entity_id'] = $legal_entity_id; + + return $this; + } + + /** + * Gets pricing_plan + * + * @return string|null + */ + public function getPricingPlan() + { + return $this->container['pricing_plan']; + } + + /** + * Sets pricing_plan + * + * @param string|null $pricing_plan Sets the pricing plan for the merchant account. Required for an Adyen for Platforms Manage integration. Your Adyen contact will provide the values that you can use. + * + * @return self + */ + public function setPricingPlan($pricing_plan) + { + if (is_null($pricing_plan)) { + throw new \InvalidArgumentException('non-nullable pricing_plan cannot be null'); + } + $this->container['pricing_plan'] = $pricing_plan; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the merchant account. To make this reference the unique identifier of the merchant account, your Adyen contact can set up a template on your company account. The template can have 6 to 255 characters with upper- and lower-case letters, underscores, and numbers. When your company account has a template, then the `reference` is required and must be unique within the company account. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets sales_channels + * + * @return string[]|null + */ + public function getSalesChannels() + { + return $this->container['sales_channels']; + } + + /** + * Sets sales_channels + * + * @param string[]|null $sales_channels List of sales channels that the merchant will process payments with + * + * @return self + */ + public function setSalesChannels($sales_channels) + { + if (is_null($sales_channels)) { + throw new \InvalidArgumentException('non-nullable sales_channels cannot be null'); + } + $this->container['sales_channels'] = $sales_channels; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateMerchantResponse.php b/src/Adyen/Model/Management/CreateMerchantResponse.php new file mode 100644 index 000000000..afad2189b --- /dev/null +++ b/src/Adyen/Model/Management/CreateMerchantResponse.php @@ -0,0 +1,589 @@ + + */ +class CreateMerchantResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateMerchantResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'business_line_id' => 'string', + 'company_id' => 'string', + 'description' => 'string', + 'id' => 'string', + 'legal_entity_id' => 'string', + 'pricing_plan' => 'string', + 'reference' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'business_line_id' => null, + 'company_id' => null, + 'description' => null, + 'id' => null, + 'legal_entity_id' => null, + 'pricing_plan' => null, + 'reference' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'business_line_id' => false, + 'company_id' => false, + 'description' => false, + 'id' => false, + 'legal_entity_id' => false, + 'pricing_plan' => false, + 'reference' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'business_line_id' => 'businessLineId', + 'company_id' => 'companyId', + 'description' => 'description', + 'id' => 'id', + 'legal_entity_id' => 'legalEntityId', + 'pricing_plan' => 'pricingPlan', + 'reference' => 'reference' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'business_line_id' => 'setBusinessLineId', + 'company_id' => 'setCompanyId', + 'description' => 'setDescription', + 'id' => 'setId', + 'legal_entity_id' => 'setLegalEntityId', + 'pricing_plan' => 'setPricingPlan', + 'reference' => 'setReference' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'business_line_id' => 'getBusinessLineId', + 'company_id' => 'getCompanyId', + 'description' => 'getDescription', + 'id' => 'getId', + 'legal_entity_id' => 'getLegalEntityId', + 'pricing_plan' => 'getPricingPlan', + 'reference' => 'getReference' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('business_line_id', $data ?? [], null); + $this->setIfExists('company_id', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('legal_entity_id', $data ?? [], null); + $this->setIfExists('pricing_plan', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets business_line_id + * + * @return string|null + */ + public function getBusinessLineId() + { + return $this->container['business_line_id']; + } + + /** + * Sets business_line_id + * + * @param string|null $business_line_id The unique identifier of the [business line](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines). + * + * @return self + */ + public function setBusinessLineId($business_line_id) + { + if (is_null($business_line_id)) { + throw new \InvalidArgumentException('non-nullable business_line_id cannot be null'); + } + $this->container['business_line_id'] = $business_line_id; + + return $this; + } + + /** + * Gets company_id + * + * @return string|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param string|null $company_id The unique identifier of the company account. + * + * @return self + */ + public function setCompanyId($company_id) + { + if (is_null($company_id)) { + throw new \InvalidArgumentException('non-nullable company_id cannot be null'); + } + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the merchant account, maximum 300 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the merchant account. If Adyen set up a template for the `reference`, then the `id` will have the same value as the `reference` that you sent in the request. Otherwise, the value is generated by Adyen. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets legal_entity_id + * + * @return string|null + */ + public function getLegalEntityId() + { + return $this->container['legal_entity_id']; + } + + /** + * Sets legal_entity_id + * + * @param string|null $legal_entity_id The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities). + * + * @return self + */ + public function setLegalEntityId($legal_entity_id) + { + if (is_null($legal_entity_id)) { + throw new \InvalidArgumentException('non-nullable legal_entity_id cannot be null'); + } + $this->container['legal_entity_id'] = $legal_entity_id; + + return $this; + } + + /** + * Gets pricing_plan + * + * @return string|null + */ + public function getPricingPlan() + { + return $this->container['pricing_plan']; + } + + /** + * Sets pricing_plan + * + * @param string|null $pricing_plan Partner pricing plan for the merchant, applicable for merchants under AfP managed company accounts. + * + * @return self + */ + public function setPricingPlan($pricing_plan) + { + if (is_null($pricing_plan)) { + throw new \InvalidArgumentException('non-nullable pricing_plan cannot be null'); + } + $this->container['pricing_plan'] = $pricing_plan; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the merchant account. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateMerchantUserRequest.php b/src/Adyen/Model/Management/CreateMerchantUserRequest.php new file mode 100644 index 000000000..8940a5fc8 --- /dev/null +++ b/src/Adyen/Model/Management/CreateMerchantUserRequest.php @@ -0,0 +1,598 @@ + + */ +class CreateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateMerchantUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_groups' => 'string[]', + 'authn_apps' => 'string[]', + 'email' => 'string', + 'name' => '\Adyen\Model\Management\Name', + 'roles' => 'string[]', + 'time_zone_code' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_groups' => null, + 'authn_apps' => null, + 'email' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_groups' => false, + 'authn_apps' => false, + 'email' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_groups' => 'accountGroups', + 'authn_apps' => 'authnApps', + 'email' => 'email', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_groups' => 'setAccountGroups', + 'authn_apps' => 'setAuthnApps', + 'email' => 'setEmail', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_groups' => 'getAccountGroups', + 'authn_apps' => 'getAuthnApps', + 'email' => 'getEmail', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('authn_apps', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets authn_apps + * + * @return string[]|null + */ + public function getAuthnApps() + { + return $this->container['authn_apps']; + } + + /** + * Sets authn_apps + * + * @param string[]|null $authn_apps Set of authn apps to add to this user + * + * @return self + */ + public function setAuthnApps($authn_apps) + { + if (is_null($authn_apps)) { + throw new \InvalidArgumentException('non-nullable authn_apps cannot be null'); + } + $this->container['authn_apps'] = $authn_apps; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string|null + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string|null $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The username for this user. Allowed length: 255 alphanumeric characters. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php new file mode 100644 index 000000000..0ee2b05ad --- /dev/null +++ b/src/Adyen/Model/Management/CreateMerchantWebhookRequest.php @@ -0,0 +1,952 @@ + + */ +class CreateMerchantWebhookRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateMerchantWebhookRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accepts_expired_certificate' => 'bool', + 'accepts_self_signed_certificate' => 'bool', + 'accepts_untrusted_root_certificate' => 'bool', + 'active' => 'bool', + 'additional_settings' => '\Adyen\Model\Management\AdditionalSettings', + 'communication_format' => 'string', + 'description' => 'string', + 'network_type' => 'string', + 'password' => 'string', + 'populate_soap_action_header' => 'bool', + 'ssl_version' => 'string', + 'type' => 'string', + 'url' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accepts_expired_certificate' => null, + 'accepts_self_signed_certificate' => null, + 'accepts_untrusted_root_certificate' => null, + 'active' => null, + 'additional_settings' => null, + 'communication_format' => null, + 'description' => null, + 'network_type' => null, + 'password' => null, + 'populate_soap_action_header' => null, + 'ssl_version' => null, + 'type' => null, + 'url' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accepts_expired_certificate' => false, + 'accepts_self_signed_certificate' => false, + 'accepts_untrusted_root_certificate' => false, + 'active' => false, + 'additional_settings' => false, + 'communication_format' => false, + 'description' => false, + 'network_type' => false, + 'password' => false, + 'populate_soap_action_header' => false, + 'ssl_version' => false, + 'type' => false, + 'url' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accepts_expired_certificate' => 'acceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'acceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'acceptsUntrustedRootCertificate', + 'active' => 'active', + 'additional_settings' => 'additionalSettings', + 'communication_format' => 'communicationFormat', + 'description' => 'description', + 'network_type' => 'networkType', + 'password' => 'password', + 'populate_soap_action_header' => 'populateSoapActionHeader', + 'ssl_version' => 'sslVersion', + 'type' => 'type', + 'url' => 'url', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accepts_expired_certificate' => 'setAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'setAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'setAcceptsUntrustedRootCertificate', + 'active' => 'setActive', + 'additional_settings' => 'setAdditionalSettings', + 'communication_format' => 'setCommunicationFormat', + 'description' => 'setDescription', + 'network_type' => 'setNetworkType', + 'password' => 'setPassword', + 'populate_soap_action_header' => 'setPopulateSoapActionHeader', + 'ssl_version' => 'setSslVersion', + 'type' => 'setType', + 'url' => 'setUrl', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accepts_expired_certificate' => 'getAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'getAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'getAcceptsUntrustedRootCertificate', + 'active' => 'getActive', + 'additional_settings' => 'getAdditionalSettings', + 'communication_format' => 'getCommunicationFormat', + 'description' => 'getDescription', + 'network_type' => 'getNetworkType', + 'password' => 'getPassword', + 'populate_soap_action_header' => 'getPopulateSoapActionHeader', + 'ssl_version' => 'getSslVersion', + 'type' => 'getType', + 'url' => 'getUrl', + 'username' => 'getUsername' + ]; + + /** + * 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 COMMUNICATION_FORMAT_HTTP = 'http'; + public const COMMUNICATION_FORMAT_JSON = 'json'; + public const COMMUNICATION_FORMAT_SOAP = 'soap'; + public const NETWORK_TYPE_LOCAL = 'LOCAL'; + public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const SSL_VERSION_HTTP = 'HTTP'; + public const SSL_VERSION_SSL = 'SSL'; + public const SSL_VERSION_SSLV3 = 'SSLv3'; + public const SSL_VERSION_TLS = 'TLS'; + public const SSL_VERSION_TLSV1 = 'TLSv1'; + public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; + public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; + public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCommunicationFormatAllowableValues() + { + return [ + self::COMMUNICATION_FORMAT_HTTP, + self::COMMUNICATION_FORMAT_JSON, + self::COMMUNICATION_FORMAT_SOAP, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNetworkTypeAllowableValues() + { + return [ + self::NETWORK_TYPE_LOCAL, + self::NETWORK_TYPE__PUBLIC, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSslVersionAllowableValues() + { + return [ + self::SSL_VERSION_HTTP, + self::SSL_VERSION_SSL, + self::SSL_VERSION_SSLV3, + self::SSL_VERSION_TLS, + self::SSL_VERSION_TLSV1, + self::SSL_VERSION_TLSV1_1, + self::SSL_VERSION_TLSV1_2, + self::SSL_VERSION_TLSV1_3, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accepts_expired_certificate', $data ?? [], null); + $this->setIfExists('accepts_self_signed_certificate', $data ?? [], null); + $this->setIfExists('accepts_untrusted_root_certificate', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('additional_settings', $data ?? [], null); + $this->setIfExists('communication_format', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('network_type', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('populate_soap_action_header', $data ?? [], null); + $this->setIfExists('ssl_version', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['communication_format'] === null) { + $invalidProperties[] = "'communication_format' can't be null"; + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!is_null($this->container['communication_format']) && !in_array($this->container['communication_format'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'communication_format', must be one of '%s'", + $this->container['communication_format'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!is_null($this->container['network_type']) && !in_array($this->container['network_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'network_type', must be one of '%s'", + $this->container['network_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSslVersionAllowableValues(); + if (!is_null($this->container['ssl_version']) && !in_array($this->container['ssl_version'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ssl_version', must be one of '%s'", + $this->container['ssl_version'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' 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 accepts_expired_certificate + * + * @return bool|null + */ + public function getAcceptsExpiredCertificate() + { + return $this->container['accepts_expired_certificate']; + } + + /** + * Sets accepts_expired_certificate + * + * @param bool|null $accepts_expired_certificate Indicates if expired SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsExpiredCertificate($accepts_expired_certificate) + { + if (is_null($accepts_expired_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_expired_certificate cannot be null'); + } + $this->container['accepts_expired_certificate'] = $accepts_expired_certificate; + + return $this; + } + + /** + * Gets accepts_self_signed_certificate + * + * @return bool|null + */ + public function getAcceptsSelfSignedCertificate() + { + return $this->container['accepts_self_signed_certificate']; + } + + /** + * Sets accepts_self_signed_certificate + * + * @param bool|null $accepts_self_signed_certificate Indicates if self-signed SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsSelfSignedCertificate($accepts_self_signed_certificate) + { + if (is_null($accepts_self_signed_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_self_signed_certificate cannot be null'); + } + $this->container['accepts_self_signed_certificate'] = $accepts_self_signed_certificate; + + return $this; + } + + /** + * Gets accepts_untrusted_root_certificate + * + * @return bool|null + */ + public function getAcceptsUntrustedRootCertificate() + { + return $this->container['accepts_untrusted_root_certificate']; + } + + /** + * Sets accepts_untrusted_root_certificate + * + * @param bool|null $accepts_untrusted_root_certificate Indicates if untrusted SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsUntrustedRootCertificate($accepts_untrusted_root_certificate) + { + if (is_null($accepts_untrusted_root_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_untrusted_root_certificate cannot be null'); + } + $this->container['accepts_untrusted_root_certificate'] = $accepts_untrusted_root_certificate; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets additional_settings + * + * @return \Adyen\Model\Management\AdditionalSettings|null + */ + public function getAdditionalSettings() + { + return $this->container['additional_settings']; + } + + /** + * Sets additional_settings + * + * @param \Adyen\Model\Management\AdditionalSettings|null $additional_settings additional_settings + * + * @return self + */ + public function setAdditionalSettings($additional_settings) + { + if (is_null($additional_settings)) { + throw new \InvalidArgumentException('non-nullable additional_settings cannot be null'); + } + $this->container['additional_settings'] = $additional_settings; + + return $this; + } + + /** + * Gets communication_format + * + * @return string + */ + public function getCommunicationFormat() + { + return $this->container['communication_format']; + } + + /** + * Sets communication_format + * + * @param string $communication_format Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + * + * @return self + */ + public function setCommunicationFormat($communication_format) + { + if (is_null($communication_format)) { + throw new \InvalidArgumentException('non-nullable communication_format cannot be null'); + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!in_array($communication_format, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'communication_format', must be one of '%s'", + $communication_format, + implode("', '", $allowedValues) + ) + ); + } + $this->container['communication_format'] = $communication_format; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for this webhook configuration. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets network_type + * + * @return string|null + */ + public function getNetworkType() + { + return $this->container['network_type']; + } + + /** + * Sets network_type + * + * @param string|null $network_type Network type for Terminal API notification webhooks. Possible values: * **public** * **local** Default Value: **public**. + * + * @return self + */ + public function setNetworkType($network_type) + { + if (is_null($network_type)) { + throw new \InvalidArgumentException('non-nullable network_type cannot be null'); + } + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!in_array($network_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'network_type', must be one of '%s'", + $network_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['network_type'] = $network_type; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password Password to access the webhook URL. + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets populate_soap_action_header + * + * @return bool|null + */ + public function getPopulateSoapActionHeader() + { + return $this->container['populate_soap_action_header']; + } + + /** + * Sets populate_soap_action_header + * + * @param bool|null $populate_soap_action_header Indicates if the SOAP action header needs to be populated. Default value: **false**. Only applies if `communicationFormat`: **soap**. + * + * @return self + */ + public function setPopulateSoapActionHeader($populate_soap_action_header) + { + if (is_null($populate_soap_action_header)) { + throw new \InvalidArgumentException('non-nullable populate_soap_action_header cannot be null'); + } + $this->container['populate_soap_action_header'] = $populate_soap_action_header; + + return $this; + } + + /** + * Gets ssl_version + * + * @return string|null + */ + public function getSslVersion() + { + return $this->container['ssl_version']; + } + + /** + * Sets ssl_version + * + * @param string|null $ssl_version SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. + * + * @return self + */ + public function setSslVersion($ssl_version) + { + if (is_null($ssl_version)) { + throw new \InvalidArgumentException('non-nullable ssl_version cannot be null'); + } + $allowedValues = $this->getSslVersionAllowableValues(); + if (!in_array($ssl_version, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ssl_version', must be one of '%s'", + $ssl_version, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ssl_version'] = $ssl_version; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of webhook that is being created. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **rreq-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username Username to access the webhook URL. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CreateUserResponse.php b/src/Adyen/Model/Management/CreateUserResponse.php new file mode 100644 index 000000000..3799c2e4c --- /dev/null +++ b/src/Adyen/Model/Management/CreateUserResponse.php @@ -0,0 +1,706 @@ + + */ +class CreateUserResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateUserResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\Links', + 'account_groups' => 'string[]', + 'active' => 'bool', + 'authn_apps' => 'string[]', + 'email' => 'string', + 'id' => 'string', + 'name' => '\Adyen\Model\Management\Name', + 'roles' => 'string[]', + 'time_zone_code' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'account_groups' => null, + 'active' => null, + 'authn_apps' => null, + 'email' => null, + 'id' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'account_groups' => false, + 'active' => false, + 'authn_apps' => false, + 'email' => false, + 'id' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'account_groups' => 'accountGroups', + 'active' => 'active', + 'authn_apps' => 'authnApps', + 'email' => 'email', + 'id' => 'id', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'account_groups' => 'setAccountGroups', + 'active' => 'setActive', + 'authn_apps' => 'setAuthnApps', + 'email' => 'setEmail', + 'id' => 'setId', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'account_groups' => 'getAccountGroups', + 'active' => 'getActive', + 'authn_apps' => 'getAuthnApps', + 'email' => 'getEmail', + 'id' => 'getId', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('authn_apps', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['time_zone_code'] === null) { + $invalidProperties[] = "'time_zone_code' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\Links|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\Links|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates whether this user is active. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets authn_apps + * + * @return string[]|null + */ + public function getAuthnApps() + { + return $this->container['authn_apps']; + } + + /** + * Sets authn_apps + * + * @param string[]|null $authn_apps Set of authn apps available to this user + * + * @return self + */ + public function setAuthnApps($authn_apps) + { + if (is_null($authn_apps)) { + throw new \InvalidArgumentException('non-nullable authn_apps cannot be null'); + } + $this->container['authn_apps'] = $authn_apps; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the user. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The username for this user. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Currency.php b/src/Adyen/Model/Management/Currency.php new file mode 100644 index 000000000..9630248c9 --- /dev/null +++ b/src/Adyen/Model/Management/Currency.php @@ -0,0 +1,454 @@ + + */ +class Currency implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Currency'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => 'int', + 'currency_code' => 'string', + 'percentage' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => 'int32', + 'currency_code' => null, + 'percentage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => true, + 'currency_code' => false, + 'percentage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'currency_code' => 'currencyCode', + 'percentage' => 'percentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'currency_code' => 'setCurrencyCode', + 'percentage' => 'setPercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'currency_code' => 'getCurrencyCode', + 'percentage' => 'getPercentage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('currency_code', $data ?? [], null); + $this->setIfExists('percentage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency_code'] === null) { + $invalidProperties[] = "'currency_code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return int|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param int|null $amount Surcharge amount per transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setAmount($amount) + { + // Do nothing for nullable integers + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets currency_code + * + * @return string + */ + public function getCurrencyCode() + { + return $this->container['currency_code']; + } + + /** + * Sets currency_code + * + * @param string $currency_code Three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). For example, **AUD**. + * + * @return self + */ + public function setCurrencyCode($currency_code) + { + if (is_null($currency_code)) { + throw new \InvalidArgumentException('non-nullable currency_code cannot be null'); + } + $this->container['currency_code'] = $currency_code; + + return $this; + } + + /** + * Gets percentage + * + * @return object|null + */ + public function getPercentage() + { + return $this->container['percentage']; + } + + /** + * Sets percentage + * + * @param object|null $percentage percentage + * + * @return self + */ + public function setPercentage($percentage) + { + if (is_null($percentage)) { + throw new \InvalidArgumentException('non-nullable percentage cannot be null'); + } + $this->container['percentage'] = $percentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/CustomNotification.php b/src/Adyen/Model/Management/CustomNotification.php new file mode 100644 index 000000000..8ca590358 --- /dev/null +++ b/src/Adyen/Model/Management/CustomNotification.php @@ -0,0 +1,589 @@ + + */ +class CustomNotification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CustomNotification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => '\Adyen\Model\Management\Amount', + 'event_code' => 'string', + 'event_date' => '\DateTime', + 'merchant_reference' => 'string', + 'payment_method' => 'string', + 'reason' => 'string', + 'success' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'event_code' => null, + 'event_date' => 'date-time', + 'merchant_reference' => null, + 'payment_method' => null, + 'reason' => null, + 'success' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => false, + 'event_code' => false, + 'event_date' => false, + 'merchant_reference' => false, + 'payment_method' => false, + 'reason' => false, + 'success' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'event_code' => 'eventCode', + 'event_date' => 'eventDate', + 'merchant_reference' => 'merchantReference', + 'payment_method' => 'paymentMethod', + 'reason' => 'reason', + 'success' => 'success' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'event_code' => 'setEventCode', + 'event_date' => 'setEventDate', + 'merchant_reference' => 'setMerchantReference', + 'payment_method' => 'setPaymentMethod', + 'reason' => 'setReason', + 'success' => 'setSuccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'event_code' => 'getEventCode', + 'event_date' => 'getEventDate', + 'merchant_reference' => 'getMerchantReference', + 'payment_method' => 'getPaymentMethod', + 'reason' => 'getReason', + 'success' => 'getSuccess' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('event_code', $data ?? [], null); + $this->setIfExists('event_date', $data ?? [], null); + $this->setIfExists('merchant_reference', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('success', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return \Adyen\Model\Management\Amount|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param \Adyen\Model\Management\Amount|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets event_code + * + * @return string|null + */ + public function getEventCode() + { + return $this->container['event_code']; + } + + /** + * Sets event_code + * + * @param string|null $event_code The event that caused the notification to be sent.Currently supported values: * **AUTHORISATION** * **CANCELLATION** * **REFUND** * **CAPTURE** * **DEACTIVATE_RECURRING** * **REPORT_AVAILABLE** * **CHARGEBACK** * **REQUEST_FOR_INFORMATION** * **NOTIFICATION_OF_CHARGEBACK** * **NOTIFICATIONTEST** * **ORDER_OPENED** * **ORDER_CLOSED** * **CHARGEBACK_REVERSED** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** + * + * @return self + */ + public function setEventCode($event_code) + { + if (is_null($event_code)) { + throw new \InvalidArgumentException('non-nullable event_code cannot be null'); + } + $this->container['event_code'] = $event_code; + + return $this; + } + + /** + * Gets event_date + * + * @return \DateTime|null + */ + public function getEventDate() + { + return $this->container['event_date']; + } + + /** + * Sets event_date + * + * @param \DateTime|null $event_date The time of the event. Format: [ISO 8601](http://www.w3.org/TR/NOTE-datetime), YYYY-MM-DDThh:mm:ssTZD. + * + * @return self + */ + public function setEventDate($event_date) + { + if (is_null($event_date)) { + throw new \InvalidArgumentException('non-nullable event_date cannot be null'); + } + $this->container['event_date'] = $event_date; + + return $this; + } + + /** + * Gets merchant_reference + * + * @return string|null + */ + public function getMerchantReference() + { + return $this->container['merchant_reference']; + } + + /** + * Sets merchant_reference + * + * @param string|null $merchant_reference Your reference for the custom test notification. + * + * @return self + */ + public function setMerchantReference($merchant_reference) + { + if (is_null($merchant_reference)) { + throw new \InvalidArgumentException('non-nullable merchant_reference cannot be null'); + } + $this->container['merchant_reference'] = $merchant_reference; + + return $this; + } + + /** + * Gets payment_method + * + * @return string|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param string|null $payment_method The payment method for the payment that the notification is about. Possible values: * **amex** * **visa** * **mc** * **maestro** * **bcmc** * **paypal** * **sms** * **bankTransfer_NL** * **bankTransfer_DE** * **bankTransfer_BE** * **ideal** * **elv** * **sepadirectdebit** + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason A descripton of what caused the notification. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success The outcome of the event which the notification is about. Set to either **true** or **false**. + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/DataCenter.php b/src/Adyen/Model/Management/DataCenter.php new file mode 100644 index 000000000..d94327591 --- /dev/null +++ b/src/Adyen/Model/Management/DataCenter.php @@ -0,0 +1,419 @@ + + */ +class DataCenter implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DataCenter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'live_prefix' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'live_prefix' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'live_prefix' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'live_prefix' => 'livePrefix', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'live_prefix' => 'setLivePrefix', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'live_prefix' => 'getLivePrefix', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('live_prefix', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets live_prefix + * + * @return string|null + */ + public function getLivePrefix() + { + return $this->container['live_prefix']; + } + + /** + * Sets live_prefix + * + * @param string|null $live_prefix The unique [live URL prefix](https://docs.adyen.com/development-resources/live-endpoints#live-url-prefix) for your live endpoint. Each data center has its own live URL prefix. This field is empty for requests made in the test environment. + * + * @return self + */ + public function setLivePrefix($live_prefix) + { + if (is_null($live_prefix)) { + throw new \InvalidArgumentException('non-nullable live_prefix cannot be null'); + } + $this->container['live_prefix'] = $live_prefix; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name assigned to a data center, for example **EU** for the European data center. Possible values are: * **default**: the European data center. This value is always returned in the test environment. * **AU** * **EU** * **US** + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/EventUrl.php b/src/Adyen/Model/Management/EventUrl.php new file mode 100644 index 000000000..f69147250 --- /dev/null +++ b/src/Adyen/Model/Management/EventUrl.php @@ -0,0 +1,419 @@ + + */ +class EventUrl implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EventUrl'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'event_local_urls' => '\Adyen\Model\Management\Url[]', + 'event_public_urls' => '\Adyen\Model\Management\Url[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'event_local_urls' => null, + 'event_public_urls' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'event_local_urls' => false, + 'event_public_urls' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'event_local_urls' => 'eventLocalUrls', + 'event_public_urls' => 'eventPublicUrls' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'event_local_urls' => 'setEventLocalUrls', + 'event_public_urls' => 'setEventPublicUrls' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'event_local_urls' => 'getEventLocalUrls', + 'event_public_urls' => 'getEventPublicUrls' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('event_local_urls', $data ?? [], null); + $this->setIfExists('event_public_urls', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets event_local_urls + * + * @return \Adyen\Model\Management\Url[]|null + */ + public function getEventLocalUrls() + { + return $this->container['event_local_urls']; + } + + /** + * Sets event_local_urls + * + * @param \Adyen\Model\Management\Url[]|null $event_local_urls One or more local URLs to send event notifications to when using Terminal API. + * + * @return self + */ + public function setEventLocalUrls($event_local_urls) + { + if (is_null($event_local_urls)) { + throw new \InvalidArgumentException('non-nullable event_local_urls cannot be null'); + } + $this->container['event_local_urls'] = $event_local_urls; + + return $this; + } + + /** + * Gets event_public_urls + * + * @return \Adyen\Model\Management\Url[]|null + */ + public function getEventPublicUrls() + { + return $this->container['event_public_urls']; + } + + /** + * Sets event_public_urls + * + * @param \Adyen\Model\Management\Url[]|null $event_public_urls One or more public URLs to send event notifications to when using Terminal API. + * + * @return self + */ + public function setEventPublicUrls($event_public_urls) + { + if (is_null($event_public_urls)) { + throw new \InvalidArgumentException('non-nullable event_public_urls cannot be null'); + } + $this->container['event_public_urls'] = $event_public_urls; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ExternalTerminalAction.php b/src/Adyen/Model/Management/ExternalTerminalAction.php new file mode 100644 index 000000000..f631c4cf5 --- /dev/null +++ b/src/Adyen/Model/Management/ExternalTerminalAction.php @@ -0,0 +1,623 @@ + + */ +class ExternalTerminalAction implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExternalTerminalAction'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action_type' => 'string', + 'config' => 'string', + 'confirmed_at' => '\DateTime', + 'id' => 'string', + 'result' => 'string', + 'scheduled_at' => '\DateTime', + 'status' => 'string', + 'terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action_type' => null, + 'config' => null, + 'confirmed_at' => 'date-time', + 'id' => null, + 'result' => null, + 'scheduled_at' => 'date-time', + 'status' => null, + 'terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'action_type' => false, + 'config' => false, + 'confirmed_at' => false, + 'id' => false, + 'result' => false, + 'scheduled_at' => false, + 'status' => false, + 'terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action_type' => 'actionType', + 'config' => 'config', + 'confirmed_at' => 'confirmedAt', + 'id' => 'id', + 'result' => 'result', + 'scheduled_at' => 'scheduledAt', + 'status' => 'status', + 'terminal_id' => 'terminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action_type' => 'setActionType', + 'config' => 'setConfig', + 'confirmed_at' => 'setConfirmedAt', + 'id' => 'setId', + 'result' => 'setResult', + 'scheduled_at' => 'setScheduledAt', + 'status' => 'setStatus', + 'terminal_id' => 'setTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action_type' => 'getActionType', + 'config' => 'getConfig', + 'confirmed_at' => 'getConfirmedAt', + 'id' => 'getId', + 'result' => 'getResult', + 'scheduled_at' => 'getScheduledAt', + 'status' => 'getStatus', + 'terminal_id' => 'getTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('action_type', $data ?? [], null); + $this->setIfExists('config', $data ?? [], null); + $this->setIfExists('confirmed_at', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('scheduled_at', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action_type + * + * @return string|null + */ + public function getActionType() + { + return $this->container['action_type']; + } + + /** + * Sets action_type + * + * @param string|null $action_type The type of terminal action: **InstallAndroidApp**, **UninstallAndroidApp**, **InstallAndroidCertificate**, or **UninstallAndroidCertificate**. + * + * @return self + */ + public function setActionType($action_type) + { + if (is_null($action_type)) { + throw new \InvalidArgumentException('non-nullable action_type cannot be null'); + } + $this->container['action_type'] = $action_type; + + return $this; + } + + /** + * Gets config + * + * @return string|null + */ + public function getConfig() + { + return $this->container['config']; + } + + /** + * Sets config + * + * @param string|null $config Technical information about the terminal action. + * + * @return self + */ + public function setConfig($config) + { + if (is_null($config)) { + throw new \InvalidArgumentException('non-nullable config cannot be null'); + } + $this->container['config'] = $config; + + return $this; + } + + /** + * Gets confirmed_at + * + * @return \DateTime|null + */ + public function getConfirmedAt() + { + return $this->container['confirmed_at']; + } + + /** + * Sets confirmed_at + * + * @param \DateTime|null $confirmed_at The date and time when the action was carried out. + * + * @return self + */ + public function setConfirmedAt($confirmed_at) + { + if (is_null($confirmed_at)) { + throw new \InvalidArgumentException('non-nullable confirmed_at cannot be null'); + } + $this->container['confirmed_at'] = $confirmed_at; + + 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 terminal action. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets result + * + * @return string|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param string|null $result The result message for the action. + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets scheduled_at + * + * @return \DateTime|null + */ + public function getScheduledAt() + { + return $this->container['scheduled_at']; + } + + /** + * Sets scheduled_at + * + * @param \DateTime|null $scheduled_at The date and time when the action was scheduled to happen. + * + * @return self + */ + public function setScheduledAt($scheduled_at) + { + if (is_null($scheduled_at)) { + throw new \InvalidArgumentException('non-nullable scheduled_at cannot be null'); + } + $this->container['scheduled_at'] = $scheduled_at; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the terminal action: **pending**, **successful**, **failed**, **cancelled**, or **tryLater**. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets terminal_id + * + * @return string|null + */ + public function getTerminalId() + { + return $this->container['terminal_id']; + } + + /** + * Sets terminal_id + * + * @param string|null $terminal_id The unique ID of the terminal that the action applies to. + * + * @return self + */ + public function setTerminalId($terminal_id) + { + if (is_null($terminal_id)) { + throw new \InvalidArgumentException('non-nullable terminal_id cannot be null'); + } + $this->container['terminal_id'] = $terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/File.php b/src/Adyen/Model/Management/File.php new file mode 100644 index 000000000..38decdbe3 --- /dev/null +++ b/src/Adyen/Model/Management/File.php @@ -0,0 +1,425 @@ + + */ +class File implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'File'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 data + * + * @return string + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string $data The certificate content converted to a Base64-encoded string. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the certificate. Must be unique across Wi-Fi profiles. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/GenerateApiKeyResponse.php b/src/Adyen/Model/Management/GenerateApiKeyResponse.php new file mode 100644 index 000000000..38118f0ad --- /dev/null +++ b/src/Adyen/Model/Management/GenerateApiKeyResponse.php @@ -0,0 +1,388 @@ + + */ +class GenerateApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateApiKeyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'api_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'api_key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'api_key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'api_key' => 'apiKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'api_key' => 'setApiKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'api_key' => 'getApiKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('api_key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['api_key'] === null) { + $invalidProperties[] = "'api_key' 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 api_key + * + * @return string + */ + public function getApiKey() + { + return $this->container['api_key']; + } + + /** + * Sets api_key + * + * @param string $api_key The generated API key. + * + * @return self + */ + public function setApiKey($api_key) + { + if (is_null($api_key)) { + throw new \InvalidArgumentException('non-nullable api_key cannot be null'); + } + $this->container['api_key'] = $api_key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/GenerateClientKeyResponse.php b/src/Adyen/Model/Management/GenerateClientKeyResponse.php new file mode 100644 index 000000000..c06b56780 --- /dev/null +++ b/src/Adyen/Model/Management/GenerateClientKeyResponse.php @@ -0,0 +1,388 @@ + + */ +class GenerateClientKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateClientKeyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'client_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'client_key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'client_key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'client_key' => 'clientKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'client_key' => 'setClientKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'client_key' => 'getClientKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('client_key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['client_key'] === null) { + $invalidProperties[] = "'client_key' 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 client_key + * + * @return string + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string $client_key Generated client key + * + * @return self + */ + public function setClientKey($client_key) + { + if (is_null($client_key)) { + throw new \InvalidArgumentException('non-nullable client_key cannot be null'); + } + $this->container['client_key'] = $client_key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/GenerateHmacKeyResponse.php b/src/Adyen/Model/Management/GenerateHmacKeyResponse.php new file mode 100644 index 000000000..468989e4f --- /dev/null +++ b/src/Adyen/Model/Management/GenerateHmacKeyResponse.php @@ -0,0 +1,388 @@ + + */ +class GenerateHmacKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenerateHmacKeyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hmac_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hmac_key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'hmac_key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hmac_key' => 'hmacKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hmac_key' => 'setHmacKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hmac_key' => 'getHmacKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('hmac_key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hmac_key'] === null) { + $invalidProperties[] = "'hmac_key' 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 hmac_key + * + * @return string + */ + public function getHmacKey() + { + return $this->container['hmac_key']; + } + + /** + * Sets hmac_key + * + * @param string $hmac_key The HMAC key generated for this webhook. + * + * @return self + */ + public function setHmacKey($hmac_key) + { + if (is_null($hmac_key)) { + throw new \InvalidArgumentException('non-nullable hmac_key cannot be null'); + } + $this->container['hmac_key'] = $hmac_key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/GiroPayInfo.php b/src/Adyen/Model/Management/GiroPayInfo.php new file mode 100644 index 000000000..b24145acf --- /dev/null +++ b/src/Adyen/Model/Management/GiroPayInfo.php @@ -0,0 +1,388 @@ + + */ +class GiroPayInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GiroPayInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'support_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'support_email' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'support_email' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'support_email' => 'supportEmail' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'support_email' => 'setSupportEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'support_email' => 'getSupportEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('support_email', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['support_email'] === null) { + $invalidProperties[] = "'support_email' 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 support_email + * + * @return string + */ + public function getSupportEmail() + { + return $this->container['support_email']; + } + + /** + * Sets support_email + * + * @param string $support_email The email address of merchant support. + * + * @return self + */ + public function setSupportEmail($support_email) + { + if (is_null($support_email)) { + throw new \InvalidArgumentException('non-nullable support_email cannot be null'); + } + $this->container['support_email'] = $support_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/GooglePayInfo.php b/src/Adyen/Model/Management/GooglePayInfo.php new file mode 100644 index 000000000..d6229cbb1 --- /dev/null +++ b/src/Adyen/Model/Management/GooglePayInfo.php @@ -0,0 +1,422 @@ + + */ +class GooglePayInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GooglePayInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_id' => 'string', + 'reuse_merchant_id' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_id' => null, + 'reuse_merchant_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_id' => false, + 'reuse_merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_id' => 'merchantId', + 'reuse_merchant_id' => 'reuseMerchantId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_id' => 'setMerchantId', + 'reuse_merchant_id' => 'setReuseMerchantId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_id' => 'getMerchantId', + 'reuse_merchant_id' => 'getReuseMerchantId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('reuse_merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_id'] === null) { + $invalidProperties[] = "'merchant_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_id + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string $merchant_id Google Pay [Merchant ID](https://support.google.com/paymentscenter/answer/7163092?hl=en). Character length and limitations: 16 alphanumeric characters or 20 numeric characters. + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + + /** + * Gets reuse_merchant_id + * + * @return bool|null + */ + public function getReuseMerchantId() + { + return $this->container['reuse_merchant_id']; + } + + /** + * Sets reuse_merchant_id + * + * @param bool|null $reuse_merchant_id Indicates whether the Google Pay Merchant ID is used for several merchant accounts. Default value: **false**. + * + * @return self + */ + public function setReuseMerchantId($reuse_merchant_id) + { + if (is_null($reuse_merchant_id)) { + throw new \InvalidArgumentException('non-nullable reuse_merchant_id cannot be null'); + } + $this->container['reuse_merchant_id'] = $reuse_merchant_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Gratuity.php b/src/Adyen/Model/Management/Gratuity.php new file mode 100644 index 000000000..1fc2e4c0b --- /dev/null +++ b/src/Adyen/Model/Management/Gratuity.php @@ -0,0 +1,487 @@ + + */ +class Gratuity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Gratuity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allow_custom_amount' => 'bool', + 'currency' => 'string', + 'predefined_tip_entries' => 'string[]', + 'use_predefined_tip_entries' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allow_custom_amount' => null, + 'currency' => null, + 'predefined_tip_entries' => null, + 'use_predefined_tip_entries' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allow_custom_amount' => false, + 'currency' => false, + 'predefined_tip_entries' => false, + 'use_predefined_tip_entries' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allow_custom_amount' => 'allowCustomAmount', + 'currency' => 'currency', + 'predefined_tip_entries' => 'predefinedTipEntries', + 'use_predefined_tip_entries' => 'usePredefinedTipEntries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allow_custom_amount' => 'setAllowCustomAmount', + 'currency' => 'setCurrency', + 'predefined_tip_entries' => 'setPredefinedTipEntries', + 'use_predefined_tip_entries' => 'setUsePredefinedTipEntries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allow_custom_amount' => 'getAllowCustomAmount', + 'currency' => 'getCurrency', + 'predefined_tip_entries' => 'getPredefinedTipEntries', + 'use_predefined_tip_entries' => 'getUsePredefinedTipEntries' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allow_custom_amount', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('predefined_tip_entries', $data ?? [], null); + $this->setIfExists('use_predefined_tip_entries', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allow_custom_amount + * + * @return bool|null + */ + public function getAllowCustomAmount() + { + return $this->container['allow_custom_amount']; + } + + /** + * Sets allow_custom_amount + * + * @param bool|null $allow_custom_amount Indicates whether one of the predefined tipping options is to let the shopper enter a custom tip. If **true**, only three of the other options defined in `predefinedTipEntries` are shown. + * + * @return self + */ + public function setAllowCustomAmount($allow_custom_amount) + { + if (is_null($allow_custom_amount)) { + throw new \InvalidArgumentException('non-nullable allow_custom_amount cannot be null'); + } + $this->container['allow_custom_amount'] = $allow_custom_amount; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency that the tipping settings apply to. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets predefined_tip_entries + * + * @return string[]|null + */ + public function getPredefinedTipEntries() + { + return $this->container['predefined_tip_entries']; + } + + /** + * Sets predefined_tip_entries + * + * @param string[]|null $predefined_tip_entries Tipping options the shopper can choose from if `usePredefinedTipEntries` is **true**. The maximum number of predefined options is four, or three plus the option to enter a custom tip. The options can be a mix of: - A percentage of the transaction amount. Example: **5%** - A tip amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). Example: **500** for a EUR 5 tip. + * + * @return self + */ + public function setPredefinedTipEntries($predefined_tip_entries) + { + if (is_null($predefined_tip_entries)) { + throw new \InvalidArgumentException('non-nullable predefined_tip_entries cannot be null'); + } + $this->container['predefined_tip_entries'] = $predefined_tip_entries; + + return $this; + } + + /** + * Gets use_predefined_tip_entries + * + * @return bool|null + */ + public function getUsePredefinedTipEntries() + { + return $this->container['use_predefined_tip_entries']; + } + + /** + * Sets use_predefined_tip_entries + * + * @param bool|null $use_predefined_tip_entries Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**). + * + * @return self + */ + public function setUsePredefinedTipEntries($use_predefined_tip_entries) + { + if (is_null($use_predefined_tip_entries)) { + throw new \InvalidArgumentException('non-nullable use_predefined_tip_entries cannot be null'); + } + $this->container['use_predefined_tip_entries'] = $use_predefined_tip_entries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Hardware.php b/src/Adyen/Model/Management/Hardware.php new file mode 100644 index 000000000..954d38cc0 --- /dev/null +++ b/src/Adyen/Model/Management/Hardware.php @@ -0,0 +1,383 @@ + + */ +class Hardware implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Hardware'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'display_maximum_back_light' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'display_maximum_back_light' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'display_maximum_back_light' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'display_maximum_back_light' => 'displayMaximumBackLight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'display_maximum_back_light' => 'setDisplayMaximumBackLight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'display_maximum_back_light' => 'getDisplayMaximumBackLight' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('display_maximum_back_light', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets display_maximum_back_light + * + * @return int|null + */ + public function getDisplayMaximumBackLight() + { + return $this->container['display_maximum_back_light']; + } + + /** + * Sets display_maximum_back_light + * + * @param int|null $display_maximum_back_light The brightness of the display when the terminal is being used, expressed as a percentage. + * + * @return self + */ + public function setDisplayMaximumBackLight($display_maximum_back_light) + { + // Do nothing for nullable integers + $this->container['display_maximum_back_light'] = $display_maximum_back_light; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/IdName.php b/src/Adyen/Model/Management/IdName.php new file mode 100644 index 000000000..b1be6ad30 --- /dev/null +++ b/src/Adyen/Model/Management/IdName.php @@ -0,0 +1,419 @@ + + */ +class IdName implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IdName'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + '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, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The identifier of the terminal model. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the terminal model. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/InstallAndroidAppDetails.php b/src/Adyen/Model/Management/InstallAndroidAppDetails.php new file mode 100644 index 000000000..8ff36e707 --- /dev/null +++ b/src/Adyen/Model/Management/InstallAndroidAppDetails.php @@ -0,0 +1,450 @@ + + */ +class InstallAndroidAppDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InstallAndroidAppDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'app_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'app_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'app_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'app_id' => 'appId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'app_id' => 'setAppId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'app_id' => 'getAppId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_INSTALL_ANDROID_APP = 'InstallAndroidApp'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INSTALL_ANDROID_APP, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('app_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'InstallAndroidApp'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets app_id + * + * @return string|null + */ + public function getAppId() + { + return $this->container['app_id']; + } + + /** + * Sets app_id + * + * @param string|null $app_id The unique identifier of the app to be installed. + * + * @return self + */ + public function setAppId($app_id) + { + if (is_null($app_id)) { + throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + } + $this->container['app_id'] = $app_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of terminal action: Install an Android app. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/InstallAndroidCertificateDetails.php b/src/Adyen/Model/Management/InstallAndroidCertificateDetails.php new file mode 100644 index 000000000..33a89c129 --- /dev/null +++ b/src/Adyen/Model/Management/InstallAndroidCertificateDetails.php @@ -0,0 +1,450 @@ + + */ +class InstallAndroidCertificateDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InstallAndroidCertificateDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'certificate_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'certificate_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'certificate_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'certificate_id' => 'certificateId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'certificate_id' => 'setCertificateId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'certificate_id' => 'getCertificateId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_INSTALL_ANDROID_CERTIFICATE = 'InstallAndroidCertificate'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_INSTALL_ANDROID_CERTIFICATE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('certificate_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'InstallAndroidCertificate'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets certificate_id + * + * @return string|null + */ + public function getCertificateId() + { + return $this->container['certificate_id']; + } + + /** + * Sets certificate_id + * + * @param string|null $certificate_id The unique identifier of the certificate to be installed. + * + * @return self + */ + public function setCertificateId($certificate_id) + { + if (is_null($certificate_id)) { + throw new \InvalidArgumentException('non-nullable certificate_id cannot be null'); + } + $this->container['certificate_id'] = $certificate_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of terminal action: Install an Android certificate. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/InvalidField.php b/src/Adyen/Model/Management/InvalidField.php new file mode 100644 index 000000000..86c6e6608 --- /dev/null +++ b/src/Adyen/Model/Management/InvalidField.php @@ -0,0 +1,462 @@ + + */ +class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'name' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'name' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'message' => false, + 'name' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'name' => 'name', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'name' => 'setName', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'name' => 'getName', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Description of the validation error. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The field that has an invalid value. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The invalid value. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/JSONObject.php b/src/Adyen/Model/Management/JSONObject.php new file mode 100644 index 000000000..680bfd0ae --- /dev/null +++ b/src/Adyen/Model/Management/JSONObject.php @@ -0,0 +1,419 @@ + + */ +class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JSONObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paths' => '\Adyen\Model\Management\JSONPath[]', + 'root_path' => '\Adyen\Model\Management\JSONPath' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paths' => null, + 'root_path' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paths' => false, + 'root_path' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'paths' => 'paths', + 'root_path' => 'rootPath' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paths' => 'setPaths', + 'root_path' => 'setRootPath' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paths' => 'getPaths', + 'root_path' => 'getRootPath' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('paths', $data ?? [], null); + $this->setIfExists('root_path', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets paths + * + * @return \Adyen\Model\Management\JSONPath[]|null + */ + public function getPaths() + { + return $this->container['paths']; + } + + /** + * Sets paths + * + * @param \Adyen\Model\Management\JSONPath[]|null $paths paths + * + * @return self + */ + public function setPaths($paths) + { + if (is_null($paths)) { + throw new \InvalidArgumentException('non-nullable paths cannot be null'); + } + $this->container['paths'] = $paths; + + return $this; + } + + /** + * Gets root_path + * + * @return \Adyen\Model\Management\JSONPath|null + */ + public function getRootPath() + { + return $this->container['root_path']; + } + + /** + * Sets root_path + * + * @param \Adyen\Model\Management\JSONPath|null $root_path root_path + * + * @return self + */ + public function setRootPath($root_path) + { + if (is_null($root_path)) { + throw new \InvalidArgumentException('non-nullable root_path cannot be null'); + } + $this->container['root_path'] = $root_path; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/JSONPath.php b/src/Adyen/Model/Management/JSONPath.php new file mode 100644 index 000000000..eb564d99c --- /dev/null +++ b/src/Adyen/Model/Management/JSONPath.php @@ -0,0 +1,385 @@ + + */ +class JSONPath implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JSONPath'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'content' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'content' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('content', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets content + * + * @return string[]|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string[]|null $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Key.php b/src/Adyen/Model/Management/Key.php new file mode 100644 index 000000000..4ea56a06d --- /dev/null +++ b/src/Adyen/Model/Management/Key.php @@ -0,0 +1,451 @@ + + */ +class Key implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Key'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'identifier' => 'string', + 'passphrase' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'identifier' => null, + 'passphrase' => null, + 'version' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'identifier' => false, + 'passphrase' => false, + 'version' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'identifier' => 'identifier', + 'passphrase' => 'passphrase', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'identifier' => 'setIdentifier', + 'passphrase' => 'setPassphrase', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'identifier' => 'getIdentifier', + 'passphrase' => 'getPassphrase', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('identifier', $data ?? [], null); + $this->setIfExists('passphrase', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets identifier + * + * @return string|null + */ + public function getIdentifier() + { + return $this->container['identifier']; + } + + /** + * Sets identifier + * + * @param string|null $identifier The unique identifier of the shared key. + * + * @return self + */ + public function setIdentifier($identifier) + { + if (is_null($identifier)) { + throw new \InvalidArgumentException('non-nullable identifier cannot be null'); + } + $this->container['identifier'] = $identifier; + + return $this; + } + + /** + * Gets passphrase + * + * @return string|null + */ + public function getPassphrase() + { + return $this->container['passphrase']; + } + + /** + * Sets passphrase + * + * @param string|null $passphrase The secure passphrase to protect the shared key. + * + * @return self + */ + public function setPassphrase($passphrase) + { + if (is_null($passphrase)) { + throw new \InvalidArgumentException('non-nullable passphrase cannot be null'); + } + $this->container['passphrase'] = $passphrase; + + return $this; + } + + /** + * Gets version + * + * @return int|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int|null $version The version number of the shared key. + * + * @return self + */ + public function setVersion($version) + { + // Do nothing for nullable integers + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/KlarnaInfo.php b/src/Adyen/Model/Management/KlarnaInfo.php new file mode 100644 index 000000000..2d4d1f9a8 --- /dev/null +++ b/src/Adyen/Model/Management/KlarnaInfo.php @@ -0,0 +1,530 @@ + + */ +class KlarnaInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'KlarnaInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'auto_capture' => 'bool', + 'dispute_email' => 'string', + 'region' => 'string', + 'support_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'auto_capture' => null, + 'dispute_email' => null, + 'region' => null, + 'support_email' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'auto_capture' => false, + 'dispute_email' => false, + 'region' => false, + 'support_email' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'auto_capture' => 'autoCapture', + 'dispute_email' => 'disputeEmail', + 'region' => 'region', + 'support_email' => 'supportEmail' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'auto_capture' => 'setAutoCapture', + 'dispute_email' => 'setDisputeEmail', + 'region' => 'setRegion', + 'support_email' => 'setSupportEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'auto_capture' => 'getAutoCapture', + 'dispute_email' => 'getDisputeEmail', + 'region' => 'getRegion', + 'support_email' => 'getSupportEmail' + ]; + + /** + * 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 REGION_NA = 'NA'; + public const REGION_EU = 'EU'; + public const REGION_CH = 'CH'; + public const REGION_AU = 'AU'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRegionAllowableValues() + { + return [ + self::REGION_NA, + self::REGION_EU, + self::REGION_CH, + self::REGION_AU, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('auto_capture', $data ?? [], null); + $this->setIfExists('dispute_email', $data ?? [], null); + $this->setIfExists('region', $data ?? [], null); + $this->setIfExists('support_email', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['dispute_email'] === null) { + $invalidProperties[] = "'dispute_email' can't be null"; + } + $allowedValues = $this->getRegionAllowableValues(); + if (!is_null($this->container['region']) && !in_array($this->container['region'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'region', must be one of '%s'", + $this->container['region'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['support_email'] === null) { + $invalidProperties[] = "'support_email' 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 auto_capture + * + * @return bool|null + */ + public function getAutoCapture() + { + return $this->container['auto_capture']; + } + + /** + * Sets auto_capture + * + * @param bool|null $auto_capture Indicates the status of [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture). Default value: **false**. + * + * @return self + */ + public function setAutoCapture($auto_capture) + { + if (is_null($auto_capture)) { + throw new \InvalidArgumentException('non-nullable auto_capture cannot be null'); + } + $this->container['auto_capture'] = $auto_capture; + + return $this; + } + + /** + * Gets dispute_email + * + * @return string + */ + public function getDisputeEmail() + { + return $this->container['dispute_email']; + } + + /** + * Sets dispute_email + * + * @param string $dispute_email The email address for disputes. + * + * @return self + */ + public function setDisputeEmail($dispute_email) + { + if (is_null($dispute_email)) { + throw new \InvalidArgumentException('non-nullable dispute_email cannot be null'); + } + $this->container['dispute_email'] = $dispute_email; + + return $this; + } + + /** + * Gets region + * + * @return string|null + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string|null $region The region of operation. For example, **NA**, **EU**, **CH**, **AU**. + * + * @return self + */ + public function setRegion($region) + { + if (is_null($region)) { + throw new \InvalidArgumentException('non-nullable region cannot be null'); + } + $allowedValues = $this->getRegionAllowableValues(); + if (!in_array($region, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'region', must be one of '%s'", + $region, + implode("', '", $allowedValues) + ) + ); + } + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets support_email + * + * @return string + */ + public function getSupportEmail() + { + return $this->container['support_email']; + } + + /** + * Sets support_email + * + * @param string $support_email The email address of merchant support. + * + * @return self + */ + public function setSupportEmail($support_email) + { + if (is_null($support_email)) { + throw new \InvalidArgumentException('non-nullable support_email cannot be null'); + } + $this->container['support_email'] = $support_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Links.php b/src/Adyen/Model/Management/Links.php new file mode 100644 index 000000000..ef0b36547 --- /dev/null +++ b/src/Adyen/Model/Management/Links.php @@ -0,0 +1,388 @@ + + */ +class Links implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Links'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'self' => '\Adyen\Model\Management\LinksElement' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'self' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'self' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'self' => 'self' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'self' => 'setSelf' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'self' => 'getSelf' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('self', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['self'] === null) { + $invalidProperties[] = "'self' 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 self + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getSelf() + { + return $this->container['self']; + } + + /** + * Sets self + * + * @param \Adyen\Model\Management\LinksElement $self self + * + * @return self + */ + public function setSelf($self) + { + if (is_null($self)) { + throw new \InvalidArgumentException('non-nullable self cannot be null'); + } + $this->container['self'] = $self; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/LinksElement.php b/src/Adyen/Model/Management/LinksElement.php new file mode 100644 index 000000000..cbab0ed8d --- /dev/null +++ b/src/Adyen/Model/Management/LinksElement.php @@ -0,0 +1,385 @@ + + */ +class LinksElement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LinksElement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'href' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'href' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'href' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'href' => 'href' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'href' => 'setHref' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'href' => 'getHref' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('href', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets href + * + * @return string|null + */ + public function getHref() + { + return $this->container['href']; + } + + /** + * Sets href + * + * @param string|null $href href + * + * @return self + */ + public function setHref($href) + { + if (is_null($href)) { + throw new \InvalidArgumentException('non-nullable href cannot be null'); + } + $this->container['href'] = $href; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListCompanyApiCredentialsResponse.php b/src/Adyen/Model/Management/ListCompanyApiCredentialsResponse.php new file mode 100644 index 000000000..cb29dff31 --- /dev/null +++ b/src/Adyen/Model/Management/ListCompanyApiCredentialsResponse.php @@ -0,0 +1,489 @@ + + */ +class ListCompanyApiCredentialsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListCompanyApiCredentialsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\CompanyApiCredential[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\CompanyApiCredential[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\CompanyApiCredential[]|null $data The list of API credentials. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListCompanyResponse.php b/src/Adyen/Model/Management/ListCompanyResponse.php new file mode 100644 index 000000000..e205cc18e --- /dev/null +++ b/src/Adyen/Model/Management/ListCompanyResponse.php @@ -0,0 +1,489 @@ + + */ +class ListCompanyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListCompanyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\Company[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\Company[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\Company[]|null $data The list of companies. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListCompanyUsersResponse.php b/src/Adyen/Model/Management/ListCompanyUsersResponse.php new file mode 100644 index 000000000..c0c5d5c87 --- /dev/null +++ b/src/Adyen/Model/Management/ListCompanyUsersResponse.php @@ -0,0 +1,489 @@ + + */ +class ListCompanyUsersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListCompanyUsersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\CompanyUser[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\CompanyUser[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\CompanyUser[]|null $data The list of users. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListExternalTerminalActionsResponse.php b/src/Adyen/Model/Management/ListExternalTerminalActionsResponse.php new file mode 100644 index 000000000..1bf66ac1d --- /dev/null +++ b/src/Adyen/Model/Management/ListExternalTerminalActionsResponse.php @@ -0,0 +1,385 @@ + + */ +class ListExternalTerminalActionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListExternalTerminalActionsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\ExternalTerminalAction[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\ExternalTerminalAction[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\ExternalTerminalAction[]|null $data The list of terminal actions. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListMerchantApiCredentialsResponse.php b/src/Adyen/Model/Management/ListMerchantApiCredentialsResponse.php new file mode 100644 index 000000000..30f0519e1 --- /dev/null +++ b/src/Adyen/Model/Management/ListMerchantApiCredentialsResponse.php @@ -0,0 +1,489 @@ + + */ +class ListMerchantApiCredentialsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListMerchantApiCredentialsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\ApiCredential[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\ApiCredential[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\ApiCredential[]|null $data The list of API credentials. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListMerchantResponse.php b/src/Adyen/Model/Management/ListMerchantResponse.php new file mode 100644 index 000000000..387f12d5d --- /dev/null +++ b/src/Adyen/Model/Management/ListMerchantResponse.php @@ -0,0 +1,489 @@ + + */ +class ListMerchantResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListMerchantResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\Merchant[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\Merchant[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\Merchant[]|null $data The list of merchant accounts. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListMerchantUsersResponse.php b/src/Adyen/Model/Management/ListMerchantUsersResponse.php new file mode 100644 index 000000000..8c7ff6af8 --- /dev/null +++ b/src/Adyen/Model/Management/ListMerchantUsersResponse.php @@ -0,0 +1,489 @@ + + */ +class ListMerchantUsersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListMerchantUsersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\User[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\User[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\User[]|null $data The list of users. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListStoresResponse.php b/src/Adyen/Model/Management/ListStoresResponse.php new file mode 100644 index 000000000..56c3226c2 --- /dev/null +++ b/src/Adyen/Model/Management/ListStoresResponse.php @@ -0,0 +1,489 @@ + + */ +class ListStoresResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListStoresResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\Store[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\Store[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\Store[]|null $data List of stores + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListTerminalsResponse.php b/src/Adyen/Model/Management/ListTerminalsResponse.php new file mode 100644 index 000000000..cd3e1f6b7 --- /dev/null +++ b/src/Adyen/Model/Management/ListTerminalsResponse.php @@ -0,0 +1,385 @@ + + */ +class ListTerminalsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListTerminalsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\Terminal[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\Terminal[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\Terminal[]|null $data The list of terminals. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ListWebhooksResponse.php b/src/Adyen/Model/Management/ListWebhooksResponse.php new file mode 100644 index 000000000..621de0d54 --- /dev/null +++ b/src/Adyen/Model/Management/ListWebhooksResponse.php @@ -0,0 +1,523 @@ + + */ +class ListWebhooksResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListWebhooksResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'account_reference' => 'string', + 'data' => '\Adyen\Model\Management\Webhook[]', + 'items_total' => 'int', + 'pages_total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'account_reference' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'account_reference' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'account_reference' => 'accountReference', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'account_reference' => 'setAccountReference', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'account_reference' => 'getAccountReference', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('account_reference', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets account_reference + * + * @return string|null + */ + public function getAccountReference() + { + return $this->container['account_reference']; + } + + /** + * Sets account_reference + * + * @param string|null $account_reference Reference to the account. + * + * @return self + */ + public function setAccountReference($account_reference) + { + if (is_null($account_reference)) { + throw new \InvalidArgumentException('non-nullable account_reference cannot be null'); + } + $this->container['account_reference'] = $account_reference; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\Webhook[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\Webhook[]|null $data The list of webhooks configured for this account. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Logo.php b/src/Adyen/Model/Management/Logo.php new file mode 100644 index 000000000..c568cfb41 --- /dev/null +++ b/src/Adyen/Model/Management/Logo.php @@ -0,0 +1,385 @@ + + */ +class Logo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Logo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return string|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string|null $data The image file, converted to a Base64-encoded string, of the logo to be shown on the terminal. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/MeApiCredential.php b/src/Adyen/Model/Management/MeApiCredential.php new file mode 100644 index 000000000..29750420d --- /dev/null +++ b/src/Adyen/Model/Management/MeApiCredential.php @@ -0,0 +1,743 @@ + + */ +class MeApiCredential implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MeApiCredential'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\ApiCredentialLinks', + 'active' => 'bool', + 'allowed_ip_addresses' => 'string[]', + 'allowed_origins' => '\Adyen\Model\Management\AllowedOrigin[]', + 'associated_merchant_accounts' => 'string[]', + 'client_key' => 'string', + 'company_name' => 'string', + 'description' => 'string', + 'id' => 'string', + 'roles' => 'string[]', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'active' => null, + 'allowed_ip_addresses' => null, + 'allowed_origins' => null, + 'associated_merchant_accounts' => null, + 'client_key' => null, + 'company_name' => null, + 'description' => null, + 'id' => null, + 'roles' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'active' => false, + 'allowed_ip_addresses' => false, + 'allowed_origins' => false, + 'associated_merchant_accounts' => false, + 'client_key' => false, + 'company_name' => false, + 'description' => false, + 'id' => false, + 'roles' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'active' => 'active', + 'allowed_ip_addresses' => 'allowedIpAddresses', + 'allowed_origins' => 'allowedOrigins', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'client_key' => 'clientKey', + 'company_name' => 'companyName', + 'description' => 'description', + 'id' => 'id', + 'roles' => 'roles', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'active' => 'setActive', + 'allowed_ip_addresses' => 'setAllowedIpAddresses', + 'allowed_origins' => 'setAllowedOrigins', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'client_key' => 'setClientKey', + 'company_name' => 'setCompanyName', + 'description' => 'setDescription', + 'id' => 'setId', + 'roles' => 'setRoles', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'active' => 'getActive', + 'allowed_ip_addresses' => 'getAllowedIpAddresses', + 'allowed_origins' => 'getAllowedOrigins', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'client_key' => 'getClientKey', + 'company_name' => 'getCompanyName', + 'description' => 'getDescription', + 'id' => 'getId', + 'roles' => 'getRoles', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('allowed_ip_addresses', $data ?? [], null); + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('client_key', $data ?? [], null); + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['allowed_ip_addresses'] === null) { + $invalidProperties[] = "'allowed_ip_addresses' can't be null"; + } + if ($this->container['client_key'] === null) { + $invalidProperties[] = "'client_key' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\ApiCredentialLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\ApiCredentialLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the API credential is enabled. Must be set to **true** to use the credential in your integration. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets allowed_ip_addresses + * + * @return string[] + */ + public function getAllowedIpAddresses() + { + return $this->container['allowed_ip_addresses']; + } + + /** + * Sets allowed_ip_addresses + * + * @param string[] $allowed_ip_addresses List of IP addresses from which your client can make requests. If the list is empty, we allow requests from any IP. If the list is not empty and we get a request from an IP which is not on the list, you get a security error. + * + * @return self + */ + public function setAllowedIpAddresses($allowed_ip_addresses) + { + if (is_null($allowed_ip_addresses)) { + throw new \InvalidArgumentException('non-nullable allowed_ip_addresses cannot be null'); + } + $this->container['allowed_ip_addresses'] = $allowed_ip_addresses; + + return $this; + } + + /** + * Gets allowed_origins + * + * @return \Adyen\Model\Management\AllowedOrigin[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param \Adyen\Model\Management\AllowedOrigin[]|null $allowed_origins List containing the [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) linked to the API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts List of merchant accounts that the API credential has explicit access to. If the credential has access to a company, this implies access to all merchant accounts and no merchants for that company will be included. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets client_key + * + * @return string + */ + public function getClientKey() + { + return $this->container['client_key']; + } + + /** + * Sets client_key + * + * @param string $client_key Public key used for [client-side authentication](https://docs.adyen.com/development-resources/client-side-authentication). The client key is required for Drop-in and Components integrations. + * + * @return self + */ + public function setClientKey($client_key) + { + if (is_null($client_key)) { + throw new \InvalidArgumentException('non-nullable client_key cannot be null'); + } + $this->container['client_key'] = $client_key; + + return $this; + } + + /** + * Gets company_name + * + * @return string|null + */ + public function getCompanyName() + { + return $this->container['company_name']; + } + + /** + * Sets company_name + * + * @param string|null $company_name Name of the company linked to the API credential. + * + * @return self + */ + public function setCompanyName($company_name) + { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } + $this->container['company_name'] = $company_name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier of the API credential. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The name of the [API credential](https://docs.adyen.com/development-resources/api-credentials), for example **ws@Company.TestCompany**. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/MealVoucherFRInfo.php b/src/Adyen/Model/Management/MealVoucherFRInfo.php new file mode 100644 index 000000000..f71dd372f --- /dev/null +++ b/src/Adyen/Model/Management/MealVoucherFRInfo.php @@ -0,0 +1,462 @@ + + */ +class MealVoucherFRInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MealVoucherFRInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conecs_id' => 'string', + 'siret' => 'string', + 'sub_types' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conecs_id' => null, + 'siret' => null, + 'sub_types' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conecs_id' => false, + 'siret' => false, + 'sub_types' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conecs_id' => 'conecsId', + 'siret' => 'siret', + 'sub_types' => 'subTypes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conecs_id' => 'setConecsId', + 'siret' => 'setSiret', + 'sub_types' => 'setSubTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conecs_id' => 'getConecsId', + 'siret' => 'getSiret', + 'sub_types' => 'getSubTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('conecs_id', $data ?? [], null); + $this->setIfExists('siret', $data ?? [], null); + $this->setIfExists('sub_types', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['conecs_id'] === null) { + $invalidProperties[] = "'conecs_id' can't be null"; + } + if ($this->container['siret'] === null) { + $invalidProperties[] = "'siret' can't be null"; + } + if ($this->container['sub_types'] === null) { + $invalidProperties[] = "'sub_types' 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 conecs_id + * + * @return string + */ + public function getConecsId() + { + return $this->container['conecs_id']; + } + + /** + * Sets conecs_id + * + * @param string $conecs_id Meal Voucher conecsId. Format: digits only + * + * @return self + */ + public function setConecsId($conecs_id) + { + if (is_null($conecs_id)) { + throw new \InvalidArgumentException('non-nullable conecs_id cannot be null'); + } + $this->container['conecs_id'] = $conecs_id; + + return $this; + } + + /** + * Gets siret + * + * @return string + */ + public function getSiret() + { + return $this->container['siret']; + } + + /** + * Sets siret + * + * @param string $siret Meal Voucher siret. Format: 14 digits. + * + * @return self + */ + public function setSiret($siret) + { + if (is_null($siret)) { + throw new \InvalidArgumentException('non-nullable siret cannot be null'); + } + $this->container['siret'] = $siret; + + return $this; + } + + /** + * Gets sub_types + * + * @return string[] + */ + public function getSubTypes() + { + return $this->container['sub_types']; + } + + /** + * Sets sub_types + * + * @param string[] $sub_types The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. + * + * @return self + */ + public function setSubTypes($sub_types) + { + if (is_null($sub_types)) { + throw new \InvalidArgumentException('non-nullable sub_types cannot be null'); + } + $this->container['sub_types'] = $sub_types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Merchant.php b/src/Adyen/Model/Management/Merchant.php new file mode 100644 index 000000000..488cac11c --- /dev/null +++ b/src/Adyen/Model/Management/Merchant.php @@ -0,0 +1,827 @@ + + */ +class Merchant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Merchant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\MerchantLinks', + 'capture_delay' => 'string', + 'company_id' => 'string', + 'data_centers' => '\Adyen\Model\Management\DataCenter[]', + 'default_shopper_interaction' => 'string', + 'description' => 'string', + 'id' => 'string', + 'merchant_city' => 'string', + 'name' => 'string', + 'pricing_plan' => 'string', + 'primary_settlement_currency' => 'string', + 'reference' => 'string', + 'shop_web_address' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'capture_delay' => null, + 'company_id' => null, + 'data_centers' => null, + 'default_shopper_interaction' => null, + 'description' => null, + 'id' => null, + 'merchant_city' => null, + 'name' => null, + 'pricing_plan' => null, + 'primary_settlement_currency' => null, + 'reference' => null, + 'shop_web_address' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'capture_delay' => false, + 'company_id' => false, + 'data_centers' => false, + 'default_shopper_interaction' => false, + 'description' => false, + 'id' => false, + 'merchant_city' => false, + 'name' => false, + 'pricing_plan' => false, + 'primary_settlement_currency' => false, + 'reference' => false, + 'shop_web_address' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'capture_delay' => 'captureDelay', + 'company_id' => 'companyId', + 'data_centers' => 'dataCenters', + 'default_shopper_interaction' => 'defaultShopperInteraction', + 'description' => 'description', + 'id' => 'id', + 'merchant_city' => 'merchantCity', + 'name' => 'name', + 'pricing_plan' => 'pricingPlan', + 'primary_settlement_currency' => 'primarySettlementCurrency', + 'reference' => 'reference', + 'shop_web_address' => 'shopWebAddress', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'capture_delay' => 'setCaptureDelay', + 'company_id' => 'setCompanyId', + 'data_centers' => 'setDataCenters', + 'default_shopper_interaction' => 'setDefaultShopperInteraction', + 'description' => 'setDescription', + 'id' => 'setId', + 'merchant_city' => 'setMerchantCity', + 'name' => 'setName', + 'pricing_plan' => 'setPricingPlan', + 'primary_settlement_currency' => 'setPrimarySettlementCurrency', + 'reference' => 'setReference', + 'shop_web_address' => 'setShopWebAddress', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'capture_delay' => 'getCaptureDelay', + 'company_id' => 'getCompanyId', + 'data_centers' => 'getDataCenters', + 'default_shopper_interaction' => 'getDefaultShopperInteraction', + 'description' => 'getDescription', + 'id' => 'getId', + 'merchant_city' => 'getMerchantCity', + 'name' => 'getName', + 'pricing_plan' => 'getPricingPlan', + 'primary_settlement_currency' => 'getPrimarySettlementCurrency', + 'reference' => 'getReference', + 'shop_web_address' => 'getShopWebAddress', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('capture_delay', $data ?? [], null); + $this->setIfExists('company_id', $data ?? [], null); + $this->setIfExists('data_centers', $data ?? [], null); + $this->setIfExists('default_shopper_interaction', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_city', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('pricing_plan', $data ?? [], null); + $this->setIfExists('primary_settlement_currency', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shop_web_address', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 _links + * + * @return \Adyen\Model\Management\MerchantLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\MerchantLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets capture_delay + * + * @return string|null + */ + public function getCaptureDelay() + { + return $this->container['capture_delay']; + } + + /** + * Sets capture_delay + * + * @param string|null $capture_delay The [capture delay](https://docs.adyen.com/online-payments/capture#capture-delay) set for the merchant account. Possible values: * **Immediate** * **Manual** * Number of days from **1** to **29** + * + * @return self + */ + public function setCaptureDelay($capture_delay) + { + if (is_null($capture_delay)) { + throw new \InvalidArgumentException('non-nullable capture_delay cannot be null'); + } + $this->container['capture_delay'] = $capture_delay; + + return $this; + } + + /** + * Gets company_id + * + * @return string|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param string|null $company_id The unique identifier of the company account this merchant belongs to + * + * @return self + */ + public function setCompanyId($company_id) + { + if (is_null($company_id)) { + throw new \InvalidArgumentException('non-nullable company_id cannot be null'); + } + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets data_centers + * + * @return \Adyen\Model\Management\DataCenter[]|null + */ + public function getDataCenters() + { + return $this->container['data_centers']; + } + + /** + * Sets data_centers + * + * @param \Adyen\Model\Management\DataCenter[]|null $data_centers List of available data centers. Adyen has several data centers around the world.In the URL that you use for making API requests, we recommend you use the live URL prefix from the data center closest to your shoppers. + * + * @return self + */ + public function setDataCenters($data_centers) + { + if (is_null($data_centers)) { + throw new \InvalidArgumentException('non-nullable data_centers cannot be null'); + } + $this->container['data_centers'] = $data_centers; + + return $this; + } + + /** + * Gets default_shopper_interaction + * + * @return string|null + */ + public function getDefaultShopperInteraction() + { + return $this->container['default_shopper_interaction']; + } + + /** + * Sets default_shopper_interaction + * + * @param string|null $default_shopper_interaction The default [`shopperInteraction`](https://docs.adyen.com/api-explorer/#/CheckoutService/v68/post/payments__reqParam_shopperInteraction) value used when processing payments through this merchant account. + * + * @return self + */ + public function setDefaultShopperInteraction($default_shopper_interaction) + { + if (is_null($default_shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable default_shopper_interaction cannot be null'); + } + $this->container['default_shopper_interaction'] = $default_shopper_interaction; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the merchant account, maximum 300 characters + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the merchant account. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets merchant_city + * + * @return string|null + */ + public function getMerchantCity() + { + return $this->container['merchant_city']; + } + + /** + * Sets merchant_city + * + * @param string|null $merchant_city The city where the legal entity of this merchant account is registered. + * + * @return self + */ + public function setMerchantCity($merchant_city) + { + if (is_null($merchant_city)) { + throw new \InvalidArgumentException('non-nullable merchant_city cannot be null'); + } + $this->container['merchant_city'] = $merchant_city; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the legal entity associated with the merchant account. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets pricing_plan + * + * @return string|null + */ + public function getPricingPlan() + { + return $this->container['pricing_plan']; + } + + /** + * Sets pricing_plan + * + * @param string|null $pricing_plan Only applies to merchant accounts managed by Adyen's partners. The name of the pricing plan assigned to the merchant account. + * + * @return self + */ + public function setPricingPlan($pricing_plan) + { + if (is_null($pricing_plan)) { + throw new \InvalidArgumentException('non-nullable pricing_plan cannot be null'); + } + $this->container['pricing_plan'] = $pricing_plan; + + return $this; + } + + /** + * Gets primary_settlement_currency + * + * @return string|null + */ + public function getPrimarySettlementCurrency() + { + return $this->container['primary_settlement_currency']; + } + + /** + * Sets primary_settlement_currency + * + * @param string|null $primary_settlement_currency The currency of the country where the legal entity of this merchant account is registered. Format: [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). For example, a legal entity based in the United States has USD as the primary settlement currency. + * + * @return self + */ + public function setPrimarySettlementCurrency($primary_settlement_currency) + { + if (is_null($primary_settlement_currency)) { + throw new \InvalidArgumentException('non-nullable primary_settlement_currency cannot be null'); + } + $this->container['primary_settlement_currency'] = $primary_settlement_currency; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Reference of the merchant account. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shop_web_address + * + * @return string|null + */ + public function getShopWebAddress() + { + return $this->container['shop_web_address']; + } + + /** + * Sets shop_web_address + * + * @param string|null $shop_web_address The URL for the ecommerce website used with this merchant account. + * + * @return self + */ + public function setShopWebAddress($shop_web_address) + { + if (is_null($shop_web_address)) { + throw new \InvalidArgumentException('non-nullable shop_web_address cannot be null'); + } + $this->container['shop_web_address'] = $shop_web_address; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the merchant account. Possible values: * **PreActive**: The merchant account has been created. Users cannot access the merchant account in the Customer Area. The account cannot process payments. * **Active**: Users can access the merchant account in the Customer Area. If the company account is also **Active**, then payment processing and payouts are enabled. * **InactiveWithModifications**: Users can access the merchant account in the Customer Area. You cannot process new payments but you can still modify payments, for example issue refunds. You can still receive payouts. * **Inactive**: Users can access the merchant account in the Customer Area. Payment processing and payouts are disabled. * **Closed**: The account is closed and this cannot be reversed. Users cannot log in. Payment processing and payouts are disabled. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/MerchantLinks.php b/src/Adyen/Model/Management/MerchantLinks.php new file mode 100644 index 000000000..cdd226703 --- /dev/null +++ b/src/Adyen/Model/Management/MerchantLinks.php @@ -0,0 +1,490 @@ + + */ +class MerchantLinks implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantLinks'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'api_credentials' => '\Adyen\Model\Management\LinksElement', + 'self' => '\Adyen\Model\Management\LinksElement', + 'users' => '\Adyen\Model\Management\LinksElement', + 'webhooks' => '\Adyen\Model\Management\LinksElement' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'api_credentials' => null, + 'self' => null, + 'users' => null, + 'webhooks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'api_credentials' => false, + 'self' => false, + 'users' => false, + 'webhooks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'api_credentials' => 'apiCredentials', + 'self' => 'self', + 'users' => 'users', + 'webhooks' => 'webhooks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'api_credentials' => 'setApiCredentials', + 'self' => 'setSelf', + 'users' => 'setUsers', + 'webhooks' => 'setWebhooks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'api_credentials' => 'getApiCredentials', + 'self' => 'getSelf', + 'users' => 'getUsers', + 'webhooks' => 'getWebhooks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('api_credentials', $data ?? [], null); + $this->setIfExists('self', $data ?? [], null); + $this->setIfExists('users', $data ?? [], null); + $this->setIfExists('webhooks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['self'] === null) { + $invalidProperties[] = "'self' 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 api_credentials + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getApiCredentials() + { + return $this->container['api_credentials']; + } + + /** + * Sets api_credentials + * + * @param \Adyen\Model\Management\LinksElement|null $api_credentials api_credentials + * + * @return self + */ + public function setApiCredentials($api_credentials) + { + if (is_null($api_credentials)) { + throw new \InvalidArgumentException('non-nullable api_credentials cannot be null'); + } + $this->container['api_credentials'] = $api_credentials; + + return $this; + } + + /** + * Gets self + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getSelf() + { + return $this->container['self']; + } + + /** + * Sets self + * + * @param \Adyen\Model\Management\LinksElement $self self + * + * @return self + */ + public function setSelf($self) + { + if (is_null($self)) { + throw new \InvalidArgumentException('non-nullable self cannot be null'); + } + $this->container['self'] = $self; + + return $this; + } + + /** + * Gets users + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param \Adyen\Model\Management\LinksElement|null $users users + * + * @return self + */ + public function setUsers($users) + { + if (is_null($users)) { + throw new \InvalidArgumentException('non-nullable users cannot be null'); + } + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets webhooks + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getWebhooks() + { + return $this->container['webhooks']; + } + + /** + * Sets webhooks + * + * @param \Adyen\Model\Management\LinksElement|null $webhooks webhooks + * + * @return self + */ + public function setWebhooks($webhooks) + { + if (is_null($webhooks)) { + throw new \InvalidArgumentException('non-nullable webhooks cannot be null'); + } + $this->container['webhooks'] = $webhooks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/MinorUnitsMonetaryValue.php b/src/Adyen/Model/Management/MinorUnitsMonetaryValue.php new file mode 100644 index 000000000..e7f9444e8 --- /dev/null +++ b/src/Adyen/Model/Management/MinorUnitsMonetaryValue.php @@ -0,0 +1,417 @@ + + */ +class MinorUnitsMonetaryValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MinorUnitsMonetaryValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => 'int', + 'currency_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => 'int32', + 'currency_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'amount' => true, + 'currency_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'currency_code' => 'currencyCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'currency_code' => 'setCurrencyCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'currency_code' => 'getCurrencyCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('currency_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return int|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param int|null $amount The transaction amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setAmount($amount) + { + // Do nothing for nullable integers + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets currency_code + * + * @return string|null + */ + public function getCurrencyCode() + { + return $this->container['currency_code']; + } + + /** + * Sets currency_code + * + * @param string|null $currency_code The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrencyCode($currency_code) + { + if (is_null($currency_code)) { + throw new \InvalidArgumentException('non-nullable currency_code cannot be null'); + } + $this->container['currency_code'] = $currency_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ModelInterface.php b/src/Adyen/Model/Management/ModelInterface.php new file mode 100644 index 000000000..01f9d0ba4 --- /dev/null +++ b/src/Adyen/Model/Management/ModelInterface.php @@ -0,0 +1,93 @@ + + */ +class Name implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Name'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string' + ]; + + /** + * 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 + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'first_name' => false, + 'last_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'firstName', + 'last_name' => 'lastName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['first_name'] === null) { + $invalidProperties[] = "'first_name' can't be null"; + } + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' 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 first_name + * + * @return string + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string $first_name The first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string $last_name The last name. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_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 + ); + } +} diff --git a/src/Adyen/Model/Management/Name2.php b/src/Adyen/Model/Management/Name2.php new file mode 100644 index 000000000..b19ff4d57 --- /dev/null +++ b/src/Adyen/Model/Management/Name2.php @@ -0,0 +1,419 @@ + + */ +class Name2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Name2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string' + ]; + + /** + * 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 + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'first_name' => false, + 'last_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'firstName', + 'last_name' => 'lastName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name. + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $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. + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_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 + ); + } +} diff --git a/src/Adyen/Model/Management/Nexo.php b/src/Adyen/Model/Management/Nexo.php new file mode 100644 index 000000000..202b43abd --- /dev/null +++ b/src/Adyen/Model/Management/Nexo.php @@ -0,0 +1,489 @@ + + */ +class Nexo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Nexo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'display_urls' => '\Adyen\Model\Management\NotificationUrl', + 'encryption_key' => '\Adyen\Model\Management\Key', + 'event_urls' => '\Adyen\Model\Management\EventUrl', + 'nexo_event_urls' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'display_urls' => null, + 'encryption_key' => null, + 'event_urls' => null, + 'nexo_event_urls' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'display_urls' => false, + 'encryption_key' => false, + 'event_urls' => false, + 'nexo_event_urls' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'display_urls' => 'displayUrls', + 'encryption_key' => 'encryptionKey', + 'event_urls' => 'eventUrls', + 'nexo_event_urls' => 'nexoEventUrls' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'display_urls' => 'setDisplayUrls', + 'encryption_key' => 'setEncryptionKey', + 'event_urls' => 'setEventUrls', + 'nexo_event_urls' => 'setNexoEventUrls' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'display_urls' => 'getDisplayUrls', + 'encryption_key' => 'getEncryptionKey', + 'event_urls' => 'getEventUrls', + 'nexo_event_urls' => 'getNexoEventUrls' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('display_urls', $data ?? [], null); + $this->setIfExists('encryption_key', $data ?? [], null); + $this->setIfExists('event_urls', $data ?? [], null); + $this->setIfExists('nexo_event_urls', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets display_urls + * + * @return \Adyen\Model\Management\NotificationUrl|null + */ + public function getDisplayUrls() + { + return $this->container['display_urls']; + } + + /** + * Sets display_urls + * + * @param \Adyen\Model\Management\NotificationUrl|null $display_urls display_urls + * + * @return self + */ + public function setDisplayUrls($display_urls) + { + if (is_null($display_urls)) { + throw new \InvalidArgumentException('non-nullable display_urls cannot be null'); + } + $this->container['display_urls'] = $display_urls; + + return $this; + } + + /** + * Gets encryption_key + * + * @return \Adyen\Model\Management\Key|null + */ + public function getEncryptionKey() + { + return $this->container['encryption_key']; + } + + /** + * Sets encryption_key + * + * @param \Adyen\Model\Management\Key|null $encryption_key encryption_key + * + * @return self + */ + public function setEncryptionKey($encryption_key) + { + if (is_null($encryption_key)) { + throw new \InvalidArgumentException('non-nullable encryption_key cannot be null'); + } + $this->container['encryption_key'] = $encryption_key; + + return $this; + } + + /** + * Gets event_urls + * + * @return \Adyen\Model\Management\EventUrl|null + */ + public function getEventUrls() + { + return $this->container['event_urls']; + } + + /** + * Sets event_urls + * + * @param \Adyen\Model\Management\EventUrl|null $event_urls event_urls + * + * @return self + */ + public function setEventUrls($event_urls) + { + if (is_null($event_urls)) { + throw new \InvalidArgumentException('non-nullable event_urls cannot be null'); + } + $this->container['event_urls'] = $event_urls; + + return $this; + } + + /** + * Gets nexo_event_urls + * + * @return string[]|null + * @deprecated + */ + public function getNexoEventUrls() + { + return $this->container['nexo_event_urls']; + } + + /** + * Sets nexo_event_urls + * + * @param string[]|null $nexo_event_urls One or more URLs to send event messages to when using Terminal API. + * + * @return self + * @deprecated + */ + public function setNexoEventUrls($nexo_event_urls) + { + if (is_null($nexo_event_urls)) { + throw new \InvalidArgumentException('non-nullable nexo_event_urls cannot be null'); + } + $this->container['nexo_event_urls'] = $nexo_event_urls; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/NotificationUrl.php b/src/Adyen/Model/Management/NotificationUrl.php new file mode 100644 index 000000000..d2f6b1027 --- /dev/null +++ b/src/Adyen/Model/Management/NotificationUrl.php @@ -0,0 +1,419 @@ + + */ +class NotificationUrl implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NotificationUrl'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'local_urls' => '\Adyen\Model\Management\Url[]', + 'public_urls' => '\Adyen\Model\Management\Url[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'local_urls' => null, + 'public_urls' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'local_urls' => false, + 'public_urls' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'local_urls' => 'localUrls', + 'public_urls' => 'publicUrls' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'local_urls' => 'setLocalUrls', + 'public_urls' => 'setPublicUrls' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'local_urls' => 'getLocalUrls', + 'public_urls' => 'getPublicUrls' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('local_urls', $data ?? [], null); + $this->setIfExists('public_urls', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets local_urls + * + * @return \Adyen\Model\Management\Url[]|null + */ + public function getLocalUrls() + { + return $this->container['local_urls']; + } + + /** + * Sets local_urls + * + * @param \Adyen\Model\Management\Url[]|null $local_urls One or more local URLs to send notifications to when using Terminal API. + * + * @return self + */ + public function setLocalUrls($local_urls) + { + if (is_null($local_urls)) { + throw new \InvalidArgumentException('non-nullable local_urls cannot be null'); + } + $this->container['local_urls'] = $local_urls; + + return $this; + } + + /** + * Gets public_urls + * + * @return \Adyen\Model\Management\Url[]|null + */ + public function getPublicUrls() + { + return $this->container['public_urls']; + } + + /** + * Sets public_urls + * + * @param \Adyen\Model\Management\Url[]|null $public_urls One or more public URLs to send notifications to when using Terminal API. + * + * @return self + */ + public function setPublicUrls($public_urls) + { + if (is_null($public_urls)) { + throw new \InvalidArgumentException('non-nullable public_urls cannot be null'); + } + $this->container['public_urls'] = $public_urls; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ObjectSerializer.php b/src/Adyen/Model/Management/ObjectSerializer.php new file mode 100644 index 000000000..29c632915 --- /dev/null +++ b/src/Adyen/Model/Management/ObjectSerializer.php @@ -0,0 +1,318 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/Management/OfflineProcessing.php b/src/Adyen/Model/Management/OfflineProcessing.php new file mode 100644 index 000000000..9d070d060 --- /dev/null +++ b/src/Adyen/Model/Management/OfflineProcessing.php @@ -0,0 +1,417 @@ + + */ +class OfflineProcessing implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OfflineProcessing'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'chip_floor_limit' => 'int', + 'offline_swipe_limits' => '\Adyen\Model\Management\MinorUnitsMonetaryValue[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'chip_floor_limit' => 'int32', + 'offline_swipe_limits' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'chip_floor_limit' => true, + 'offline_swipe_limits' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'chip_floor_limit' => 'chipFloorLimit', + 'offline_swipe_limits' => 'offlineSwipeLimits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'chip_floor_limit' => 'setChipFloorLimit', + 'offline_swipe_limits' => 'setOfflineSwipeLimits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'chip_floor_limit' => 'getChipFloorLimit', + 'offline_swipe_limits' => 'getOfflineSwipeLimits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('chip_floor_limit', $data ?? [], null); + $this->setIfExists('offline_swipe_limits', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets chip_floor_limit + * + * @return int|null + */ + public function getChipFloorLimit() + { + return $this->container['chip_floor_limit']; + } + + /** + * Sets chip_floor_limit + * + * @param int|null $chip_floor_limit The maximum offline transaction amount for chip cards, in the processing currency and specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setChipFloorLimit($chip_floor_limit) + { + // Do nothing for nullable integers + $this->container['chip_floor_limit'] = $chip_floor_limit; + + return $this; + } + + /** + * Gets offline_swipe_limits + * + * @return \Adyen\Model\Management\MinorUnitsMonetaryValue[]|null + */ + public function getOfflineSwipeLimits() + { + return $this->container['offline_swipe_limits']; + } + + /** + * Sets offline_swipe_limits + * + * @param \Adyen\Model\Management\MinorUnitsMonetaryValue[]|null $offline_swipe_limits The maximum offline transaction amount for swiped cards, in the specified currency. + * + * @return self + */ + public function setOfflineSwipeLimits($offline_swipe_limits) + { + if (is_null($offline_swipe_limits)) { + throw new \InvalidArgumentException('non-nullable offline_swipe_limits cannot be null'); + } + $this->container['offline_swipe_limits'] = $offline_swipe_limits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Opi.php b/src/Adyen/Model/Management/Opi.php new file mode 100644 index 000000000..69ad160c2 --- /dev/null +++ b/src/Adyen/Model/Management/Opi.php @@ -0,0 +1,453 @@ + + */ +class Opi implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Opi'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enable_pay_at_table' => 'bool', + 'pay_at_table_store_number' => 'string', + 'pay_at_table_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enable_pay_at_table' => null, + 'pay_at_table_store_number' => null, + 'pay_at_table_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enable_pay_at_table' => false, + 'pay_at_table_store_number' => false, + 'pay_at_table_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enable_pay_at_table' => 'enablePayAtTable', + 'pay_at_table_store_number' => 'payAtTableStoreNumber', + 'pay_at_table_url' => 'payAtTableURL' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enable_pay_at_table' => 'setEnablePayAtTable', + 'pay_at_table_store_number' => 'setPayAtTableStoreNumber', + 'pay_at_table_url' => 'setPayAtTableUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enable_pay_at_table' => 'getEnablePayAtTable', + 'pay_at_table_store_number' => 'getPayAtTableStoreNumber', + 'pay_at_table_url' => 'getPayAtTableUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enable_pay_at_table', $data ?? [], null); + $this->setIfExists('pay_at_table_store_number', $data ?? [], null); + $this->setIfExists('pay_at_table_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 enable_pay_at_table + * + * @return bool|null + */ + public function getEnablePayAtTable() + { + return $this->container['enable_pay_at_table']; + } + + /** + * Sets enable_pay_at_table + * + * @param bool|null $enable_pay_at_table Indicates if Pay at table is enabled. + * + * @return self + */ + public function setEnablePayAtTable($enable_pay_at_table) + { + if (is_null($enable_pay_at_table)) { + throw new \InvalidArgumentException('non-nullable enable_pay_at_table cannot be null'); + } + $this->container['enable_pay_at_table'] = $enable_pay_at_table; + + return $this; + } + + /** + * Gets pay_at_table_store_number + * + * @return string|null + */ + public function getPayAtTableStoreNumber() + { + return $this->container['pay_at_table_store_number']; + } + + /** + * Sets pay_at_table_store_number + * + * @param string|null $pay_at_table_store_number The store number to use for Pay at Table. + * + * @return self + */ + public function setPayAtTableStoreNumber($pay_at_table_store_number) + { + if (is_null($pay_at_table_store_number)) { + throw new \InvalidArgumentException('non-nullable pay_at_table_store_number cannot be null'); + } + $this->container['pay_at_table_store_number'] = $pay_at_table_store_number; + + return $this; + } + + /** + * Gets pay_at_table_url + * + * @return string|null + */ + public function getPayAtTableUrl() + { + return $this->container['pay_at_table_url']; + } + + /** + * Sets pay_at_table_url + * + * @param string|null $pay_at_table_url The URL and port number used for Pay at Table communication. + * + * @return self + */ + public function setPayAtTableUrl($pay_at_table_url) + { + if (is_null($pay_at_table_url)) { + throw new \InvalidArgumentException('non-nullable pay_at_table_url cannot be null'); + } + $this->container['pay_at_table_url'] = $pay_at_table_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/OrderItem.php b/src/Adyen/Model/Management/OrderItem.php new file mode 100644 index 000000000..a9c86360b --- /dev/null +++ b/src/Adyen/Model/Management/OrderItem.php @@ -0,0 +1,485 @@ + + */ +class OrderItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrderItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'installments' => 'int', + 'name' => 'string', + 'quantity' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'installments' => 'int64', + 'name' => null, + 'quantity' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'installments' => false, + 'name' => false, + 'quantity' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'installments' => 'installments', + 'name' => 'name', + 'quantity' => 'quantity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'installments' => 'setInstallments', + 'name' => 'setName', + 'quantity' => 'setQuantity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'installments' => 'getInstallments', + 'name' => 'getName', + 'quantity' => 'getQuantity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('installments', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the product. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets installments + * + * @return int|null + */ + public function getInstallments() + { + return $this->container['installments']; + } + + /** + * Sets installments + * + * @param int|null $installments The number of installments for the specified product `id`. + * + * @return self + */ + public function setInstallments($installments) + { + if (is_null($installments)) { + throw new \InvalidArgumentException('non-nullable installments cannot be null'); + } + $this->container['installments'] = $installments; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets quantity + * + * @return int|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int|null $quantity The number of items with the specified product `id` included in the order. + * + * @return self + */ + public function setQuantity($quantity) + { + // Do nothing for nullable integers + $this->container['quantity'] = $quantity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PaginationLinks.php b/src/Adyen/Model/Management/PaginationLinks.php new file mode 100644 index 000000000..5a951c118 --- /dev/null +++ b/src/Adyen/Model/Management/PaginationLinks.php @@ -0,0 +1,530 @@ + + */ +class PaginationLinks implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaginationLinks'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first' => '\Adyen\Model\Management\LinksElement', + 'last' => '\Adyen\Model\Management\LinksElement', + 'next' => '\Adyen\Model\Management\LinksElement', + 'prev' => '\Adyen\Model\Management\LinksElement', + 'self' => '\Adyen\Model\Management\LinksElement' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'first' => null, + 'last' => null, + 'next' => null, + 'prev' => null, + 'self' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'first' => false, + 'last' => false, + 'next' => false, + 'prev' => false, + 'self' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first' => 'first', + 'last' => 'last', + 'next' => 'next', + 'prev' => 'prev', + 'self' => 'self' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first' => 'setFirst', + 'last' => 'setLast', + 'next' => 'setNext', + 'prev' => 'setPrev', + 'self' => 'setSelf' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first' => 'getFirst', + 'last' => 'getLast', + 'next' => 'getNext', + 'prev' => 'getPrev', + 'self' => 'getSelf' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('first', $data ?? [], null); + $this->setIfExists('last', $data ?? [], null); + $this->setIfExists('next', $data ?? [], null); + $this->setIfExists('prev', $data ?? [], null); + $this->setIfExists('self', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['first'] === null) { + $invalidProperties[] = "'first' can't be null"; + } + if ($this->container['last'] === null) { + $invalidProperties[] = "'last' can't be null"; + } + if ($this->container['self'] === null) { + $invalidProperties[] = "'self' 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 first + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getFirst() + { + return $this->container['first']; + } + + /** + * Sets first + * + * @param \Adyen\Model\Management\LinksElement $first first + * + * @return self + */ + public function setFirst($first) + { + if (is_null($first)) { + throw new \InvalidArgumentException('non-nullable first cannot be null'); + } + $this->container['first'] = $first; + + return $this; + } + + /** + * Gets last + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getLast() + { + return $this->container['last']; + } + + /** + * Sets last + * + * @param \Adyen\Model\Management\LinksElement $last last + * + * @return self + */ + public function setLast($last) + { + if (is_null($last)) { + throw new \InvalidArgumentException('non-nullable last cannot be null'); + } + $this->container['last'] = $last; + + return $this; + } + + /** + * Gets next + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getNext() + { + return $this->container['next']; + } + + /** + * Sets next + * + * @param \Adyen\Model\Management\LinksElement|null $next next + * + * @return self + */ + public function setNext($next) + { + if (is_null($next)) { + throw new \InvalidArgumentException('non-nullable next cannot be null'); + } + $this->container['next'] = $next; + + return $this; + } + + /** + * Gets prev + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getPrev() + { + return $this->container['prev']; + } + + /** + * Sets prev + * + * @param \Adyen\Model\Management\LinksElement|null $prev prev + * + * @return self + */ + public function setPrev($prev) + { + if (is_null($prev)) { + throw new \InvalidArgumentException('non-nullable prev cannot be null'); + } + $this->container['prev'] = $prev; + + return $this; + } + + /** + * Gets self + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getSelf() + { + return $this->container['self']; + } + + /** + * Sets self + * + * @param \Adyen\Model\Management\LinksElement $self self + * + * @return self + */ + public function setSelf($self) + { + if (is_null($self)) { + throw new \InvalidArgumentException('non-nullable self cannot be null'); + } + $this->container['self'] = $self; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Passcodes.php b/src/Adyen/Model/Management/Passcodes.php new file mode 100644 index 000000000..44d9edb17 --- /dev/null +++ b/src/Adyen/Model/Management/Passcodes.php @@ -0,0 +1,487 @@ + + */ +class Passcodes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Passcodes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'admin_menu_pin' => 'string', + 'refund_pin' => 'string', + 'screen_lock_pin' => 'string', + 'tx_menu_pin' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'admin_menu_pin' => null, + 'refund_pin' => null, + 'screen_lock_pin' => null, + 'tx_menu_pin' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'admin_menu_pin' => false, + 'refund_pin' => false, + 'screen_lock_pin' => false, + 'tx_menu_pin' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'admin_menu_pin' => 'adminMenuPin', + 'refund_pin' => 'refundPin', + 'screen_lock_pin' => 'screenLockPin', + 'tx_menu_pin' => 'txMenuPin' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'admin_menu_pin' => 'setAdminMenuPin', + 'refund_pin' => 'setRefundPin', + 'screen_lock_pin' => 'setScreenLockPin', + 'tx_menu_pin' => 'setTxMenuPin' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'admin_menu_pin' => 'getAdminMenuPin', + 'refund_pin' => 'getRefundPin', + 'screen_lock_pin' => 'getScreenLockPin', + 'tx_menu_pin' => 'getTxMenuPin' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('admin_menu_pin', $data ?? [], null); + $this->setIfExists('refund_pin', $data ?? [], null); + $this->setIfExists('screen_lock_pin', $data ?? [], null); + $this->setIfExists('tx_menu_pin', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets admin_menu_pin + * + * @return string|null + */ + public function getAdminMenuPin() + { + return $this->container['admin_menu_pin']; + } + + /** + * Sets admin_menu_pin + * + * @param string|null $admin_menu_pin The passcode for the Admin menu and the Settings menu. + * + * @return self + */ + public function setAdminMenuPin($admin_menu_pin) + { + if (is_null($admin_menu_pin)) { + throw new \InvalidArgumentException('non-nullable admin_menu_pin cannot be null'); + } + $this->container['admin_menu_pin'] = $admin_menu_pin; + + return $this; + } + + /** + * Gets refund_pin + * + * @return string|null + */ + public function getRefundPin() + { + return $this->container['refund_pin']; + } + + /** + * Sets refund_pin + * + * @param string|null $refund_pin The passcode for unreferenced refunds on standalone terminals. + * + * @return self + */ + public function setRefundPin($refund_pin) + { + if (is_null($refund_pin)) { + throw new \InvalidArgumentException('non-nullable refund_pin cannot be null'); + } + $this->container['refund_pin'] = $refund_pin; + + return $this; + } + + /** + * Gets screen_lock_pin + * + * @return string|null + */ + public function getScreenLockPin() + { + return $this->container['screen_lock_pin']; + } + + /** + * Sets screen_lock_pin + * + * @param string|null $screen_lock_pin The passcode to unlock the terminal screen after a timeout. + * + * @return self + */ + public function setScreenLockPin($screen_lock_pin) + { + if (is_null($screen_lock_pin)) { + throw new \InvalidArgumentException('non-nullable screen_lock_pin cannot be null'); + } + $this->container['screen_lock_pin'] = $screen_lock_pin; + + return $this; + } + + /** + * Gets tx_menu_pin + * + * @return string|null + */ + public function getTxMenuPin() + { + return $this->container['tx_menu_pin']; + } + + /** + * Sets tx_menu_pin + * + * @param string|null $tx_menu_pin The passcode for the Transactions menu. + * + * @return self + */ + public function setTxMenuPin($tx_menu_pin) + { + if (is_null($tx_menu_pin)) { + throw new \InvalidArgumentException('non-nullable tx_menu_pin cannot be null'); + } + $this->container['tx_menu_pin'] = $tx_menu_pin; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PayAtTable.php b/src/Adyen/Model/Management/PayAtTable.php new file mode 100644 index 000000000..1c098bbd8 --- /dev/null +++ b/src/Adyen/Model/Management/PayAtTable.php @@ -0,0 +1,452 @@ + + */ +class PayAtTable implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayAtTable'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authentication_method' => 'string', + 'enable_pay_at_table' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authentication_method' => null, + 'enable_pay_at_table' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authentication_method' => false, + 'enable_pay_at_table' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authentication_method' => 'authenticationMethod', + 'enable_pay_at_table' => 'enablePayAtTable' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authentication_method' => 'setAuthenticationMethod', + 'enable_pay_at_table' => 'setEnablePayAtTable' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authentication_method' => 'getAuthenticationMethod', + 'enable_pay_at_table' => 'getEnablePayAtTable' + ]; + + /** + * 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 AUTHENTICATION_METHOD_MAGSWIPE = 'MAGSWIPE'; + public const AUTHENTICATION_METHOD_MKE = 'MKE'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAuthenticationMethodAllowableValues() + { + return [ + self::AUTHENTICATION_METHOD_MAGSWIPE, + self::AUTHENTICATION_METHOD_MKE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authentication_method', $data ?? [], null); + $this->setIfExists('enable_pay_at_table', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getAuthenticationMethodAllowableValues(); + if (!is_null($this->container['authentication_method']) && !in_array($this->container['authentication_method'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'authentication_method', must be one of '%s'", + $this->container['authentication_method'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authentication_method + * + * @return string|null + */ + public function getAuthenticationMethod() + { + return $this->container['authentication_method']; + } + + /** + * Sets authentication_method + * + * @param string|null $authentication_method Allowed authentication methods: Magswipe, Manual Entry. + * + * @return self + */ + public function setAuthenticationMethod($authentication_method) + { + if (is_null($authentication_method)) { + throw new \InvalidArgumentException('non-nullable authentication_method cannot be null'); + } + $allowedValues = $this->getAuthenticationMethodAllowableValues(); + if (!in_array($authentication_method, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'authentication_method', must be one of '%s'", + $authentication_method, + implode("', '", $allowedValues) + ) + ); + } + $this->container['authentication_method'] = $authentication_method; + + return $this; + } + + /** + * Gets enable_pay_at_table + * + * @return bool|null + */ + public function getEnablePayAtTable() + { + return $this->container['enable_pay_at_table']; + } + + /** + * Sets enable_pay_at_table + * + * @param bool|null $enable_pay_at_table Enable Pay at table. + * + * @return self + */ + public function setEnablePayAtTable($enable_pay_at_table) + { + if (is_null($enable_pay_at_table)) { + throw new \InvalidArgumentException('non-nullable enable_pay_at_table cannot be null'); + } + $this->container['enable_pay_at_table'] = $enable_pay_at_table; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PayPalInfo.php b/src/Adyen/Model/Management/PayPalInfo.php new file mode 100644 index 000000000..f787b087e --- /dev/null +++ b/src/Adyen/Model/Management/PayPalInfo.php @@ -0,0 +1,459 @@ + + */ +class PayPalInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayPalInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'direct_capture' => 'bool', + 'payer_id' => 'string', + 'subject' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'direct_capture' => null, + 'payer_id' => null, + 'subject' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'direct_capture' => false, + 'payer_id' => false, + 'subject' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'direct_capture' => 'directCapture', + 'payer_id' => 'payerId', + 'subject' => 'subject' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'direct_capture' => 'setDirectCapture', + 'payer_id' => 'setPayerId', + 'subject' => 'setSubject' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'direct_capture' => 'getDirectCapture', + 'payer_id' => 'getPayerId', + 'subject' => 'getSubject' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('direct_capture', $data ?? [], null); + $this->setIfExists('payer_id', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payer_id'] === null) { + $invalidProperties[] = "'payer_id' can't be null"; + } + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' 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 direct_capture + * + * @return bool|null + */ + public function getDirectCapture() + { + return $this->container['direct_capture']; + } + + /** + * Sets direct_capture + * + * @param bool|null $direct_capture Indicates if direct (immediate) capture for PayPal is enabled. If set to **true**, this setting overrides the [capture](https://docs.adyen.com/online-payments/capture) settings of your merchant account. Default value: **true**. + * + * @return self + */ + public function setDirectCapture($direct_capture) + { + if (is_null($direct_capture)) { + throw new \InvalidArgumentException('non-nullable direct_capture cannot be null'); + } + $this->container['direct_capture'] = $direct_capture; + + return $this; + } + + /** + * Gets payer_id + * + * @return string + */ + public function getPayerId() + { + return $this->container['payer_id']; + } + + /** + * Sets payer_id + * + * @param string $payer_id PayPal Merchant ID. Character length and limitations: 13 single-byte alphanumeric characters. + * + * @return self + */ + public function setPayerId($payer_id) + { + if (is_null($payer_id)) { + throw new \InvalidArgumentException('non-nullable payer_id cannot be null'); + } + $this->container['payer_id'] = $payer_id; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Your business email address. + * + * @return self + */ + public function setSubject($subject) + { + if (is_null($subject)) { + throw new \InvalidArgumentException('non-nullable subject cannot be null'); + } + $this->container['subject'] = $subject; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Payment.php b/src/Adyen/Model/Management/Payment.php new file mode 100644 index 000000000..13a899240 --- /dev/null +++ b/src/Adyen/Model/Management/Payment.php @@ -0,0 +1,385 @@ + + */ +class Payment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Payment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hide_minor_units_in_currencies' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hide_minor_units_in_currencies' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'hide_minor_units_in_currencies' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hide_minor_units_in_currencies' => 'hideMinorUnitsInCurrencies' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hide_minor_units_in_currencies' => 'setHideMinorUnitsInCurrencies' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hide_minor_units_in_currencies' => 'getHideMinorUnitsInCurrencies' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('hide_minor_units_in_currencies', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets hide_minor_units_in_currencies + * + * @return string[]|null + */ + public function getHideMinorUnitsInCurrencies() + { + return $this->container['hide_minor_units_in_currencies']; + } + + /** + * Sets hide_minor_units_in_currencies + * + * @param string[]|null $hide_minor_units_in_currencies Hides the minor units for the listed [ISO currency codes](https://en.wikipedia.org/wiki/ISO_4217). + * + * @return self + */ + public function setHideMinorUnitsInCurrencies($hide_minor_units_in_currencies) + { + if (is_null($hide_minor_units_in_currencies)) { + throw new \InvalidArgumentException('non-nullable hide_minor_units_in_currencies cannot be null'); + } + $this->container['hide_minor_units_in_currencies'] = $hide_minor_units_in_currencies; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PaymentMethod.php b/src/Adyen/Model/Management/PaymentMethod.php new file mode 100644 index 000000000..9625f456e --- /dev/null +++ b/src/Adyen/Model/Management/PaymentMethod.php @@ -0,0 +1,1173 @@ + + */ +class PaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethod'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'apple_pay' => '\Adyen\Model\Management\ApplePayInfo', + 'bcmc' => '\Adyen\Model\Management\BcmcInfo', + 'business_line_id' => 'string', + 'cartes_bancaires' => '\Adyen\Model\Management\CartesBancairesInfo', + 'countries' => 'string[]', + 'currencies' => 'string[]', + 'custom_routing_flags' => 'string[]', + 'enabled' => 'bool', + 'giro_pay' => '\Adyen\Model\Management\GiroPayInfo', + 'google_pay' => '\Adyen\Model\Management\GooglePayInfo', + 'id' => 'string', + 'klarna' => '\Adyen\Model\Management\KlarnaInfo', + 'meal_voucher_fr' => '\Adyen\Model\Management\MealVoucherFRInfo', + 'paypal' => '\Adyen\Model\Management\PayPalInfo', + 'reference' => 'string', + 'shopper_interaction' => 'string', + 'sofort' => '\Adyen\Model\Management\SofortInfo', + 'store_id' => 'string', + 'swish' => '\Adyen\Model\Management\SwishInfo', + 'type' => 'string', + 'verification_status' => 'string', + 'vipps' => '\Adyen\Model\Management\VippsInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed' => null, + 'apple_pay' => null, + 'bcmc' => null, + 'business_line_id' => null, + 'cartes_bancaires' => null, + 'countries' => null, + 'currencies' => null, + 'custom_routing_flags' => null, + 'enabled' => null, + 'giro_pay' => null, + 'google_pay' => null, + 'id' => null, + 'klarna' => null, + 'meal_voucher_fr' => null, + 'paypal' => null, + 'reference' => null, + 'shopper_interaction' => null, + 'sofort' => null, + 'store_id' => null, + 'swish' => null, + 'type' => null, + 'verification_status' => null, + 'vipps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'apple_pay' => false, + 'bcmc' => false, + 'business_line_id' => false, + 'cartes_bancaires' => false, + 'countries' => false, + 'currencies' => false, + 'custom_routing_flags' => false, + 'enabled' => false, + 'giro_pay' => false, + 'google_pay' => false, + 'id' => false, + 'klarna' => false, + 'meal_voucher_fr' => false, + 'paypal' => false, + 'reference' => false, + 'shopper_interaction' => false, + 'sofort' => false, + 'store_id' => false, + 'swish' => false, + 'type' => false, + 'verification_status' => false, + 'vipps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed' => 'allowed', + 'apple_pay' => 'applePay', + 'bcmc' => 'bcmc', + 'business_line_id' => 'businessLineId', + 'cartes_bancaires' => 'cartesBancaires', + 'countries' => 'countries', + 'currencies' => 'currencies', + 'custom_routing_flags' => 'customRoutingFlags', + 'enabled' => 'enabled', + 'giro_pay' => 'giroPay', + 'google_pay' => 'googlePay', + 'id' => 'id', + 'klarna' => 'klarna', + 'meal_voucher_fr' => 'mealVoucher_FR', + 'paypal' => 'paypal', + 'reference' => 'reference', + 'shopper_interaction' => 'shopperInteraction', + 'sofort' => 'sofort', + 'store_id' => 'storeId', + 'swish' => 'swish', + 'type' => 'type', + 'verification_status' => 'verificationStatus', + 'vipps' => 'vipps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed', + 'apple_pay' => 'setApplePay', + 'bcmc' => 'setBcmc', + 'business_line_id' => 'setBusinessLineId', + 'cartes_bancaires' => 'setCartesBancaires', + 'countries' => 'setCountries', + 'currencies' => 'setCurrencies', + 'custom_routing_flags' => 'setCustomRoutingFlags', + 'enabled' => 'setEnabled', + 'giro_pay' => 'setGiroPay', + 'google_pay' => 'setGooglePay', + 'id' => 'setId', + 'klarna' => 'setKlarna', + 'meal_voucher_fr' => 'setMealVoucherFr', + 'paypal' => 'setPaypal', + 'reference' => 'setReference', + 'shopper_interaction' => 'setShopperInteraction', + 'sofort' => 'setSofort', + 'store_id' => 'setStoreId', + 'swish' => 'setSwish', + 'type' => 'setType', + 'verification_status' => 'setVerificationStatus', + 'vipps' => 'setVipps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed', + 'apple_pay' => 'getApplePay', + 'bcmc' => 'getBcmc', + 'business_line_id' => 'getBusinessLineId', + 'cartes_bancaires' => 'getCartesBancaires', + 'countries' => 'getCountries', + 'currencies' => 'getCurrencies', + 'custom_routing_flags' => 'getCustomRoutingFlags', + 'enabled' => 'getEnabled', + 'giro_pay' => 'getGiroPay', + 'google_pay' => 'getGooglePay', + 'id' => 'getId', + 'klarna' => 'getKlarna', + 'meal_voucher_fr' => 'getMealVoucherFr', + 'paypal' => 'getPaypal', + 'reference' => 'getReference', + 'shopper_interaction' => 'getShopperInteraction', + 'sofort' => 'getSofort', + 'store_id' => 'getStoreId', + 'swish' => 'getSwish', + 'type' => 'getType', + 'verification_status' => 'getVerificationStatus', + 'vipps' => 'getVipps' + ]; + + /** + * 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 VERIFICATION_STATUS_VALID = 'valid'; + public const VERIFICATION_STATUS_PENDING = 'pending'; + public const VERIFICATION_STATUS_INVALID = 'invalid'; + public const VERIFICATION_STATUS_REJECTED = 'rejected'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerificationStatusAllowableValues() + { + return [ + self::VERIFICATION_STATUS_VALID, + self::VERIFICATION_STATUS_PENDING, + self::VERIFICATION_STATUS_INVALID, + self::VERIFICATION_STATUS_REJECTED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed', $data ?? [], null); + $this->setIfExists('apple_pay', $data ?? [], null); + $this->setIfExists('bcmc', $data ?? [], null); + $this->setIfExists('business_line_id', $data ?? [], null); + $this->setIfExists('cartes_bancaires', $data ?? [], null); + $this->setIfExists('countries', $data ?? [], null); + $this->setIfExists('currencies', $data ?? [], null); + $this->setIfExists('custom_routing_flags', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('giro_pay', $data ?? [], null); + $this->setIfExists('google_pay', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('klarna', $data ?? [], null); + $this->setIfExists('meal_voucher_fr', $data ?? [], null); + $this->setIfExists('paypal', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('sofort', $data ?? [], null); + $this->setIfExists('store_id', $data ?? [], null); + $this->setIfExists('swish', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('verification_status', $data ?? [], null); + $this->setIfExists('vipps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!is_null($this->container['verification_status']) && !in_array($this->container['verification_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'verification_status', must be one of '%s'", + $this->container['verification_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed + * + * @return bool|null + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * + * @param bool|null $allowed Indicates whether receiving payments is allowed. This value is set to **true** by Adyen after screening your merchant account. + * + * @return self + */ + public function setAllowed($allowed) + { + if (is_null($allowed)) { + throw new \InvalidArgumentException('non-nullable allowed cannot be null'); + } + $this->container['allowed'] = $allowed; + + return $this; + } + + /** + * Gets apple_pay + * + * @return \Adyen\Model\Management\ApplePayInfo|null + */ + public function getApplePay() + { + return $this->container['apple_pay']; + } + + /** + * Sets apple_pay + * + * @param \Adyen\Model\Management\ApplePayInfo|null $apple_pay apple_pay + * + * @return self + */ + public function setApplePay($apple_pay) + { + if (is_null($apple_pay)) { + throw new \InvalidArgumentException('non-nullable apple_pay cannot be null'); + } + $this->container['apple_pay'] = $apple_pay; + + return $this; + } + + /** + * Gets bcmc + * + * @return \Adyen\Model\Management\BcmcInfo|null + */ + public function getBcmc() + { + return $this->container['bcmc']; + } + + /** + * Sets bcmc + * + * @param \Adyen\Model\Management\BcmcInfo|null $bcmc bcmc + * + * @return self + */ + public function setBcmc($bcmc) + { + if (is_null($bcmc)) { + throw new \InvalidArgumentException('non-nullable bcmc cannot be null'); + } + $this->container['bcmc'] = $bcmc; + + return $this; + } + + /** + * Gets business_line_id + * + * @return string|null + */ + public function getBusinessLineId() + { + return $this->container['business_line_id']; + } + + /** + * Sets business_line_id + * + * @param string|null $business_line_id The unique identifier of the business line. + * + * @return self + */ + public function setBusinessLineId($business_line_id) + { + if (is_null($business_line_id)) { + throw new \InvalidArgumentException('non-nullable business_line_id cannot be null'); + } + $this->container['business_line_id'] = $business_line_id; + + return $this; + } + + /** + * Gets cartes_bancaires + * + * @return \Adyen\Model\Management\CartesBancairesInfo|null + */ + public function getCartesBancaires() + { + return $this->container['cartes_bancaires']; + } + + /** + * Sets cartes_bancaires + * + * @param \Adyen\Model\Management\CartesBancairesInfo|null $cartes_bancaires cartes_bancaires + * + * @return self + */ + public function setCartesBancaires($cartes_bancaires) + { + if (is_null($cartes_bancaires)) { + throw new \InvalidArgumentException('non-nullable cartes_bancaires cannot be null'); + } + $this->container['cartes_bancaires'] = $cartes_bancaires; + + return $this; + } + + /** + * Gets countries + * + * @return string[]|null + */ + public function getCountries() + { + return $this->container['countries']; + } + + /** + * Sets countries + * + * @param string[]|null $countries The list of countries where a payment method is available. By default, all countries supported by the payment method. + * + * @return self + */ + public function setCountries($countries) + { + if (is_null($countries)) { + throw new \InvalidArgumentException('non-nullable countries cannot be null'); + } + $this->container['countries'] = $countries; + + return $this; + } + + /** + * Gets currencies + * + * @return string[]|null + */ + public function getCurrencies() + { + return $this->container['currencies']; + } + + /** + * Sets currencies + * + * @param string[]|null $currencies The list of currencies that a payment method supports. By default, all currencies supported by the payment method. + * + * @return self + */ + public function setCurrencies($currencies) + { + if (is_null($currencies)) { + throw new \InvalidArgumentException('non-nullable currencies cannot be null'); + } + $this->container['currencies'] = $currencies; + + return $this; + } + + /** + * Gets custom_routing_flags + * + * @return string[]|null + */ + public function getCustomRoutingFlags() + { + return $this->container['custom_routing_flags']; + } + + /** + * Sets custom_routing_flags + * + * @param string[]|null $custom_routing_flags The list of custom routing flags to route payment to the intended acquirer. + * + * @return self + */ + public function setCustomRoutingFlags($custom_routing_flags) + { + if (is_null($custom_routing_flags)) { + throw new \InvalidArgumentException('non-nullable custom_routing_flags cannot be null'); + } + $this->container['custom_routing_flags'] = $custom_routing_flags; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates whether the payment method is enabled (**true**) or disabled (**false**). + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets giro_pay + * + * @return \Adyen\Model\Management\GiroPayInfo|null + */ + public function getGiroPay() + { + return $this->container['giro_pay']; + } + + /** + * Sets giro_pay + * + * @param \Adyen\Model\Management\GiroPayInfo|null $giro_pay giro_pay + * + * @return self + */ + public function setGiroPay($giro_pay) + { + if (is_null($giro_pay)) { + throw new \InvalidArgumentException('non-nullable giro_pay cannot be null'); + } + $this->container['giro_pay'] = $giro_pay; + + return $this; + } + + /** + * Gets google_pay + * + * @return \Adyen\Model\Management\GooglePayInfo|null + */ + public function getGooglePay() + { + return $this->container['google_pay']; + } + + /** + * Sets google_pay + * + * @param \Adyen\Model\Management\GooglePayInfo|null $google_pay google_pay + * + * @return self + */ + public function setGooglePay($google_pay) + { + if (is_null($google_pay)) { + throw new \InvalidArgumentException('non-nullable google_pay cannot be null'); + } + $this->container['google_pay'] = $google_pay; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The identifier of the resource. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets klarna + * + * @return \Adyen\Model\Management\KlarnaInfo|null + */ + public function getKlarna() + { + return $this->container['klarna']; + } + + /** + * Sets klarna + * + * @param \Adyen\Model\Management\KlarnaInfo|null $klarna klarna + * + * @return self + */ + public function setKlarna($klarna) + { + if (is_null($klarna)) { + throw new \InvalidArgumentException('non-nullable klarna cannot be null'); + } + $this->container['klarna'] = $klarna; + + return $this; + } + + /** + * Gets meal_voucher_fr + * + * @return \Adyen\Model\Management\MealVoucherFRInfo|null + */ + public function getMealVoucherFr() + { + return $this->container['meal_voucher_fr']; + } + + /** + * Sets meal_voucher_fr + * + * @param \Adyen\Model\Management\MealVoucherFRInfo|null $meal_voucher_fr meal_voucher_fr + * + * @return self + */ + public function setMealVoucherFr($meal_voucher_fr) + { + if (is_null($meal_voucher_fr)) { + throw new \InvalidArgumentException('non-nullable meal_voucher_fr cannot be null'); + } + $this->container['meal_voucher_fr'] = $meal_voucher_fr; + + return $this; + } + + /** + * Gets paypal + * + * @return \Adyen\Model\Management\PayPalInfo|null + */ + public function getPaypal() + { + return $this->container['paypal']; + } + + /** + * Sets paypal + * + * @param \Adyen\Model\Management\PayPalInfo|null $paypal paypal + * + * @return self + */ + public function setPaypal($paypal) + { + if (is_null($paypal)) { + throw new \InvalidArgumentException('non-nullable paypal cannot be null'); + } + $this->container['paypal'] = $paypal; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment method. Supported characters a-z, A-Z, 0-9. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction The sales channel. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets sofort + * + * @return \Adyen\Model\Management\SofortInfo|null + */ + public function getSofort() + { + return $this->container['sofort']; + } + + /** + * Sets sofort + * + * @param \Adyen\Model\Management\SofortInfo|null $sofort sofort + * + * @return self + */ + public function setSofort($sofort) + { + if (is_null($sofort)) { + throw new \InvalidArgumentException('non-nullable sofort cannot be null'); + } + $this->container['sofort'] = $sofort; + + return $this; + } + + /** + * Gets store_id + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['store_id']; + } + + /** + * Sets store_id + * + * @param string|null $store_id The ID of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/post/stores__resParam_id), if any. + * + * @return self + */ + public function setStoreId($store_id) + { + if (is_null($store_id)) { + throw new \InvalidArgumentException('non-nullable store_id cannot be null'); + } + $this->container['store_id'] = $store_id; + + return $this; + } + + /** + * Gets swish + * + * @return \Adyen\Model\Management\SwishInfo|null + */ + public function getSwish() + { + return $this->container['swish']; + } + + /** + * Sets swish + * + * @param \Adyen\Model\Management\SwishInfo|null $swish swish + * + * @return self + */ + public function setSwish($swish) + { + if (is_null($swish)) { + throw new \InvalidArgumentException('non-nullable swish cannot be null'); + } + $this->container['swish'] = $swish; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets verification_status + * + * @return string|null + */ + public function getVerificationStatus() + { + return $this->container['verification_status']; + } + + /** + * Sets verification_status + * + * @param string|null $verification_status Payment method status. Possible values: * **valid** * **pending** * **invalid** * **rejected** + * + * @return self + */ + public function setVerificationStatus($verification_status) + { + if (is_null($verification_status)) { + throw new \InvalidArgumentException('non-nullable verification_status cannot be null'); + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!in_array($verification_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'verification_status', must be one of '%s'", + $verification_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['verification_status'] = $verification_status; + + return $this; + } + + /** + * Gets vipps + * + * @return \Adyen\Model\Management\VippsInfo|null + */ + public function getVipps() + { + return $this->container['vipps']; + } + + /** + * Sets vipps + * + * @param \Adyen\Model\Management\VippsInfo|null $vipps vipps + * + * @return self + */ + public function setVipps($vipps) + { + if (is_null($vipps)) { + throw new \InvalidArgumentException('non-nullable vipps cannot be null'); + } + $this->container['vipps'] = $vipps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PaymentMethodResponse.php b/src/Adyen/Model/Management/PaymentMethodResponse.php new file mode 100644 index 000000000..bf47c2500 --- /dev/null +++ b/src/Adyen/Model/Management/PaymentMethodResponse.php @@ -0,0 +1,638 @@ + + */ +class PaymentMethodResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\PaginationLinks', + 'data' => '\Adyen\Model\Management\PaymentMethod[]', + 'items_total' => 'int', + 'pages_total' => 'int', + 'types_with_errors' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'data' => null, + 'items_total' => 'int32', + 'pages_total' => 'int32', + 'types_with_errors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'data' => false, + 'items_total' => true, + 'pages_total' => true, + 'types_with_errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'data' => 'data', + 'items_total' => 'itemsTotal', + 'pages_total' => 'pagesTotal', + 'types_with_errors' => 'typesWithErrors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'data' => 'setData', + 'items_total' => 'setItemsTotal', + 'pages_total' => 'setPagesTotal', + 'types_with_errors' => 'setTypesWithErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'data' => 'getData', + 'items_total' => 'getItemsTotal', + 'pages_total' => 'getPagesTotal', + 'types_with_errors' => 'getTypesWithErrors' + ]; + + /** + * 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 TYPES_WITH_ERRORS_AFTERPAYTOUCH = 'afterpaytouch'; + public const TYPES_WITH_ERRORS_ALIPAY = 'alipay'; + public const TYPES_WITH_ERRORS_ALIPAY_HK = 'alipay_hk'; + public const TYPES_WITH_ERRORS_AMEX = 'amex'; + public const TYPES_WITH_ERRORS_APPLEPAY = 'applepay'; + public const TYPES_WITH_ERRORS_BCMC = 'bcmc'; + public const TYPES_WITH_ERRORS_BLIK = 'blik'; + public const TYPES_WITH_ERRORS_CARTEBANCAIRE = 'cartebancaire'; + public const TYPES_WITH_ERRORS_CLEARPAY = 'clearpay'; + public const TYPES_WITH_ERRORS_CUP = 'cup'; + public const TYPES_WITH_ERRORS_DINERS = 'diners'; + public const TYPES_WITH_ERRORS_DIRECT_EBANKING = 'directEbanking'; + public const TYPES_WITH_ERRORS_DIRECTDEBIT_GB = 'directdebit_GB'; + public const TYPES_WITH_ERRORS_DISCOVER = 'discover'; + public const TYPES_WITH_ERRORS_EBANKING_FI = 'ebanking_FI'; + public const TYPES_WITH_ERRORS_EFTPOS_AUSTRALIA = 'eftpos_australia'; + public const TYPES_WITH_ERRORS_ELO = 'elo'; + public const TYPES_WITH_ERRORS_ELOCREDIT = 'elocredit'; + public const TYPES_WITH_ERRORS_ELODEBIT = 'elodebit'; + public const TYPES_WITH_ERRORS_GIROCARD = 'girocard'; + public const TYPES_WITH_ERRORS_GIROPAY = 'giropay'; + public const TYPES_WITH_ERRORS_GOOGLEPAY = 'googlepay'; + public const TYPES_WITH_ERRORS_HIPER = 'hiper'; + public const TYPES_WITH_ERRORS_HIPERCARD = 'hipercard'; + public const TYPES_WITH_ERRORS_IDEAL = 'ideal'; + public const TYPES_WITH_ERRORS_INTERAC_CARD = 'interac_card'; + public const TYPES_WITH_ERRORS_JCB = 'jcb'; + public const TYPES_WITH_ERRORS_KLARNA = 'klarna'; + public const TYPES_WITH_ERRORS_KLARNA_ACCOUNT = 'klarna_account'; + public const TYPES_WITH_ERRORS_KLARNA_PAYNOW = 'klarna_paynow'; + public const TYPES_WITH_ERRORS_MAESTRO = 'maestro'; + public const TYPES_WITH_ERRORS_MBWAY = 'mbway'; + public const TYPES_WITH_ERRORS_MC = 'mc'; + public const TYPES_WITH_ERRORS_MCDEBIT = 'mcdebit'; + public const TYPES_WITH_ERRORS_MEAL_VOUCHER_FR = 'mealVoucher_FR'; + public const TYPES_WITH_ERRORS_MOBILEPAY = 'mobilepay'; + public const TYPES_WITH_ERRORS_MULTIBANCO = 'multibanco'; + public const TYPES_WITH_ERRORS_ONLINE_BANKING_PL = 'onlineBanking_PL'; + public const TYPES_WITH_ERRORS_PAYPAL = 'paypal'; + public const TYPES_WITH_ERRORS_PAYSHOP = 'payshop'; + public const TYPES_WITH_ERRORS_SWISH = 'swish'; + public const TYPES_WITH_ERRORS_TRUSTLY = 'trustly'; + public const TYPES_WITH_ERRORS_VIPPS = 'vipps'; + public const TYPES_WITH_ERRORS_VISA = 'visa'; + public const TYPES_WITH_ERRORS_VISADEBIT = 'visadebit'; + public const TYPES_WITH_ERRORS_VPAY = 'vpay'; + public const TYPES_WITH_ERRORS_WECHATPAY = 'wechatpay'; + public const TYPES_WITH_ERRORS_WECHATPAY_POS = 'wechatpay_pos'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypesWithErrorsAllowableValues() + { + return [ + self::TYPES_WITH_ERRORS_AFTERPAYTOUCH, + self::TYPES_WITH_ERRORS_ALIPAY, + self::TYPES_WITH_ERRORS_ALIPAY_HK, + self::TYPES_WITH_ERRORS_AMEX, + self::TYPES_WITH_ERRORS_APPLEPAY, + self::TYPES_WITH_ERRORS_BCMC, + self::TYPES_WITH_ERRORS_BLIK, + self::TYPES_WITH_ERRORS_CARTEBANCAIRE, + self::TYPES_WITH_ERRORS_CLEARPAY, + self::TYPES_WITH_ERRORS_CUP, + self::TYPES_WITH_ERRORS_DINERS, + self::TYPES_WITH_ERRORS_DIRECT_EBANKING, + self::TYPES_WITH_ERRORS_DIRECTDEBIT_GB, + self::TYPES_WITH_ERRORS_DISCOVER, + self::TYPES_WITH_ERRORS_EBANKING_FI, + self::TYPES_WITH_ERRORS_EFTPOS_AUSTRALIA, + self::TYPES_WITH_ERRORS_ELO, + self::TYPES_WITH_ERRORS_ELOCREDIT, + self::TYPES_WITH_ERRORS_ELODEBIT, + self::TYPES_WITH_ERRORS_GIROCARD, + self::TYPES_WITH_ERRORS_GIROPAY, + self::TYPES_WITH_ERRORS_GOOGLEPAY, + self::TYPES_WITH_ERRORS_HIPER, + self::TYPES_WITH_ERRORS_HIPERCARD, + self::TYPES_WITH_ERRORS_IDEAL, + self::TYPES_WITH_ERRORS_INTERAC_CARD, + self::TYPES_WITH_ERRORS_JCB, + self::TYPES_WITH_ERRORS_KLARNA, + self::TYPES_WITH_ERRORS_KLARNA_ACCOUNT, + self::TYPES_WITH_ERRORS_KLARNA_PAYNOW, + self::TYPES_WITH_ERRORS_MAESTRO, + self::TYPES_WITH_ERRORS_MBWAY, + self::TYPES_WITH_ERRORS_MC, + self::TYPES_WITH_ERRORS_MCDEBIT, + self::TYPES_WITH_ERRORS_MEAL_VOUCHER_FR, + self::TYPES_WITH_ERRORS_MOBILEPAY, + self::TYPES_WITH_ERRORS_MULTIBANCO, + self::TYPES_WITH_ERRORS_ONLINE_BANKING_PL, + self::TYPES_WITH_ERRORS_PAYPAL, + self::TYPES_WITH_ERRORS_PAYSHOP, + self::TYPES_WITH_ERRORS_SWISH, + self::TYPES_WITH_ERRORS_TRUSTLY, + self::TYPES_WITH_ERRORS_VIPPS, + self::TYPES_WITH_ERRORS_VISA, + self::TYPES_WITH_ERRORS_VISADEBIT, + self::TYPES_WITH_ERRORS_VPAY, + self::TYPES_WITH_ERRORS_WECHATPAY, + self::TYPES_WITH_ERRORS_WECHATPAY_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('items_total', $data ?? [], null); + $this->setIfExists('pages_total', $data ?? [], null); + $this->setIfExists('types_with_errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['items_total'] === null) { + $invalidProperties[] = "'items_total' can't be null"; + } + if ($this->container['pages_total'] === null) { + $invalidProperties[] = "'pages_total' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\PaginationLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\PaginationLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\Management\PaymentMethod[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\PaymentMethod[]|null $data Payment methods details. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets items_total + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['items_total']; + } + + /** + * Sets items_total + * + * @param int $items_total Total number of items. + * + * @return self + */ + public function setItemsTotal($items_total) + { + // Do nothing for nullable integers + $this->container['items_total'] = $items_total; + + return $this; + } + + /** + * Gets pages_total + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pages_total']; + } + + /** + * Sets pages_total + * + * @param int $pages_total Total number of pages. + * + * @return self + */ + public function setPagesTotal($pages_total) + { + // Do nothing for nullable integers + $this->container['pages_total'] = $pages_total; + + return $this; + } + + /** + * Gets types_with_errors + * + * @return string[]|null + */ + public function getTypesWithErrors() + { + return $this->container['types_with_errors']; + } + + /** + * Sets types_with_errors + * + * @param string[]|null $types_with_errors Payment method types with errors. + * + * @return self + */ + public function setTypesWithErrors($types_with_errors) + { + if (is_null($types_with_errors)) { + throw new \InvalidArgumentException('non-nullable types_with_errors cannot be null'); + } + $allowedValues = $this->getTypesWithErrorsAllowableValues(); + if (array_diff($types_with_errors, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'types_with_errors', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['types_with_errors'] = $types_with_errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PaymentMethodSetupInfo.php b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php new file mode 100644 index 000000000..28b584e2c --- /dev/null +++ b/src/Adyen/Model/Management/PaymentMethodSetupInfo.php @@ -0,0 +1,1159 @@ + + */ +class PaymentMethodSetupInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentMethodSetupInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'apple_pay' => '\Adyen\Model\Management\ApplePayInfo', + 'bcmc' => '\Adyen\Model\Management\BcmcInfo', + 'business_line_id' => 'string', + 'cartes_bancaires' => '\Adyen\Model\Management\CartesBancairesInfo', + 'countries' => 'string[]', + 'currencies' => 'string[]', + 'custom_routing_flags' => 'string[]', + 'giro_pay' => '\Adyen\Model\Management\GiroPayInfo', + 'google_pay' => '\Adyen\Model\Management\GooglePayInfo', + 'klarna' => '\Adyen\Model\Management\KlarnaInfo', + 'meal_voucher_fr' => '\Adyen\Model\Management\MealVoucherFRInfo', + 'paypal' => '\Adyen\Model\Management\PayPalInfo', + 'reference' => 'string', + 'shopper_interaction' => 'string', + 'sofort' => '\Adyen\Model\Management\SofortInfo', + 'store_id' => 'string', + 'swish' => '\Adyen\Model\Management\SwishInfo', + 'type' => 'string', + 'vipps' => '\Adyen\Model\Management\VippsInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'apple_pay' => null, + 'bcmc' => null, + 'business_line_id' => null, + 'cartes_bancaires' => null, + 'countries' => null, + 'currencies' => null, + 'custom_routing_flags' => null, + 'giro_pay' => null, + 'google_pay' => null, + 'klarna' => null, + 'meal_voucher_fr' => null, + 'paypal' => null, + 'reference' => null, + 'shopper_interaction' => null, + 'sofort' => null, + 'store_id' => null, + 'swish' => null, + 'type' => null, + 'vipps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'apple_pay' => false, + 'bcmc' => false, + 'business_line_id' => false, + 'cartes_bancaires' => false, + 'countries' => false, + 'currencies' => false, + 'custom_routing_flags' => false, + 'giro_pay' => false, + 'google_pay' => false, + 'klarna' => false, + 'meal_voucher_fr' => false, + 'paypal' => false, + 'reference' => false, + 'shopper_interaction' => false, + 'sofort' => false, + 'store_id' => false, + 'swish' => false, + 'type' => false, + 'vipps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'apple_pay' => 'applePay', + 'bcmc' => 'bcmc', + 'business_line_id' => 'businessLineId', + 'cartes_bancaires' => 'cartesBancaires', + 'countries' => 'countries', + 'currencies' => 'currencies', + 'custom_routing_flags' => 'customRoutingFlags', + 'giro_pay' => 'giroPay', + 'google_pay' => 'googlePay', + 'klarna' => 'klarna', + 'meal_voucher_fr' => 'mealVoucher_FR', + 'paypal' => 'paypal', + 'reference' => 'reference', + 'shopper_interaction' => 'shopperInteraction', + 'sofort' => 'sofort', + 'store_id' => 'storeId', + 'swish' => 'swish', + 'type' => 'type', + 'vipps' => 'vipps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'apple_pay' => 'setApplePay', + 'bcmc' => 'setBcmc', + 'business_line_id' => 'setBusinessLineId', + 'cartes_bancaires' => 'setCartesBancaires', + 'countries' => 'setCountries', + 'currencies' => 'setCurrencies', + 'custom_routing_flags' => 'setCustomRoutingFlags', + 'giro_pay' => 'setGiroPay', + 'google_pay' => 'setGooglePay', + 'klarna' => 'setKlarna', + 'meal_voucher_fr' => 'setMealVoucherFr', + 'paypal' => 'setPaypal', + 'reference' => 'setReference', + 'shopper_interaction' => 'setShopperInteraction', + 'sofort' => 'setSofort', + 'store_id' => 'setStoreId', + 'swish' => 'setSwish', + 'type' => 'setType', + 'vipps' => 'setVipps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'apple_pay' => 'getApplePay', + 'bcmc' => 'getBcmc', + 'business_line_id' => 'getBusinessLineId', + 'cartes_bancaires' => 'getCartesBancaires', + 'countries' => 'getCountries', + 'currencies' => 'getCurrencies', + 'custom_routing_flags' => 'getCustomRoutingFlags', + 'giro_pay' => 'getGiroPay', + 'google_pay' => 'getGooglePay', + 'klarna' => 'getKlarna', + 'meal_voucher_fr' => 'getMealVoucherFr', + 'paypal' => 'getPaypal', + 'reference' => 'getReference', + 'shopper_interaction' => 'getShopperInteraction', + 'sofort' => 'getSofort', + 'store_id' => 'getStoreId', + 'swish' => 'getSwish', + 'type' => 'getType', + 'vipps' => 'getVipps' + ]; + + /** + * 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 SHOPPER_INTERACTION_E_COMMERCE = 'eCommerce'; + public const SHOPPER_INTERACTION_POS = 'pos'; + public const SHOPPER_INTERACTION_MOTO = 'moto'; + public const SHOPPER_INTERACTION_CONT_AUTH = 'contAuth'; + public const TYPE_AFTERPAYTOUCH = 'afterpaytouch'; + public const TYPE_ALIPAY = 'alipay'; + public const TYPE_ALIPAY_HK = 'alipay_hk'; + public const TYPE_AMEX = 'amex'; + public const TYPE_APPLEPAY = 'applepay'; + public const TYPE_BCMC = 'bcmc'; + public const TYPE_BLIK = 'blik'; + public const TYPE_CARTEBANCAIRE = 'cartebancaire'; + public const TYPE_CLEARPAY = 'clearpay'; + public const TYPE_CUP = 'cup'; + public const TYPE_DINERS = 'diners'; + public const TYPE_DIRECT_EBANKING = 'directEbanking'; + public const TYPE_DIRECTDEBIT_GB = 'directdebit_GB'; + public const TYPE_DISCOVER = 'discover'; + public const TYPE_EBANKING_FI = 'ebanking_FI'; + public const TYPE_EFTPOS_AUSTRALIA = 'eftpos_australia'; + public const TYPE_ELO = 'elo'; + public const TYPE_ELOCREDIT = 'elocredit'; + public const TYPE_ELODEBIT = 'elodebit'; + public const TYPE_GIROCARD = 'girocard'; + public const TYPE_GIROPAY = 'giropay'; + public const TYPE_GOOGLEPAY = 'googlepay'; + public const TYPE_HIPER = 'hiper'; + public const TYPE_HIPERCARD = 'hipercard'; + public const TYPE_IDEAL = 'ideal'; + public const TYPE_INTERAC_CARD = 'interac_card'; + public const TYPE_JCB = 'jcb'; + public const TYPE_KLARNA = 'klarna'; + public const TYPE_KLARNA_ACCOUNT = 'klarna_account'; + public const TYPE_KLARNA_PAYNOW = 'klarna_paynow'; + public const TYPE_MAESTRO = 'maestro'; + public const TYPE_MBWAY = 'mbway'; + public const TYPE_MC = 'mc'; + public const TYPE_MCDEBIT = 'mcdebit'; + public const TYPE_MEAL_VOUCHER_FR = 'mealVoucher_FR'; + public const TYPE_MOBILEPAY = 'mobilepay'; + public const TYPE_MULTIBANCO = 'multibanco'; + public const TYPE_ONLINE_BANKING_PL = 'onlineBanking_PL'; + public const TYPE_PAYPAL = 'paypal'; + public const TYPE_PAYSHOP = 'payshop'; + public const TYPE_SWISH = 'swish'; + public const TYPE_TRUSTLY = 'trustly'; + public const TYPE_VIPPS = 'vipps'; + public const TYPE_VISA = 'visa'; + public const TYPE_VISADEBIT = 'visadebit'; + public const TYPE_VPAY = 'vpay'; + public const TYPE_WECHATPAY = 'wechatpay'; + public const TYPE_WECHATPAY_POS = 'wechatpay_pos'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShopperInteractionAllowableValues() + { + return [ + self::SHOPPER_INTERACTION_E_COMMERCE, + self::SHOPPER_INTERACTION_POS, + self::SHOPPER_INTERACTION_MOTO, + self::SHOPPER_INTERACTION_CONT_AUTH, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AFTERPAYTOUCH, + self::TYPE_ALIPAY, + self::TYPE_ALIPAY_HK, + self::TYPE_AMEX, + self::TYPE_APPLEPAY, + self::TYPE_BCMC, + self::TYPE_BLIK, + self::TYPE_CARTEBANCAIRE, + self::TYPE_CLEARPAY, + self::TYPE_CUP, + self::TYPE_DINERS, + self::TYPE_DIRECT_EBANKING, + self::TYPE_DIRECTDEBIT_GB, + self::TYPE_DISCOVER, + self::TYPE_EBANKING_FI, + self::TYPE_EFTPOS_AUSTRALIA, + self::TYPE_ELO, + self::TYPE_ELOCREDIT, + self::TYPE_ELODEBIT, + self::TYPE_GIROCARD, + self::TYPE_GIROPAY, + self::TYPE_GOOGLEPAY, + self::TYPE_HIPER, + self::TYPE_HIPERCARD, + self::TYPE_IDEAL, + self::TYPE_INTERAC_CARD, + self::TYPE_JCB, + self::TYPE_KLARNA, + self::TYPE_KLARNA_ACCOUNT, + self::TYPE_KLARNA_PAYNOW, + self::TYPE_MAESTRO, + self::TYPE_MBWAY, + self::TYPE_MC, + self::TYPE_MCDEBIT, + self::TYPE_MEAL_VOUCHER_FR, + self::TYPE_MOBILEPAY, + self::TYPE_MULTIBANCO, + self::TYPE_ONLINE_BANKING_PL, + self::TYPE_PAYPAL, + self::TYPE_PAYSHOP, + self::TYPE_SWISH, + self::TYPE_TRUSTLY, + self::TYPE_VIPPS, + self::TYPE_VISA, + self::TYPE_VISADEBIT, + self::TYPE_VPAY, + self::TYPE_WECHATPAY, + self::TYPE_WECHATPAY_POS, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('apple_pay', $data ?? [], null); + $this->setIfExists('bcmc', $data ?? [], null); + $this->setIfExists('business_line_id', $data ?? [], null); + $this->setIfExists('cartes_bancaires', $data ?? [], null); + $this->setIfExists('countries', $data ?? [], null); + $this->setIfExists('currencies', $data ?? [], null); + $this->setIfExists('custom_routing_flags', $data ?? [], null); + $this->setIfExists('giro_pay', $data ?? [], null); + $this->setIfExists('google_pay', $data ?? [], null); + $this->setIfExists('klarna', $data ?? [], null); + $this->setIfExists('meal_voucher_fr', $data ?? [], null); + $this->setIfExists('paypal', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shopper_interaction', $data ?? [], null); + $this->setIfExists('sofort', $data ?? [], null); + $this->setIfExists('store_id', $data ?? [], null); + $this->setIfExists('swish', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('vipps', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!is_null($this->container['shopper_interaction']) && !in_array($this->container['shopper_interaction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $this->container['shopper_interaction'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets apple_pay + * + * @return \Adyen\Model\Management\ApplePayInfo|null + */ + public function getApplePay() + { + return $this->container['apple_pay']; + } + + /** + * Sets apple_pay + * + * @param \Adyen\Model\Management\ApplePayInfo|null $apple_pay apple_pay + * + * @return self + */ + public function setApplePay($apple_pay) + { + if (is_null($apple_pay)) { + throw new \InvalidArgumentException('non-nullable apple_pay cannot be null'); + } + $this->container['apple_pay'] = $apple_pay; + + return $this; + } + + /** + * Gets bcmc + * + * @return \Adyen\Model\Management\BcmcInfo|null + */ + public function getBcmc() + { + return $this->container['bcmc']; + } + + /** + * Sets bcmc + * + * @param \Adyen\Model\Management\BcmcInfo|null $bcmc bcmc + * + * @return self + */ + public function setBcmc($bcmc) + { + if (is_null($bcmc)) { + throw new \InvalidArgumentException('non-nullable bcmc cannot be null'); + } + $this->container['bcmc'] = $bcmc; + + return $this; + } + + /** + * Gets business_line_id + * + * @return string|null + */ + public function getBusinessLineId() + { + return $this->container['business_line_id']; + } + + /** + * Sets business_line_id + * + * @param string|null $business_line_id The unique identifier of the business line. + * + * @return self + */ + public function setBusinessLineId($business_line_id) + { + if (is_null($business_line_id)) { + throw new \InvalidArgumentException('non-nullable business_line_id cannot be null'); + } + $this->container['business_line_id'] = $business_line_id; + + return $this; + } + + /** + * Gets cartes_bancaires + * + * @return \Adyen\Model\Management\CartesBancairesInfo|null + */ + public function getCartesBancaires() + { + return $this->container['cartes_bancaires']; + } + + /** + * Sets cartes_bancaires + * + * @param \Adyen\Model\Management\CartesBancairesInfo|null $cartes_bancaires cartes_bancaires + * + * @return self + */ + public function setCartesBancaires($cartes_bancaires) + { + if (is_null($cartes_bancaires)) { + throw new \InvalidArgumentException('non-nullable cartes_bancaires cannot be null'); + } + $this->container['cartes_bancaires'] = $cartes_bancaires; + + return $this; + } + + /** + * Gets countries + * + * @return string[]|null + */ + public function getCountries() + { + return $this->container['countries']; + } + + /** + * Sets countries + * + * @param string[]|null $countries The list of countries where a payment method is available. By default, all countries supported by the payment method. + * + * @return self + */ + public function setCountries($countries) + { + if (is_null($countries)) { + throw new \InvalidArgumentException('non-nullable countries cannot be null'); + } + $this->container['countries'] = $countries; + + return $this; + } + + /** + * Gets currencies + * + * @return string[]|null + */ + public function getCurrencies() + { + return $this->container['currencies']; + } + + /** + * Sets currencies + * + * @param string[]|null $currencies The list of currencies that a payment method supports. By default, all currencies supported by the payment method. + * + * @return self + */ + public function setCurrencies($currencies) + { + if (is_null($currencies)) { + throw new \InvalidArgumentException('non-nullable currencies cannot be null'); + } + $this->container['currencies'] = $currencies; + + return $this; + } + + /** + * Gets custom_routing_flags + * + * @return string[]|null + */ + public function getCustomRoutingFlags() + { + return $this->container['custom_routing_flags']; + } + + /** + * Sets custom_routing_flags + * + * @param string[]|null $custom_routing_flags The list of custom routing flags to route payment to the intended acquirer. + * + * @return self + */ + public function setCustomRoutingFlags($custom_routing_flags) + { + if (is_null($custom_routing_flags)) { + throw new \InvalidArgumentException('non-nullable custom_routing_flags cannot be null'); + } + $this->container['custom_routing_flags'] = $custom_routing_flags; + + return $this; + } + + /** + * Gets giro_pay + * + * @return \Adyen\Model\Management\GiroPayInfo|null + */ + public function getGiroPay() + { + return $this->container['giro_pay']; + } + + /** + * Sets giro_pay + * + * @param \Adyen\Model\Management\GiroPayInfo|null $giro_pay giro_pay + * + * @return self + */ + public function setGiroPay($giro_pay) + { + if (is_null($giro_pay)) { + throw new \InvalidArgumentException('non-nullable giro_pay cannot be null'); + } + $this->container['giro_pay'] = $giro_pay; + + return $this; + } + + /** + * Gets google_pay + * + * @return \Adyen\Model\Management\GooglePayInfo|null + */ + public function getGooglePay() + { + return $this->container['google_pay']; + } + + /** + * Sets google_pay + * + * @param \Adyen\Model\Management\GooglePayInfo|null $google_pay google_pay + * + * @return self + */ + public function setGooglePay($google_pay) + { + if (is_null($google_pay)) { + throw new \InvalidArgumentException('non-nullable google_pay cannot be null'); + } + $this->container['google_pay'] = $google_pay; + + return $this; + } + + /** + * Gets klarna + * + * @return \Adyen\Model\Management\KlarnaInfo|null + */ + public function getKlarna() + { + return $this->container['klarna']; + } + + /** + * Sets klarna + * + * @param \Adyen\Model\Management\KlarnaInfo|null $klarna klarna + * + * @return self + */ + public function setKlarna($klarna) + { + if (is_null($klarna)) { + throw new \InvalidArgumentException('non-nullable klarna cannot be null'); + } + $this->container['klarna'] = $klarna; + + return $this; + } + + /** + * Gets meal_voucher_fr + * + * @return \Adyen\Model\Management\MealVoucherFRInfo|null + */ + public function getMealVoucherFr() + { + return $this->container['meal_voucher_fr']; + } + + /** + * Sets meal_voucher_fr + * + * @param \Adyen\Model\Management\MealVoucherFRInfo|null $meal_voucher_fr meal_voucher_fr + * + * @return self + */ + public function setMealVoucherFr($meal_voucher_fr) + { + if (is_null($meal_voucher_fr)) { + throw new \InvalidArgumentException('non-nullable meal_voucher_fr cannot be null'); + } + $this->container['meal_voucher_fr'] = $meal_voucher_fr; + + return $this; + } + + /** + * Gets paypal + * + * @return \Adyen\Model\Management\PayPalInfo|null + */ + public function getPaypal() + { + return $this->container['paypal']; + } + + /** + * Sets paypal + * + * @param \Adyen\Model\Management\PayPalInfo|null $paypal paypal + * + * @return self + */ + public function setPaypal($paypal) + { + if (is_null($paypal)) { + throw new \InvalidArgumentException('non-nullable paypal cannot be null'); + } + $this->container['paypal'] = $paypal; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payment method. Supported characters a-z, A-Z, 0-9. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shopper_interaction + * + * @return string|null + */ + public function getShopperInteraction() + { + return $this->container['shopper_interaction']; + } + + /** + * Sets shopper_interaction + * + * @param string|null $shopper_interaction The sales channel. Required if the merchant account does not have a sales channel. When you provide this field, it overrides the default sales channel set on the merchant account. Possible values: **eCommerce**, **pos**, **contAuth**, and **moto**. + * + * @return self + */ + public function setShopperInteraction($shopper_interaction) + { + if (is_null($shopper_interaction)) { + throw new \InvalidArgumentException('non-nullable shopper_interaction cannot be null'); + } + $allowedValues = $this->getShopperInteractionAllowableValues(); + if (!in_array($shopper_interaction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'shopper_interaction', must be one of '%s'", + $shopper_interaction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['shopper_interaction'] = $shopper_interaction; + + return $this; + } + + /** + * Gets sofort + * + * @return \Adyen\Model\Management\SofortInfo|null + */ + public function getSofort() + { + return $this->container['sofort']; + } + + /** + * Sets sofort + * + * @param \Adyen\Model\Management\SofortInfo|null $sofort sofort + * + * @return self + */ + public function setSofort($sofort) + { + if (is_null($sofort)) { + throw new \InvalidArgumentException('non-nullable sofort cannot be null'); + } + $this->container['sofort'] = $sofort; + + return $this; + } + + /** + * Gets store_id + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['store_id']; + } + + /** + * Sets store_id + * + * @param string|null $store_id The ID of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/post/stores__resParam_id), if any. + * + * @return self + */ + public function setStoreId($store_id) + { + if (is_null($store_id)) { + throw new \InvalidArgumentException('non-nullable store_id cannot be null'); + } + $this->container['store_id'] = $store_id; + + return $this; + } + + /** + * Gets swish + * + * @return \Adyen\Model\Management\SwishInfo|null + */ + public function getSwish() + { + return $this->container['swish']; + } + + /** + * Sets swish + * + * @param \Adyen\Model\Management\SwishInfo|null $swish swish + * + * @return self + */ + public function setSwish($swish) + { + if (is_null($swish)) { + throw new \InvalidArgumentException('non-nullable swish cannot be null'); + } + $this->container['swish'] = $swish; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $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 vipps + * + * @return \Adyen\Model\Management\VippsInfo|null + */ + public function getVipps() + { + return $this->container['vipps']; + } + + /** + * Sets vipps + * + * @param \Adyen\Model\Management\VippsInfo|null $vipps vipps + * + * @return self + */ + public function setVipps($vipps) + { + if (is_null($vipps)) { + throw new \InvalidArgumentException('non-nullable vipps cannot be null'); + } + $this->container['vipps'] = $vipps; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PayoutSettings.php b/src/Adyen/Model/Management/PayoutSettings.php new file mode 100644 index 000000000..e0504c469 --- /dev/null +++ b/src/Adyen/Model/Management/PayoutSettings.php @@ -0,0 +1,667 @@ + + */ +class PayoutSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayoutSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowed' => 'bool', + 'enabled' => 'bool', + 'enabled_from_date' => 'string', + 'id' => 'string', + 'priority' => 'string', + 'transfer_instrument_id' => 'string', + 'verification_status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowed' => null, + 'enabled' => null, + 'enabled_from_date' => null, + 'id' => null, + 'priority' => null, + 'transfer_instrument_id' => null, + 'verification_status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowed' => false, + 'enabled' => false, + 'enabled_from_date' => false, + 'id' => false, + 'priority' => false, + 'transfer_instrument_id' => false, + 'verification_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'allowed' => 'allowed', + 'enabled' => 'enabled', + 'enabled_from_date' => 'enabledFromDate', + 'id' => 'id', + 'priority' => 'priority', + 'transfer_instrument_id' => 'transferInstrumentId', + 'verification_status' => 'verificationStatus' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowed' => 'setAllowed', + 'enabled' => 'setEnabled', + 'enabled_from_date' => 'setEnabledFromDate', + 'id' => 'setId', + 'priority' => 'setPriority', + 'transfer_instrument_id' => 'setTransferInstrumentId', + 'verification_status' => 'setVerificationStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowed' => 'getAllowed', + 'enabled' => 'getEnabled', + 'enabled_from_date' => 'getEnabledFromDate', + 'id' => 'getId', + 'priority' => 'getPriority', + 'transfer_instrument_id' => 'getTransferInstrumentId', + 'verification_status' => 'getVerificationStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const PRIORITY_FIRST = 'first'; + public const PRIORITY_NORMAL = 'normal'; + public const PRIORITY_URGENT = 'urgent'; + public const VERIFICATION_STATUS_INVALID = 'invalid'; + public const VERIFICATION_STATUS_PENDING = 'pending'; + public const VERIFICATION_STATUS_REJECTED = 'rejected'; + public const VERIFICATION_STATUS_VALID = 'valid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPriorityAllowableValues() + { + return [ + self::PRIORITY_FIRST, + self::PRIORITY_NORMAL, + self::PRIORITY_URGENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVerificationStatusAllowableValues() + { + return [ + self::VERIFICATION_STATUS_INVALID, + self::VERIFICATION_STATUS_PENDING, + self::VERIFICATION_STATUS_REJECTED, + self::VERIFICATION_STATUS_VALID, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('allowed', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('enabled_from_date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('transfer_instrument_id', $data ?? [], null); + $this->setIfExists('verification_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + $allowedValues = $this->getPriorityAllowableValues(); + if (!is_null($this->container['priority']) && !in_array($this->container['priority'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'priority', must be one of '%s'", + $this->container['priority'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['transfer_instrument_id'] === null) { + $invalidProperties[] = "'transfer_instrument_id' can't be null"; + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!is_null($this->container['verification_status']) && !in_array($this->container['verification_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'verification_status', must be one of '%s'", + $this->container['verification_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets allowed + * + * @return bool|null + */ + public function getAllowed() + { + return $this->container['allowed']; + } + + /** + * Sets allowed + * + * @param bool|null $allowed Indicates if payouts to the bank account are allowed. This value is set automatically based on the status of the verification process. The value is: * **true** if `verificationStatus` is **valid**. * **false** for all other values. + * + * @return self + */ + public function setAllowed($allowed) + { + if (is_null($allowed)) { + throw new \InvalidArgumentException('non-nullable allowed cannot be null'); + } + $this->container['allowed'] = $allowed; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates if payouts to this bank account are enabled. Default: **true**. To receive payouts into this bank account, both `enabled` and `allowed` must be **true**. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets enabled_from_date + * + * @return string|null + */ + public function getEnabledFromDate() + { + return $this->container['enabled_from_date']; + } + + /** + * Sets enabled_from_date + * + * @param string|null $enabled_from_date The date when Adyen starts paying out to this bank account. Format: [ISO 8601](https://www.w3.org/TR/NOTE-datetime), for example, **2019-11-23T12:25:28Z** or **2020-05-27T20:25:28+08:00**. If not specified, the `enabled` field indicates if payouts are enabled for this bank account. If a date is specified and: * `enabled`: **true**, payouts are enabled starting the specified date. * `enabled`: **false**, payouts are disabled until the specified date. On the specified date, `enabled` changes to **true** and this field is reset to **null**. + * + * @return self + */ + public function setEnabledFromDate($enabled_from_date) + { + if (is_null($enabled_from_date)) { + throw new \InvalidArgumentException('non-nullable enabled_from_date cannot be null'); + } + $this->container['enabled_from_date'] = $enabled_from_date; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the payout setting. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority Determines how long it takes for the funds to reach the bank account. Adyen pays out based on the [payout frequency](https://docs.adyen.com/account/getting-paid#payout-frequency). Depending on the currencies and banks involved in transferring the money, it may take up to three days for the payout funds to arrive in the bank account. Possible values: * **first**: same day. * **urgent**: the next day. * **normal**: between 1 and 3 days. + * + * @return self + */ + public function setPriority($priority) + { + if (is_null($priority)) { + throw new \InvalidArgumentException('non-nullable priority cannot be null'); + } + $allowedValues = $this->getPriorityAllowableValues(); + if (!in_array($priority, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'priority', must be one of '%s'", + $priority, + implode("', '", $allowedValues) + ) + ); + } + $this->container['priority'] = $priority; + + return $this; + } + + /** + * Gets transfer_instrument_id + * + * @return string + */ + public function getTransferInstrumentId() + { + return $this->container['transfer_instrument_id']; + } + + /** + * Sets transfer_instrument_id + * + * @param string $transfer_instrument_id The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments) that contains the details of the bank account. + * + * @return self + */ + public function setTransferInstrumentId($transfer_instrument_id) + { + if (is_null($transfer_instrument_id)) { + throw new \InvalidArgumentException('non-nullable transfer_instrument_id cannot be null'); + } + $this->container['transfer_instrument_id'] = $transfer_instrument_id; + + return $this; + } + + /** + * Gets verification_status + * + * @return string|null + */ + public function getVerificationStatus() + { + return $this->container['verification_status']; + } + + /** + * Sets verification_status + * + * @param string|null $verification_status The status of the verification process for the bank account. Possible values: * **valid**: the verification was successful. * **pending**: the verification is in progress. * **invalid**: the information provided is not complete. * **rejected**: there are reasons to refuse working with this entity. + * + * @return self + */ + public function setVerificationStatus($verification_status) + { + if (is_null($verification_status)) { + throw new \InvalidArgumentException('non-nullable verification_status cannot be null'); + } + $allowedValues = $this->getVerificationStatusAllowableValues(); + if (!in_array($verification_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'verification_status', must be one of '%s'", + $verification_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['verification_status'] = $verification_status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PayoutSettingsRequest.php b/src/Adyen/Model/Management/PayoutSettingsRequest.php new file mode 100644 index 000000000..2d8da6590 --- /dev/null +++ b/src/Adyen/Model/Management/PayoutSettingsRequest.php @@ -0,0 +1,456 @@ + + */ +class PayoutSettingsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayoutSettingsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'enabled_from_date' => 'string', + 'transfer_instrument_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'enabled_from_date' => null, + 'transfer_instrument_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enabled' => false, + 'enabled_from_date' => false, + 'transfer_instrument_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'enabled_from_date' => 'enabledFromDate', + 'transfer_instrument_id' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'enabled_from_date' => 'setEnabledFromDate', + 'transfer_instrument_id' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'enabled_from_date' => 'getEnabledFromDate', + 'transfer_instrument_id' => 'getTransferInstrumentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('enabled_from_date', $data ?? [], null); + $this->setIfExists('transfer_instrument_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['transfer_instrument_id'] === null) { + $invalidProperties[] = "'transfer_instrument_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates if payouts to this bank account are enabled. Default: **true**. To receive payouts into this bank account, both `enabled` and `allowed` must be **true**. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets enabled_from_date + * + * @return string|null + */ + public function getEnabledFromDate() + { + return $this->container['enabled_from_date']; + } + + /** + * Sets enabled_from_date + * + * @param string|null $enabled_from_date The date when Adyen starts paying out to this bank account. Format: [ISO 8601](https://www.w3.org/TR/NOTE-datetime), for example, **2019-11-23T12:25:28Z** or **2020-05-27T20:25:28+08:00**. If not specified, the `enabled` field indicates if payouts are enabled for this bank account. If a date is specified and: * `enabled`: **true**, payouts are enabled starting the specified date. * `enabled`: **false**, payouts are disabled until the specified date. On the specified date, `enabled` changes to **true** and this field is reset to **null**. + * + * @return self + */ + public function setEnabledFromDate($enabled_from_date) + { + if (is_null($enabled_from_date)) { + throw new \InvalidArgumentException('non-nullable enabled_from_date cannot be null'); + } + $this->container['enabled_from_date'] = $enabled_from_date; + + return $this; + } + + /** + * Gets transfer_instrument_id + * + * @return string + */ + public function getTransferInstrumentId() + { + return $this->container['transfer_instrument_id']; + } + + /** + * Sets transfer_instrument_id + * + * @param string $transfer_instrument_id The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments) that contains the details of the bank account. + * + * @return self + */ + public function setTransferInstrumentId($transfer_instrument_id) + { + if (is_null($transfer_instrument_id)) { + throw new \InvalidArgumentException('non-nullable transfer_instrument_id cannot be null'); + } + $this->container['transfer_instrument_id'] = $transfer_instrument_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/PayoutSettingsResponse.php b/src/Adyen/Model/Management/PayoutSettingsResponse.php new file mode 100644 index 000000000..1a0ad19c8 --- /dev/null +++ b/src/Adyen/Model/Management/PayoutSettingsResponse.php @@ -0,0 +1,385 @@ + + */ +class PayoutSettingsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayoutSettingsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\PayoutSettings[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\PayoutSettings[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\PayoutSettings[]|null $data The list of payout accounts. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Profile.php b/src/Adyen/Model/Management/Profile.php new file mode 100644 index 000000000..7e4264e44 --- /dev/null +++ b/src/Adyen/Model/Management/Profile.php @@ -0,0 +1,973 @@ + + */ +class Profile implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Profile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'auth_type' => 'string', + 'auto_wifi' => 'bool', + 'bss_type' => 'string', + 'channel' => 'int', + 'default_profile' => 'bool', + 'eap' => 'string', + 'eap_ca_cert' => '\Adyen\Model\Management\File', + 'eap_client_cert' => '\Adyen\Model\Management\File', + 'eap_client_key' => '\Adyen\Model\Management\File', + 'eap_client_pwd' => 'string', + 'eap_identity' => 'string', + 'eap_intermediate_cert' => '\Adyen\Model\Management\File', + 'eap_pwd' => 'string', + 'hidden_ssid' => 'bool', + 'name' => 'string', + 'psk' => 'string', + 'ssid' => 'string', + 'wsec' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'auth_type' => null, + 'auto_wifi' => null, + 'bss_type' => null, + 'channel' => 'int32', + 'default_profile' => null, + 'eap' => null, + 'eap_ca_cert' => null, + 'eap_client_cert' => null, + 'eap_client_key' => null, + 'eap_client_pwd' => null, + 'eap_identity' => null, + 'eap_intermediate_cert' => null, + 'eap_pwd' => null, + 'hidden_ssid' => null, + 'name' => null, + 'psk' => null, + 'ssid' => null, + 'wsec' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'auth_type' => false, + 'auto_wifi' => false, + 'bss_type' => false, + 'channel' => true, + 'default_profile' => false, + 'eap' => false, + 'eap_ca_cert' => false, + 'eap_client_cert' => false, + 'eap_client_key' => false, + 'eap_client_pwd' => false, + 'eap_identity' => false, + 'eap_intermediate_cert' => false, + 'eap_pwd' => false, + 'hidden_ssid' => false, + 'name' => false, + 'psk' => false, + 'ssid' => false, + 'wsec' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'auth_type' => 'authType', + 'auto_wifi' => 'autoWifi', + 'bss_type' => 'bssType', + 'channel' => 'channel', + 'default_profile' => 'defaultProfile', + 'eap' => 'eap', + 'eap_ca_cert' => 'eapCaCert', + 'eap_client_cert' => 'eapClientCert', + 'eap_client_key' => 'eapClientKey', + 'eap_client_pwd' => 'eapClientPwd', + 'eap_identity' => 'eapIdentity', + 'eap_intermediate_cert' => 'eapIntermediateCert', + 'eap_pwd' => 'eapPwd', + 'hidden_ssid' => 'hiddenSsid', + 'name' => 'name', + 'psk' => 'psk', + 'ssid' => 'ssid', + 'wsec' => 'wsec' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'auth_type' => 'setAuthType', + 'auto_wifi' => 'setAutoWifi', + 'bss_type' => 'setBssType', + 'channel' => 'setChannel', + 'default_profile' => 'setDefaultProfile', + 'eap' => 'setEap', + 'eap_ca_cert' => 'setEapCaCert', + 'eap_client_cert' => 'setEapClientCert', + 'eap_client_key' => 'setEapClientKey', + 'eap_client_pwd' => 'setEapClientPwd', + 'eap_identity' => 'setEapIdentity', + 'eap_intermediate_cert' => 'setEapIntermediateCert', + 'eap_pwd' => 'setEapPwd', + 'hidden_ssid' => 'setHiddenSsid', + 'name' => 'setName', + 'psk' => 'setPsk', + 'ssid' => 'setSsid', + 'wsec' => 'setWsec' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'auth_type' => 'getAuthType', + 'auto_wifi' => 'getAutoWifi', + 'bss_type' => 'getBssType', + 'channel' => 'getChannel', + 'default_profile' => 'getDefaultProfile', + 'eap' => 'getEap', + 'eap_ca_cert' => 'getEapCaCert', + 'eap_client_cert' => 'getEapClientCert', + 'eap_client_key' => 'getEapClientKey', + 'eap_client_pwd' => 'getEapClientPwd', + 'eap_identity' => 'getEapIdentity', + 'eap_intermediate_cert' => 'getEapIntermediateCert', + 'eap_pwd' => 'getEapPwd', + 'hidden_ssid' => 'getHiddenSsid', + 'name' => 'getName', + 'psk' => 'getPsk', + 'ssid' => 'getSsid', + 'wsec' => 'getWsec' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('auth_type', $data ?? [], null); + $this->setIfExists('auto_wifi', $data ?? [], null); + $this->setIfExists('bss_type', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('default_profile', $data ?? [], null); + $this->setIfExists('eap', $data ?? [], null); + $this->setIfExists('eap_ca_cert', $data ?? [], null); + $this->setIfExists('eap_client_cert', $data ?? [], null); + $this->setIfExists('eap_client_key', $data ?? [], null); + $this->setIfExists('eap_client_pwd', $data ?? [], null); + $this->setIfExists('eap_identity', $data ?? [], null); + $this->setIfExists('eap_intermediate_cert', $data ?? [], null); + $this->setIfExists('eap_pwd', $data ?? [], null); + $this->setIfExists('hidden_ssid', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('psk', $data ?? [], null); + $this->setIfExists('ssid', $data ?? [], null); + $this->setIfExists('wsec', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['auth_type'] === null) { + $invalidProperties[] = "'auth_type' can't be null"; + } + if ($this->container['bss_type'] === null) { + $invalidProperties[] = "'bss_type' can't be null"; + } + if ($this->container['ssid'] === null) { + $invalidProperties[] = "'ssid' can't be null"; + } + if ($this->container['wsec'] === null) { + $invalidProperties[] = "'wsec' 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 auth_type + * + * @return string + */ + public function getAuthType() + { + return $this->container['auth_type']; + } + + /** + * Sets auth_type + * + * @param string $auth_type The type of Wi-Fi network. Possible values: **wpa-psk**, **wpa2-psk**, **wpa-eap**, **wpa2-eap**. + * + * @return self + */ + public function setAuthType($auth_type) + { + if (is_null($auth_type)) { + throw new \InvalidArgumentException('non-nullable auth_type cannot be null'); + } + $this->container['auth_type'] = $auth_type; + + return $this; + } + + /** + * Gets auto_wifi + * + * @return bool|null + */ + public function getAutoWifi() + { + return $this->container['auto_wifi']; + } + + /** + * Sets auto_wifi + * + * @param bool|null $auto_wifi Indicates whether to automatically select the best authentication method available. Does not work on older terminal models. + * + * @return self + */ + public function setAutoWifi($auto_wifi) + { + if (is_null($auto_wifi)) { + throw new \InvalidArgumentException('non-nullable auto_wifi cannot be null'); + } + $this->container['auto_wifi'] = $auto_wifi; + + return $this; + } + + /** + * Gets bss_type + * + * @return string + */ + public function getBssType() + { + return $this->container['bss_type']; + } + + /** + * Sets bss_type + * + * @param string $bss_type Use **infra** for infrastructure-based networks. This applies to most networks. Use **adhoc** only if the communication is p2p-based between base stations. + * + * @return self + */ + public function setBssType($bss_type) + { + if (is_null($bss_type)) { + throw new \InvalidArgumentException('non-nullable bss_type cannot be null'); + } + $this->container['bss_type'] = $bss_type; + + return $this; + } + + /** + * Gets channel + * + * @return int|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param int|null $channel The channel number of the Wi-Fi network. The recommended setting is **0** for automatic channel selection. + * + * @return self + */ + public function setChannel($channel) + { + // Do nothing for nullable integers + $this->container['channel'] = $channel; + + return $this; + } + + /** + * Gets default_profile + * + * @return bool|null + */ + public function getDefaultProfile() + { + return $this->container['default_profile']; + } + + /** + * Sets default_profile + * + * @param bool|null $default_profile Indicates whether this is your preferred wireless network. If **true**, the terminal will try connecting to this network first. + * + * @return self + */ + public function setDefaultProfile($default_profile) + { + if (is_null($default_profile)) { + throw new \InvalidArgumentException('non-nullable default_profile cannot be null'); + } + $this->container['default_profile'] = $default_profile; + + return $this; + } + + /** + * Gets eap + * + * @return string|null + */ + public function getEap() + { + return $this->container['eap']; + } + + /** + * Sets eap + * + * @param string|null $eap For `authType` **wpa-eap** or **wpa2-eap**. Possible values: **tls**, **peap**, **leap**, **fast** + * + * @return self + */ + public function setEap($eap) + { + if (is_null($eap)) { + throw new \InvalidArgumentException('non-nullable eap cannot be null'); + } + $this->container['eap'] = $eap; + + return $this; + } + + /** + * Gets eap_ca_cert + * + * @return \Adyen\Model\Management\File|null + */ + public function getEapCaCert() + { + return $this->container['eap_ca_cert']; + } + + /** + * Sets eap_ca_cert + * + * @param \Adyen\Model\Management\File|null $eap_ca_cert eap_ca_cert + * + * @return self + */ + public function setEapCaCert($eap_ca_cert) + { + if (is_null($eap_ca_cert)) { + throw new \InvalidArgumentException('non-nullable eap_ca_cert cannot be null'); + } + $this->container['eap_ca_cert'] = $eap_ca_cert; + + return $this; + } + + /** + * Gets eap_client_cert + * + * @return \Adyen\Model\Management\File|null + */ + public function getEapClientCert() + { + return $this->container['eap_client_cert']; + } + + /** + * Sets eap_client_cert + * + * @param \Adyen\Model\Management\File|null $eap_client_cert eap_client_cert + * + * @return self + */ + public function setEapClientCert($eap_client_cert) + { + if (is_null($eap_client_cert)) { + throw new \InvalidArgumentException('non-nullable eap_client_cert cannot be null'); + } + $this->container['eap_client_cert'] = $eap_client_cert; + + return $this; + } + + /** + * Gets eap_client_key + * + * @return \Adyen\Model\Management\File|null + */ + public function getEapClientKey() + { + return $this->container['eap_client_key']; + } + + /** + * Sets eap_client_key + * + * @param \Adyen\Model\Management\File|null $eap_client_key eap_client_key + * + * @return self + */ + public function setEapClientKey($eap_client_key) + { + if (is_null($eap_client_key)) { + throw new \InvalidArgumentException('non-nullable eap_client_key cannot be null'); + } + $this->container['eap_client_key'] = $eap_client_key; + + return $this; + } + + /** + * Gets eap_client_pwd + * + * @return string|null + */ + public function getEapClientPwd() + { + return $this->container['eap_client_pwd']; + } + + /** + * Sets eap_client_pwd + * + * @param string|null $eap_client_pwd For `eap` **tls**. The password of the RSA key file, if that file is password-protected. + * + * @return self + */ + public function setEapClientPwd($eap_client_pwd) + { + if (is_null($eap_client_pwd)) { + throw new \InvalidArgumentException('non-nullable eap_client_pwd cannot be null'); + } + $this->container['eap_client_pwd'] = $eap_client_pwd; + + return $this; + } + + /** + * Gets eap_identity + * + * @return string|null + */ + public function getEapIdentity() + { + return $this->container['eap_identity']; + } + + /** + * Sets eap_identity + * + * @param string|null $eap_identity For `authType` **wpa-eap** or **wpa2-eap**. The EAP-PEAP username from your MS-CHAP account. Must match the configuration of your RADIUS server. + * + * @return self + */ + public function setEapIdentity($eap_identity) + { + if (is_null($eap_identity)) { + throw new \InvalidArgumentException('non-nullable eap_identity cannot be null'); + } + $this->container['eap_identity'] = $eap_identity; + + return $this; + } + + /** + * Gets eap_intermediate_cert + * + * @return \Adyen\Model\Management\File|null + */ + public function getEapIntermediateCert() + { + return $this->container['eap_intermediate_cert']; + } + + /** + * Sets eap_intermediate_cert + * + * @param \Adyen\Model\Management\File|null $eap_intermediate_cert eap_intermediate_cert + * + * @return self + */ + public function setEapIntermediateCert($eap_intermediate_cert) + { + if (is_null($eap_intermediate_cert)) { + throw new \InvalidArgumentException('non-nullable eap_intermediate_cert cannot be null'); + } + $this->container['eap_intermediate_cert'] = $eap_intermediate_cert; + + return $this; + } + + /** + * Gets eap_pwd + * + * @return string|null + */ + public function getEapPwd() + { + return $this->container['eap_pwd']; + } + + /** + * Sets eap_pwd + * + * @param string|null $eap_pwd For `eap` **peap**. The EAP-PEAP password from your MS-CHAP account. Must match the configuration of your RADIUS server. + * + * @return self + */ + public function setEapPwd($eap_pwd) + { + if (is_null($eap_pwd)) { + throw new \InvalidArgumentException('non-nullable eap_pwd cannot be null'); + } + $this->container['eap_pwd'] = $eap_pwd; + + return $this; + } + + /** + * Gets hidden_ssid + * + * @return bool|null + */ + public function getHiddenSsid() + { + return $this->container['hidden_ssid']; + } + + /** + * Sets hidden_ssid + * + * @param bool|null $hidden_ssid Indicates if the network doesn't broadcast its SSID. Mandatory for Android terminals, because these terminals rely on this setting to be able to connect to any network. + * + * @return self + */ + public function setHiddenSsid($hidden_ssid) + { + if (is_null($hidden_ssid)) { + throw new \InvalidArgumentException('non-nullable hidden_ssid cannot be null'); + } + $this->container['hidden_ssid'] = $hidden_ssid; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Your name for the Wi-Fi profile. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets psk + * + * @return string|null + */ + public function getPsk() + { + return $this->container['psk']; + } + + /** + * Sets psk + * + * @param string|null $psk For `authType` **wpa-psk or **wpa2-psk**. The password to the wireless network. + * + * @return self + */ + public function setPsk($psk) + { + if (is_null($psk)) { + throw new \InvalidArgumentException('non-nullable psk cannot be null'); + } + $this->container['psk'] = $psk; + + return $this; + } + + /** + * Gets ssid + * + * @return string + */ + public function getSsid() + { + return $this->container['ssid']; + } + + /** + * Sets ssid + * + * @param string $ssid The name of the wireless network. + * + * @return self + */ + public function setSsid($ssid) + { + if (is_null($ssid)) { + throw new \InvalidArgumentException('non-nullable ssid cannot be null'); + } + $this->container['ssid'] = $ssid; + + return $this; + } + + /** + * Gets wsec + * + * @return string + */ + public function getWsec() + { + return $this->container['wsec']; + } + + /** + * Sets wsec + * + * @param string $wsec The type of encryption. Possible values: **auto**, **ccmp** (recommended), **tkip** + * + * @return self + */ + public function setWsec($wsec) + { + if (is_null($wsec)) { + throw new \InvalidArgumentException('non-nullable wsec cannot be null'); + } + $this->container['wsec'] = $wsec; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ReceiptOptions.php b/src/Adyen/Model/Management/ReceiptOptions.php new file mode 100644 index 000000000..85b0dc231 --- /dev/null +++ b/src/Adyen/Model/Management/ReceiptOptions.php @@ -0,0 +1,419 @@ + + */ +class ReceiptOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReceiptOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'logo' => 'string', + 'qr_code_data' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'logo' => null, + 'qr_code_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'logo' => false, + 'qr_code_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'logo' => 'logo', + 'qr_code_data' => 'qrCodeData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'logo' => 'setLogo', + 'qr_code_data' => 'setQrCodeData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'logo' => 'getLogo', + 'qr_code_data' => 'getQrCodeData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('logo', $data ?? [], null); + $this->setIfExists('qr_code_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets logo + * + * @return string|null + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string|null $logo The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px. + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + + /** + * Gets qr_code_data + * + * @return string|null + */ + public function getQrCodeData() + { + return $this->container['qr_code_data']; + } + + /** + * Sets qr_code_data + * + * @param string|null $qr_code_data Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**. + * + * @return self + */ + public function setQrCodeData($qr_code_data) + { + if (is_null($qr_code_data)) { + throw new \InvalidArgumentException('non-nullable qr_code_data cannot be null'); + } + $this->container['qr_code_data'] = $qr_code_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ReceiptPrinting.php b/src/Adyen/Model/Management/ReceiptPrinting.php new file mode 100644 index 000000000..7582848dc --- /dev/null +++ b/src/Adyen/Model/Management/ReceiptPrinting.php @@ -0,0 +1,895 @@ + + */ +class ReceiptPrinting implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReceiptPrinting'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_approved' => 'bool', + 'merchant_cancelled' => 'bool', + 'merchant_capture_approved' => 'bool', + 'merchant_capture_refused' => 'bool', + 'merchant_refund_approved' => 'bool', + 'merchant_refund_refused' => 'bool', + 'merchant_refused' => 'bool', + 'merchant_void' => 'bool', + 'shopper_approved' => 'bool', + 'shopper_cancelled' => 'bool', + 'shopper_capture_approved' => 'bool', + 'shopper_capture_refused' => 'bool', + 'shopper_refund_approved' => 'bool', + 'shopper_refund_refused' => 'bool', + 'shopper_refused' => 'bool', + 'shopper_void' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_approved' => null, + 'merchant_cancelled' => null, + 'merchant_capture_approved' => null, + 'merchant_capture_refused' => null, + 'merchant_refund_approved' => null, + 'merchant_refund_refused' => null, + 'merchant_refused' => null, + 'merchant_void' => null, + 'shopper_approved' => null, + 'shopper_cancelled' => null, + 'shopper_capture_approved' => null, + 'shopper_capture_refused' => null, + 'shopper_refund_approved' => null, + 'shopper_refund_refused' => null, + 'shopper_refused' => null, + 'shopper_void' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_approved' => false, + 'merchant_cancelled' => false, + 'merchant_capture_approved' => false, + 'merchant_capture_refused' => false, + 'merchant_refund_approved' => false, + 'merchant_refund_refused' => false, + 'merchant_refused' => false, + 'merchant_void' => false, + 'shopper_approved' => false, + 'shopper_cancelled' => false, + 'shopper_capture_approved' => false, + 'shopper_capture_refused' => false, + 'shopper_refund_approved' => false, + 'shopper_refund_refused' => false, + 'shopper_refused' => false, + 'shopper_void' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_approved' => 'merchantApproved', + 'merchant_cancelled' => 'merchantCancelled', + 'merchant_capture_approved' => 'merchantCaptureApproved', + 'merchant_capture_refused' => 'merchantCaptureRefused', + 'merchant_refund_approved' => 'merchantRefundApproved', + 'merchant_refund_refused' => 'merchantRefundRefused', + 'merchant_refused' => 'merchantRefused', + 'merchant_void' => 'merchantVoid', + 'shopper_approved' => 'shopperApproved', + 'shopper_cancelled' => 'shopperCancelled', + 'shopper_capture_approved' => 'shopperCaptureApproved', + 'shopper_capture_refused' => 'shopperCaptureRefused', + 'shopper_refund_approved' => 'shopperRefundApproved', + 'shopper_refund_refused' => 'shopperRefundRefused', + 'shopper_refused' => 'shopperRefused', + 'shopper_void' => 'shopperVoid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_approved' => 'setMerchantApproved', + 'merchant_cancelled' => 'setMerchantCancelled', + 'merchant_capture_approved' => 'setMerchantCaptureApproved', + 'merchant_capture_refused' => 'setMerchantCaptureRefused', + 'merchant_refund_approved' => 'setMerchantRefundApproved', + 'merchant_refund_refused' => 'setMerchantRefundRefused', + 'merchant_refused' => 'setMerchantRefused', + 'merchant_void' => 'setMerchantVoid', + 'shopper_approved' => 'setShopperApproved', + 'shopper_cancelled' => 'setShopperCancelled', + 'shopper_capture_approved' => 'setShopperCaptureApproved', + 'shopper_capture_refused' => 'setShopperCaptureRefused', + 'shopper_refund_approved' => 'setShopperRefundApproved', + 'shopper_refund_refused' => 'setShopperRefundRefused', + 'shopper_refused' => 'setShopperRefused', + 'shopper_void' => 'setShopperVoid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_approved' => 'getMerchantApproved', + 'merchant_cancelled' => 'getMerchantCancelled', + 'merchant_capture_approved' => 'getMerchantCaptureApproved', + 'merchant_capture_refused' => 'getMerchantCaptureRefused', + 'merchant_refund_approved' => 'getMerchantRefundApproved', + 'merchant_refund_refused' => 'getMerchantRefundRefused', + 'merchant_refused' => 'getMerchantRefused', + 'merchant_void' => 'getMerchantVoid', + 'shopper_approved' => 'getShopperApproved', + 'shopper_cancelled' => 'getShopperCancelled', + 'shopper_capture_approved' => 'getShopperCaptureApproved', + 'shopper_capture_refused' => 'getShopperCaptureRefused', + 'shopper_refund_approved' => 'getShopperRefundApproved', + 'shopper_refund_refused' => 'getShopperRefundRefused', + 'shopper_refused' => 'getShopperRefused', + 'shopper_void' => 'getShopperVoid' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_approved', $data ?? [], null); + $this->setIfExists('merchant_cancelled', $data ?? [], null); + $this->setIfExists('merchant_capture_approved', $data ?? [], null); + $this->setIfExists('merchant_capture_refused', $data ?? [], null); + $this->setIfExists('merchant_refund_approved', $data ?? [], null); + $this->setIfExists('merchant_refund_refused', $data ?? [], null); + $this->setIfExists('merchant_refused', $data ?? [], null); + $this->setIfExists('merchant_void', $data ?? [], null); + $this->setIfExists('shopper_approved', $data ?? [], null); + $this->setIfExists('shopper_cancelled', $data ?? [], null); + $this->setIfExists('shopper_capture_approved', $data ?? [], null); + $this->setIfExists('shopper_capture_refused', $data ?? [], null); + $this->setIfExists('shopper_refund_approved', $data ?? [], null); + $this->setIfExists('shopper_refund_refused', $data ?? [], null); + $this->setIfExists('shopper_refused', $data ?? [], null); + $this->setIfExists('shopper_void', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_approved + * + * @return bool|null + */ + public function getMerchantApproved() + { + return $this->container['merchant_approved']; + } + + /** + * Sets merchant_approved + * + * @param bool|null $merchant_approved Print a merchant receipt when the payment is approved. + * + * @return self + */ + public function setMerchantApproved($merchant_approved) + { + if (is_null($merchant_approved)) { + throw new \InvalidArgumentException('non-nullable merchant_approved cannot be null'); + } + $this->container['merchant_approved'] = $merchant_approved; + + return $this; + } + + /** + * Gets merchant_cancelled + * + * @return bool|null + */ + public function getMerchantCancelled() + { + return $this->container['merchant_cancelled']; + } + + /** + * Sets merchant_cancelled + * + * @param bool|null $merchant_cancelled Print a merchant receipt when the transaction is cancelled. + * + * @return self + */ + public function setMerchantCancelled($merchant_cancelled) + { + if (is_null($merchant_cancelled)) { + throw new \InvalidArgumentException('non-nullable merchant_cancelled cannot be null'); + } + $this->container['merchant_cancelled'] = $merchant_cancelled; + + return $this; + } + + /** + * Gets merchant_capture_approved + * + * @return bool|null + */ + public function getMerchantCaptureApproved() + { + return $this->container['merchant_capture_approved']; + } + + /** + * Sets merchant_capture_approved + * + * @param bool|null $merchant_capture_approved Print a merchant receipt when capturing the payment is approved. + * + * @return self + */ + public function setMerchantCaptureApproved($merchant_capture_approved) + { + if (is_null($merchant_capture_approved)) { + throw new \InvalidArgumentException('non-nullable merchant_capture_approved cannot be null'); + } + $this->container['merchant_capture_approved'] = $merchant_capture_approved; + + return $this; + } + + /** + * Gets merchant_capture_refused + * + * @return bool|null + */ + public function getMerchantCaptureRefused() + { + return $this->container['merchant_capture_refused']; + } + + /** + * Sets merchant_capture_refused + * + * @param bool|null $merchant_capture_refused Print a merchant receipt when capturing the payment is refused. + * + * @return self + */ + public function setMerchantCaptureRefused($merchant_capture_refused) + { + if (is_null($merchant_capture_refused)) { + throw new \InvalidArgumentException('non-nullable merchant_capture_refused cannot be null'); + } + $this->container['merchant_capture_refused'] = $merchant_capture_refused; + + return $this; + } + + /** + * Gets merchant_refund_approved + * + * @return bool|null + */ + public function getMerchantRefundApproved() + { + return $this->container['merchant_refund_approved']; + } + + /** + * Sets merchant_refund_approved + * + * @param bool|null $merchant_refund_approved Print a merchant receipt when the refund is approved. + * + * @return self + */ + public function setMerchantRefundApproved($merchant_refund_approved) + { + if (is_null($merchant_refund_approved)) { + throw new \InvalidArgumentException('non-nullable merchant_refund_approved cannot be null'); + } + $this->container['merchant_refund_approved'] = $merchant_refund_approved; + + return $this; + } + + /** + * Gets merchant_refund_refused + * + * @return bool|null + */ + public function getMerchantRefundRefused() + { + return $this->container['merchant_refund_refused']; + } + + /** + * Sets merchant_refund_refused + * + * @param bool|null $merchant_refund_refused Print a merchant receipt when the refund is refused. + * + * @return self + */ + public function setMerchantRefundRefused($merchant_refund_refused) + { + if (is_null($merchant_refund_refused)) { + throw new \InvalidArgumentException('non-nullable merchant_refund_refused cannot be null'); + } + $this->container['merchant_refund_refused'] = $merchant_refund_refused; + + return $this; + } + + /** + * Gets merchant_refused + * + * @return bool|null + */ + public function getMerchantRefused() + { + return $this->container['merchant_refused']; + } + + /** + * Sets merchant_refused + * + * @param bool|null $merchant_refused Print a merchant receipt when the payment is refused. + * + * @return self + */ + public function setMerchantRefused($merchant_refused) + { + if (is_null($merchant_refused)) { + throw new \InvalidArgumentException('non-nullable merchant_refused cannot be null'); + } + $this->container['merchant_refused'] = $merchant_refused; + + return $this; + } + + /** + * Gets merchant_void + * + * @return bool|null + */ + public function getMerchantVoid() + { + return $this->container['merchant_void']; + } + + /** + * Sets merchant_void + * + * @param bool|null $merchant_void Print a merchant receipt when a previous transaction is voided. + * + * @return self + */ + public function setMerchantVoid($merchant_void) + { + if (is_null($merchant_void)) { + throw new \InvalidArgumentException('non-nullable merchant_void cannot be null'); + } + $this->container['merchant_void'] = $merchant_void; + + return $this; + } + + /** + * Gets shopper_approved + * + * @return bool|null + */ + public function getShopperApproved() + { + return $this->container['shopper_approved']; + } + + /** + * Sets shopper_approved + * + * @param bool|null $shopper_approved Print a shopper receipt when the payment is approved. + * + * @return self + */ + public function setShopperApproved($shopper_approved) + { + if (is_null($shopper_approved)) { + throw new \InvalidArgumentException('non-nullable shopper_approved cannot be null'); + } + $this->container['shopper_approved'] = $shopper_approved; + + return $this; + } + + /** + * Gets shopper_cancelled + * + * @return bool|null + */ + public function getShopperCancelled() + { + return $this->container['shopper_cancelled']; + } + + /** + * Sets shopper_cancelled + * + * @param bool|null $shopper_cancelled Print a shopper receipt when the transaction is cancelled. + * + * @return self + */ + public function setShopperCancelled($shopper_cancelled) + { + if (is_null($shopper_cancelled)) { + throw new \InvalidArgumentException('non-nullable shopper_cancelled cannot be null'); + } + $this->container['shopper_cancelled'] = $shopper_cancelled; + + return $this; + } + + /** + * Gets shopper_capture_approved + * + * @return bool|null + */ + public function getShopperCaptureApproved() + { + return $this->container['shopper_capture_approved']; + } + + /** + * Sets shopper_capture_approved + * + * @param bool|null $shopper_capture_approved Print a shopper receipt when capturing the payment is approved. + * + * @return self + */ + public function setShopperCaptureApproved($shopper_capture_approved) + { + if (is_null($shopper_capture_approved)) { + throw new \InvalidArgumentException('non-nullable shopper_capture_approved cannot be null'); + } + $this->container['shopper_capture_approved'] = $shopper_capture_approved; + + return $this; + } + + /** + * Gets shopper_capture_refused + * + * @return bool|null + */ + public function getShopperCaptureRefused() + { + return $this->container['shopper_capture_refused']; + } + + /** + * Sets shopper_capture_refused + * + * @param bool|null $shopper_capture_refused Print a shopper receipt when capturing the payment is refused. + * + * @return self + */ + public function setShopperCaptureRefused($shopper_capture_refused) + { + if (is_null($shopper_capture_refused)) { + throw new \InvalidArgumentException('non-nullable shopper_capture_refused cannot be null'); + } + $this->container['shopper_capture_refused'] = $shopper_capture_refused; + + return $this; + } + + /** + * Gets shopper_refund_approved + * + * @return bool|null + */ + public function getShopperRefundApproved() + { + return $this->container['shopper_refund_approved']; + } + + /** + * Sets shopper_refund_approved + * + * @param bool|null $shopper_refund_approved Print a shopper receipt when the refund is approved. + * + * @return self + */ + public function setShopperRefundApproved($shopper_refund_approved) + { + if (is_null($shopper_refund_approved)) { + throw new \InvalidArgumentException('non-nullable shopper_refund_approved cannot be null'); + } + $this->container['shopper_refund_approved'] = $shopper_refund_approved; + + return $this; + } + + /** + * Gets shopper_refund_refused + * + * @return bool|null + */ + public function getShopperRefundRefused() + { + return $this->container['shopper_refund_refused']; + } + + /** + * Sets shopper_refund_refused + * + * @param bool|null $shopper_refund_refused Print a shopper receipt when the refund is refused. + * + * @return self + */ + public function setShopperRefundRefused($shopper_refund_refused) + { + if (is_null($shopper_refund_refused)) { + throw new \InvalidArgumentException('non-nullable shopper_refund_refused cannot be null'); + } + $this->container['shopper_refund_refused'] = $shopper_refund_refused; + + return $this; + } + + /** + * Gets shopper_refused + * + * @return bool|null + */ + public function getShopperRefused() + { + return $this->container['shopper_refused']; + } + + /** + * Sets shopper_refused + * + * @param bool|null $shopper_refused Print a shopper receipt when the payment is refused. + * + * @return self + */ + public function setShopperRefused($shopper_refused) + { + if (is_null($shopper_refused)) { + throw new \InvalidArgumentException('non-nullable shopper_refused cannot be null'); + } + $this->container['shopper_refused'] = $shopper_refused; + + return $this; + } + + /** + * Gets shopper_void + * + * @return bool|null + */ + public function getShopperVoid() + { + return $this->container['shopper_void']; + } + + /** + * Sets shopper_void + * + * @param bool|null $shopper_void Print a shopper receipt when a previous transaction is voided. + * + * @return self + */ + public function setShopperVoid($shopper_void) + { + if (is_null($shopper_void)) { + throw new \InvalidArgumentException('non-nullable shopper_void cannot be null'); + } + $this->container['shopper_void'] = $shopper_void; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ReleaseUpdateDetails.php b/src/Adyen/Model/Management/ReleaseUpdateDetails.php new file mode 100644 index 000000000..01547dd4a --- /dev/null +++ b/src/Adyen/Model/Management/ReleaseUpdateDetails.php @@ -0,0 +1,450 @@ + + */ +class ReleaseUpdateDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReleaseUpdateDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'update_at_first_maintenance_call' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'update_at_first_maintenance_call' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false, + 'update_at_first_maintenance_call' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'update_at_first_maintenance_call' => 'updateAtFirstMaintenanceCall' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'update_at_first_maintenance_call' => 'setUpdateAtFirstMaintenanceCall' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'update_at_first_maintenance_call' => 'getUpdateAtFirstMaintenanceCall' + ]; + + /** + * 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_RELEASE_UPDATE = 'ReleaseUpdate'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RELEASE_UPDATE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], 'ReleaseUpdate'); + $this->setIfExists('update_at_first_maintenance_call', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of terminal action: Update Release. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets update_at_first_maintenance_call + * + * @return bool|null + */ + public function getUpdateAtFirstMaintenanceCall() + { + return $this->container['update_at_first_maintenance_call']; + } + + /** + * Sets update_at_first_maintenance_call + * + * @param bool|null $update_at_first_maintenance_call Boolean flag that tells if the terminal should update at the first next maintenance call. If false, terminal will update on its configured reboot time. + * + * @return self + */ + public function setUpdateAtFirstMaintenanceCall($update_at_first_maintenance_call) + { + if (is_null($update_at_first_maintenance_call)) { + throw new \InvalidArgumentException('non-nullable update_at_first_maintenance_call cannot be null'); + } + $this->container['update_at_first_maintenance_call'] = $update_at_first_maintenance_call; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/RequestActivationResponse.php b/src/Adyen/Model/Management/RequestActivationResponse.php new file mode 100644 index 000000000..5d15e65de --- /dev/null +++ b/src/Adyen/Model/Management/RequestActivationResponse.php @@ -0,0 +1,419 @@ + + */ +class RequestActivationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RequestActivationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company_id' => 'string', + 'merchant_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_id' => null, + 'merchant_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'company_id' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_id' => 'companyId', + 'merchant_id' => 'merchantId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_id' => 'setCompanyId', + 'merchant_id' => 'setMerchantId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_id' => 'getCompanyId', + 'merchant_id' => 'getMerchantId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('company_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets company_id + * + * @return string|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param string|null $company_id The unique identifier of the company account. + * + * @return self + */ + public function setCompanyId($company_id) + { + if (is_null($company_id)) { + throw new \InvalidArgumentException('non-nullable company_id cannot be null'); + } + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets merchant_id + * + * @return string|null + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string|null $merchant_id The unique identifier of the merchant account you requested to activate. + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/RestServiceError.php b/src/Adyen/Model/Management/RestServiceError.php new file mode 100644 index 000000000..3c449651b --- /dev/null +++ b/src/Adyen/Model/Management/RestServiceError.php @@ -0,0 +1,670 @@ + + */ +class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RestServiceError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'error_code' => 'string', + 'instance' => 'string', + 'invalid_fields' => '\Adyen\Model\Management\InvalidField[]', + 'request_id' => 'string', + 'response' => '\Adyen\Model\Management\JSONObject', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'error_code' => null, + 'instance' => null, + 'invalid_fields' => null, + 'request_id' => null, + 'response' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'error_code' => false, + 'instance' => false, + 'invalid_fields' => false, + 'request_id' => false, + 'response' => false, + 'status' => true, + 'title' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detail' => 'detail', + 'error_code' => 'errorCode', + 'instance' => 'instance', + 'invalid_fields' => 'invalidFields', + 'request_id' => 'requestId', + 'response' => 'response', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'error_code' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalid_fields' => 'setInvalidFields', + 'request_id' => 'setRequestId', + 'response' => 'setResponse', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'error_code' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalid_fields' => 'getInvalidFields', + 'request_id' => 'getRequestId', + 'response' => 'getResponse', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalid_fields', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('response', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detail'] === null) { + $invalidProperties[] = "'detail' can't be null"; + } + if ($this->container['error_code'] === null) { + $invalidProperties[] = "'error_code' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets error_code + * + * @return string + */ + public function getErrorCode() + { + return $this->container['error_code']; + } + + /** + * Sets error_code + * + * @param string $error_code A code that identifies the problem type. + * + * @return self + */ + public function setErrorCode($error_code) + { + if (is_null($error_code)) { + throw new \InvalidArgumentException('non-nullable error_code cannot be null'); + } + $this->container['error_code'] = $error_code; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A unique URI that identifies the specific occurrence of the problem. + * + * @return self + */ + public function setInstance($instance) + { + if (is_null($instance)) { + throw new \InvalidArgumentException('non-nullable instance cannot be null'); + } + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalid_fields + * + * @return \Adyen\Model\Management\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalid_fields']; + } + + /** + * Sets invalid_fields + * + * @param \Adyen\Model\Management\InvalidField[]|null $invalid_fields Detailed explanation of each validation error, when applicable. + * + * @return self + */ + public function setInvalidFields($invalid_fields) + { + if (is_null($invalid_fields)) { + throw new \InvalidArgumentException('non-nullable invalid_fields cannot be null'); + } + $this->container['invalid_fields'] = $invalid_fields; + + return $this; + } + + /** + * Gets request_id + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string|null $request_id A unique reference for the request, essentially the same as `pspReference`. + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets response + * + * @return \Adyen\Model\Management\JSONObject|null + */ + public function getResponse() + { + return $this->container['response']; + } + + /** + * Sets response + * + * @param \Adyen\Model\Management\JSONObject|null $response response + * + * @return self + */ + public function setResponse($response) + { + if (is_null($response)) { + throw new \InvalidArgumentException('non-nullable response cannot be null'); + } + $this->container['response'] = $response; + + return $this; + } + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + // Do nothing for nullable integers + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type A URI that identifies the problem type, pointing to human-readable documentation on this problem type. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ScheduleTerminalActionsRequest.php b/src/Adyen/Model/Management/ScheduleTerminalActionsRequest.php new file mode 100644 index 000000000..dfcbcbc1e --- /dev/null +++ b/src/Adyen/Model/Management/ScheduleTerminalActionsRequest.php @@ -0,0 +1,487 @@ + + */ +class ScheduleTerminalActionsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScheduleTerminalActionsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action_details' => '\Adyen\Model\Management\ScheduleTerminalActionsRequestActionDetails', + 'scheduled_at' => 'string', + 'store_id' => 'string', + 'terminal_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action_details' => null, + 'scheduled_at' => null, + 'store_id' => null, + 'terminal_ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'action_details' => false, + 'scheduled_at' => false, + 'store_id' => false, + 'terminal_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action_details' => 'actionDetails', + 'scheduled_at' => 'scheduledAt', + 'store_id' => 'storeId', + 'terminal_ids' => 'terminalIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action_details' => 'setActionDetails', + 'scheduled_at' => 'setScheduledAt', + 'store_id' => 'setStoreId', + 'terminal_ids' => 'setTerminalIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action_details' => 'getActionDetails', + 'scheduled_at' => 'getScheduledAt', + 'store_id' => 'getStoreId', + 'terminal_ids' => 'getTerminalIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('action_details', $data ?? [], null); + $this->setIfExists('scheduled_at', $data ?? [], null); + $this->setIfExists('store_id', $data ?? [], null); + $this->setIfExists('terminal_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action_details + * + * @return \Adyen\Model\Management\ScheduleTerminalActionsRequestActionDetails|null + */ + public function getActionDetails() + { + return $this->container['action_details']; + } + + /** + * Sets action_details + * + * @param \Adyen\Model\Management\ScheduleTerminalActionsRequestActionDetails|null $action_details action_details + * + * @return self + */ + public function setActionDetails($action_details) + { + if (is_null($action_details)) { + throw new \InvalidArgumentException('non-nullable action_details cannot be null'); + } + $this->container['action_details'] = $action_details; + + return $this; + } + + /** + * Gets scheduled_at + * + * @return string|null + */ + public function getScheduledAt() + { + return $this->container['scheduled_at']; + } + + /** + * Sets scheduled_at + * + * @param string|null $scheduled_at The date and time when the action should happen. Format: [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339), but without the **Z** before the time offset. For example, **2021-11-15T12:16:21+01:00** The action is sent with the first [maintenance call](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api#when-actions-take-effect) after the specified date and time in the time zone of the terminal. An empty value causes the action to be sent as soon as possible: at the next maintenance call. + * + * @return self + */ + public function setScheduledAt($scheduled_at) + { + if (is_null($scheduled_at)) { + throw new \InvalidArgumentException('non-nullable scheduled_at cannot be null'); + } + $this->container['scheduled_at'] = $scheduled_at; + + return $this; + } + + /** + * Gets store_id + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['store_id']; + } + + /** + * Sets store_id + * + * @param string|null $store_id The unique ID of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/stores). If present, all terminals in the `terminalIds` list must be assigned to this store. + * + * @return self + */ + public function setStoreId($store_id) + { + if (is_null($store_id)) { + throw new \InvalidArgumentException('non-nullable store_id cannot be null'); + } + $this->container['store_id'] = $store_id; + + return $this; + } + + /** + * Gets terminal_ids + * + * @return string[]|null + */ + public function getTerminalIds() + { + return $this->container['terminal_ids']; + } + + /** + * Sets terminal_ids + * + * @param string[]|null $terminal_ids A list of unique IDs of the terminals to apply the action to. You can extract the IDs from the [GET `/terminals`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/terminals) response. Maximum length: 100 IDs. + * + * @return self + */ + public function setTerminalIds($terminal_ids) + { + if (is_null($terminal_ids)) { + throw new \InvalidArgumentException('non-nullable terminal_ids cannot be null'); + } + $this->container['terminal_ids'] = $terminal_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.php b/src/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.php new file mode 100644 index 000000000..13c5bba70 --- /dev/null +++ b/src/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.php @@ -0,0 +1,488 @@ + + */ +class ScheduleTerminalActionsRequestActionDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScheduleTerminalActionsRequest_actionDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'app_id' => 'string', + 'type' => 'string', + 'certificate_id' => 'string', + 'update_at_first_maintenance_call' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'app_id' => null, + 'type' => null, + 'certificate_id' => null, + 'update_at_first_maintenance_call' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'app_id' => false, + 'type' => false, + 'certificate_id' => false, + 'update_at_first_maintenance_call' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'app_id' => 'appId', + 'type' => 'type', + 'certificate_id' => 'certificateId', + 'update_at_first_maintenance_call' => 'updateAtFirstMaintenanceCall' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'app_id' => 'setAppId', + 'type' => 'setType', + 'certificate_id' => 'setCertificateId', + 'update_at_first_maintenance_call' => 'setUpdateAtFirstMaintenanceCall' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'app_id' => 'getAppId', + 'type' => 'getType', + 'certificate_id' => 'getCertificateId', + 'update_at_first_maintenance_call' => 'getUpdateAtFirstMaintenanceCall' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('app_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'UninstallAndroidCertificate'); + $this->setIfExists('certificate_id', $data ?? [], null); + $this->setIfExists('update_at_first_maintenance_call', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets app_id + * + * @return string|null + */ + public function getAppId() + { + return $this->container['app_id']; + } + + /** + * Sets app_id + * + * @param string|null $app_id The unique identifier of the app to be uninstalled. + * + * @return self + */ + public function setAppId($app_id) + { + if (is_null($app_id)) { + throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + } + $this->container['app_id'] = $app_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of terminal action: Uninstall an Android certificate. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets certificate_id + * + * @return string|null + */ + public function getCertificateId() + { + return $this->container['certificate_id']; + } + + /** + * Sets certificate_id + * + * @param string|null $certificate_id The unique identifier of the certificate to be uninstalled. + * + * @return self + */ + public function setCertificateId($certificate_id) + { + if (is_null($certificate_id)) { + throw new \InvalidArgumentException('non-nullable certificate_id cannot be null'); + } + $this->container['certificate_id'] = $certificate_id; + + return $this; + } + + /** + * Gets update_at_first_maintenance_call + * + * @return bool|null + */ + public function getUpdateAtFirstMaintenanceCall() + { + return $this->container['update_at_first_maintenance_call']; + } + + /** + * Sets update_at_first_maintenance_call + * + * @param bool|null $update_at_first_maintenance_call Boolean flag that tells if the terminal should update at the first next maintenance call. If false, terminal will update on its configured reboot time. + * + * @return self + */ + public function setUpdateAtFirstMaintenanceCall($update_at_first_maintenance_call) + { + if (is_null($update_at_first_maintenance_call)) { + throw new \InvalidArgumentException('non-nullable update_at_first_maintenance_call cannot be null'); + } + $this->container['update_at_first_maintenance_call'] = $update_at_first_maintenance_call; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ScheduleTerminalActionsResponse.php b/src/Adyen/Model/Management/ScheduleTerminalActionsResponse.php new file mode 100644 index 000000000..d7f81b7c6 --- /dev/null +++ b/src/Adyen/Model/Management/ScheduleTerminalActionsResponse.php @@ -0,0 +1,621 @@ + + */ +class ScheduleTerminalActionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScheduleTerminalActionsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action_details' => '\Adyen\Model\Management\ScheduleTerminalActionsRequestActionDetails', + 'items' => '\Adyen\Model\Management\TerminalActionScheduleDetail[]', + 'scheduled_at' => 'string', + 'store_id' => 'string', + 'terminal_ids' => 'string[]', + 'terminals_with_errors' => 'array', + 'total_errors' => 'int', + 'total_scheduled' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action_details' => null, + 'items' => null, + 'scheduled_at' => null, + 'store_id' => null, + 'terminal_ids' => null, + 'terminals_with_errors' => null, + 'total_errors' => 'int32', + 'total_scheduled' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'action_details' => false, + 'items' => false, + 'scheduled_at' => false, + 'store_id' => false, + 'terminal_ids' => false, + 'terminals_with_errors' => false, + 'total_errors' => true, + 'total_scheduled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action_details' => 'actionDetails', + 'items' => 'items', + 'scheduled_at' => 'scheduledAt', + 'store_id' => 'storeId', + 'terminal_ids' => 'terminalIds', + 'terminals_with_errors' => 'terminalsWithErrors', + 'total_errors' => 'totalErrors', + 'total_scheduled' => 'totalScheduled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action_details' => 'setActionDetails', + 'items' => 'setItems', + 'scheduled_at' => 'setScheduledAt', + 'store_id' => 'setStoreId', + 'terminal_ids' => 'setTerminalIds', + 'terminals_with_errors' => 'setTerminalsWithErrors', + 'total_errors' => 'setTotalErrors', + 'total_scheduled' => 'setTotalScheduled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action_details' => 'getActionDetails', + 'items' => 'getItems', + 'scheduled_at' => 'getScheduledAt', + 'store_id' => 'getStoreId', + 'terminal_ids' => 'getTerminalIds', + 'terminals_with_errors' => 'getTerminalsWithErrors', + 'total_errors' => 'getTotalErrors', + 'total_scheduled' => 'getTotalScheduled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('action_details', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('scheduled_at', $data ?? [], null); + $this->setIfExists('store_id', $data ?? [], null); + $this->setIfExists('terminal_ids', $data ?? [], null); + $this->setIfExists('terminals_with_errors', $data ?? [], null); + $this->setIfExists('total_errors', $data ?? [], null); + $this->setIfExists('total_scheduled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action_details + * + * @return \Adyen\Model\Management\ScheduleTerminalActionsRequestActionDetails|null + */ + public function getActionDetails() + { + return $this->container['action_details']; + } + + /** + * Sets action_details + * + * @param \Adyen\Model\Management\ScheduleTerminalActionsRequestActionDetails|null $action_details action_details + * + * @return self + */ + public function setActionDetails($action_details) + { + if (is_null($action_details)) { + throw new \InvalidArgumentException('non-nullable action_details cannot be null'); + } + $this->container['action_details'] = $action_details; + + return $this; + } + + /** + * Gets items + * + * @return \Adyen\Model\Management\TerminalActionScheduleDetail[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Adyen\Model\Management\TerminalActionScheduleDetail[]|null $items A list containing a terminal ID and an action ID for each terminal that the action was scheduled for. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets scheduled_at + * + * @return string|null + */ + public function getScheduledAt() + { + return $this->container['scheduled_at']; + } + + /** + * Sets scheduled_at + * + * @param string|null $scheduled_at The date and time when the action should happen. Format: [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339), but without the **Z** before the time offset. For example, **2021-11-15T12:16:21+01:00** The action is sent with the first [maintenance call](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api#when-actions-take-effect) after the specified date and time in the time zone of the terminal. An empty value causes the action to be sent as soon as possible: at the next maintenance call. + * + * @return self + */ + public function setScheduledAt($scheduled_at) + { + if (is_null($scheduled_at)) { + throw new \InvalidArgumentException('non-nullable scheduled_at cannot be null'); + } + $this->container['scheduled_at'] = $scheduled_at; + + return $this; + } + + /** + * Gets store_id + * + * @return string|null + */ + public function getStoreId() + { + return $this->container['store_id']; + } + + /** + * Sets store_id + * + * @param string|null $store_id The unique ID of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/stores). If present, all terminals in the `terminalIds` list must be assigned to this store. + * + * @return self + */ + public function setStoreId($store_id) + { + if (is_null($store_id)) { + throw new \InvalidArgumentException('non-nullable store_id cannot be null'); + } + $this->container['store_id'] = $store_id; + + return $this; + } + + /** + * Gets terminal_ids + * + * @return string[]|null + * @deprecated + */ + public function getTerminalIds() + { + return $this->container['terminal_ids']; + } + + /** + * Sets terminal_ids + * + * @param string[]|null $terminal_ids A list of unique IDs of the terminals that the action applies to. + * + * @return self + * @deprecated + */ + public function setTerminalIds($terminal_ids) + { + if (is_null($terminal_ids)) { + throw new \InvalidArgumentException('non-nullable terminal_ids cannot be null'); + } + $this->container['terminal_ids'] = $terminal_ids; + + return $this; + } + + /** + * Gets terminals_with_errors + * + * @return array|null + */ + public function getTerminalsWithErrors() + { + return $this->container['terminals_with_errors']; + } + + /** + * Sets terminals_with_errors + * + * @param array|null $terminals_with_errors The validation errors that occurred in the list of terminals, and for each error the IDs of the terminals that the error applies to. + * + * @return self + */ + public function setTerminalsWithErrors($terminals_with_errors) + { + if (is_null($terminals_with_errors)) { + throw new \InvalidArgumentException('non-nullable terminals_with_errors cannot be null'); + } + $this->container['terminals_with_errors'] = $terminals_with_errors; + + return $this; + } + + /** + * Gets total_errors + * + * @return int|null + */ + public function getTotalErrors() + { + return $this->container['total_errors']; + } + + /** + * Sets total_errors + * + * @param int|null $total_errors The number of terminals for which scheduling the action failed. + * + * @return self + */ + public function setTotalErrors($total_errors) + { + // Do nothing for nullable integers + $this->container['total_errors'] = $total_errors; + + return $this; + } + + /** + * Gets total_scheduled + * + * @return int|null + */ + public function getTotalScheduled() + { + return $this->container['total_scheduled']; + } + + /** + * Sets total_scheduled + * + * @param int|null $total_scheduled The number of terminals for which the action was successfully scheduled. This doesn't mean the action has happened yet. + * + * @return self + */ + public function setTotalScheduled($total_scheduled) + { + // Do nothing for nullable integers + $this->container['total_scheduled'] = $total_scheduled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Settings.php b/src/Adyen/Model/Management/Settings.php new file mode 100644 index 000000000..fdddb0c5b --- /dev/null +++ b/src/Adyen/Model/Management/Settings.php @@ -0,0 +1,451 @@ + + */ +class Settings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Settings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'band' => 'string', + 'roaming' => 'bool', + 'timeout' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'band' => null, + 'roaming' => null, + 'timeout' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'band' => false, + 'roaming' => false, + 'timeout' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'band' => 'band', + 'roaming' => 'roaming', + 'timeout' => 'timeout' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'band' => 'setBand', + 'roaming' => 'setRoaming', + 'timeout' => 'setTimeout' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'band' => 'getBand', + 'roaming' => 'getRoaming', + 'timeout' => 'getTimeout' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('band', $data ?? [], null); + $this->setIfExists('roaming', $data ?? [], null); + $this->setIfExists('timeout', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets band + * + * @return string|null + */ + public function getBand() + { + return $this->container['band']; + } + + /** + * Sets band + * + * @param string|null $band The preferred Wi-Fi band, for use if the terminals support multiple bands. Possible values: All, 2.4GHz, 5GHz. + * + * @return self + */ + public function setBand($band) + { + if (is_null($band)) { + throw new \InvalidArgumentException('non-nullable band cannot be null'); + } + $this->container['band'] = $band; + + return $this; + } + + /** + * Gets roaming + * + * @return bool|null + */ + public function getRoaming() + { + return $this->container['roaming']; + } + + /** + * Sets roaming + * + * @param bool|null $roaming Indicates whether roaming is enabled on the terminals. + * + * @return self + */ + public function setRoaming($roaming) + { + if (is_null($roaming)) { + throw new \InvalidArgumentException('non-nullable roaming cannot be null'); + } + $this->container['roaming'] = $roaming; + + return $this; + } + + /** + * Gets timeout + * + * @return int|null + */ + public function getTimeout() + { + return $this->container['timeout']; + } + + /** + * Sets timeout + * + * @param int|null $timeout The connection time-out in seconds. Minimum value: 0. + * + * @return self + */ + public function setTimeout($timeout) + { + // Do nothing for nullable integers + $this->container['timeout'] = $timeout; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ShippingLocation.php b/src/Adyen/Model/Management/ShippingLocation.php new file mode 100644 index 000000000..cf5c1759b --- /dev/null +++ b/src/Adyen/Model/Management/ShippingLocation.php @@ -0,0 +1,487 @@ + + */ +class ShippingLocation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShippingLocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\Management\Address', + 'contact' => '\Adyen\Model\Management\Contact', + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'contact' => null, + 'id' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'contact' => false, + 'id' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'contact' => 'contact', + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'contact' => 'setContact', + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'contact' => 'getContact', + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('contact', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\Management\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Management\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets contact + * + * @return \Adyen\Model\Management\Contact|null + */ + public function getContact() + { + return $this->container['contact']; + } + + /** + * Sets contact + * + * @param \Adyen\Model\Management\Contact|null $contact contact + * + * @return self + */ + public function setContact($contact) + { + if (is_null($contact)) { + throw new \InvalidArgumentException('non-nullable contact cannot be null'); + } + $this->container['contact'] = $contact; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the shipping location, for use as `shippingLocationId` when creating an order. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The unique name of the shipping location. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ShippingLocationsResponse.php b/src/Adyen/Model/Management/ShippingLocationsResponse.php new file mode 100644 index 000000000..95b026848 --- /dev/null +++ b/src/Adyen/Model/Management/ShippingLocationsResponse.php @@ -0,0 +1,385 @@ + + */ +class ShippingLocationsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShippingLocationsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\ShippingLocation[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\ShippingLocation[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\ShippingLocation[]|null $data Physical locations where orders can be shipped to. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/ShopperStatement.php b/src/Adyen/Model/Management/ShopperStatement.php new file mode 100644 index 000000000..47c503411 --- /dev/null +++ b/src/Adyen/Model/Management/ShopperStatement.php @@ -0,0 +1,454 @@ + + */ +class ShopperStatement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShopperStatement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'doing_business_as_name' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'doing_business_as_name' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'doing_business_as_name' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'doing_business_as_name' => 'doingBusinessAsName', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'doing_business_as_name' => 'setDoingBusinessAsName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'doing_business_as_name' => 'getDoingBusinessAsName', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_APPEND = 'append'; + public const TYPE_DYNAMIC = 'dynamic'; + public const TYPE_FIXED = 'fixed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_APPEND, + self::TYPE_DYNAMIC, + self::TYPE_FIXED, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('doing_business_as_name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'dynamic'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets doing_business_as_name + * + * @return string|null + */ + public function getDoingBusinessAsName() + { + return $this->container['doing_business_as_name']; + } + + /** + * Sets doing_business_as_name + * + * @param string|null $doing_business_as_name The name you want to be shown on the shopper's bank or credit card statement. Can't be all numbers. If a shopper statement is present, this field is required. + * + * @return self + */ + public function setDoingBusinessAsName($doing_business_as_name) + { + if (is_null($doing_business_as_name)) { + throw new \InvalidArgumentException('non-nullable doing_business_as_name cannot be null'); + } + $this->container['doing_business_as_name'] = $doing_business_as_name; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of shopperstatement you want to use: fixed, append or dynamic + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Signature.php b/src/Adyen/Model/Management/Signature.php new file mode 100644 index 000000000..30829b82a --- /dev/null +++ b/src/Adyen/Model/Management/Signature.php @@ -0,0 +1,487 @@ + + */ +class Signature implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Signature'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask_signature_on_screen' => 'bool', + 'device_name' => 'string', + 'device_slogan' => 'string', + 'skip_signature' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask_signature_on_screen' => null, + 'device_name' => null, + 'device_slogan' => null, + 'skip_signature' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'ask_signature_on_screen' => false, + 'device_name' => false, + 'device_slogan' => false, + 'skip_signature' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask_signature_on_screen' => 'askSignatureOnScreen', + 'device_name' => 'deviceName', + 'device_slogan' => 'deviceSlogan', + 'skip_signature' => 'skipSignature' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask_signature_on_screen' => 'setAskSignatureOnScreen', + 'device_name' => 'setDeviceName', + 'device_slogan' => 'setDeviceSlogan', + 'skip_signature' => 'setSkipSignature' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask_signature_on_screen' => 'getAskSignatureOnScreen', + 'device_name' => 'getDeviceName', + 'device_slogan' => 'getDeviceSlogan', + 'skip_signature' => 'getSkipSignature' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ask_signature_on_screen', $data ?? [], null); + $this->setIfExists('device_name', $data ?? [], null); + $this->setIfExists('device_slogan', $data ?? [], null); + $this->setIfExists('skip_signature', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ask_signature_on_screen + * + * @return bool|null + */ + public function getAskSignatureOnScreen() + { + return $this->container['ask_signature_on_screen']; + } + + /** + * Sets ask_signature_on_screen + * + * @param bool|null $ask_signature_on_screen If `skipSignature` is false, indicates whether the shopper should provide a signature on the display (**true**) or on the merchant receipt (**false**). + * + * @return self + */ + public function setAskSignatureOnScreen($ask_signature_on_screen) + { + if (is_null($ask_signature_on_screen)) { + throw new \InvalidArgumentException('non-nullable ask_signature_on_screen cannot be null'); + } + $this->container['ask_signature_on_screen'] = $ask_signature_on_screen; + + return $this; + } + + /** + * Gets device_name + * + * @return string|null + */ + public function getDeviceName() + { + return $this->container['device_name']; + } + + /** + * Sets device_name + * + * @param string|null $device_name Name that identifies the terminal. + * + * @return self + */ + public function setDeviceName($device_name) + { + if (is_null($device_name)) { + throw new \InvalidArgumentException('non-nullable device_name cannot be null'); + } + $this->container['device_name'] = $device_name; + + return $this; + } + + /** + * Gets device_slogan + * + * @return string|null + */ + public function getDeviceSlogan() + { + return $this->container['device_slogan']; + } + + /** + * Sets device_slogan + * + * @param string|null $device_slogan Slogan shown on the start screen of the device. + * + * @return self + */ + public function setDeviceSlogan($device_slogan) + { + if (is_null($device_slogan)) { + throw new \InvalidArgumentException('non-nullable device_slogan cannot be null'); + } + $this->container['device_slogan'] = $device_slogan; + + return $this; + } + + /** + * Gets skip_signature + * + * @return bool|null + */ + public function getSkipSignature() + { + return $this->container['skip_signature']; + } + + /** + * Sets skip_signature + * + * @param bool|null $skip_signature Skip asking for a signature. This is possible because all global card schemes (American Express, Diners, Discover, JCB, MasterCard, VISA, and UnionPay) regard a signature as optional. + * + * @return self + */ + public function setSkipSignature($skip_signature) + { + if (is_null($skip_signature)) { + throw new \InvalidArgumentException('non-nullable skip_signature cannot be null'); + } + $this->container['skip_signature'] = $skip_signature; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/SofortInfo.php b/src/Adyen/Model/Management/SofortInfo.php new file mode 100644 index 000000000..2e30a8bb5 --- /dev/null +++ b/src/Adyen/Model/Management/SofortInfo.php @@ -0,0 +1,425 @@ + + */ +class SofortInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SofortInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency_code' => 'string', + 'logo' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_code' => null, + 'logo' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency_code' => false, + 'logo' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_code' => 'currencyCode', + 'logo' => 'logo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_code' => 'setCurrencyCode', + 'logo' => 'setLogo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_code' => 'getCurrencyCode', + 'logo' => 'getLogo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency_code', $data ?? [], null); + $this->setIfExists('logo', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency_code'] === null) { + $invalidProperties[] = "'currency_code' can't be null"; + } + if ($this->container['logo'] === null) { + $invalidProperties[] = "'logo' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_code + * + * @return string + */ + public function getCurrencyCode() + { + return $this->container['currency_code']; + } + + /** + * Sets currency_code + * + * @param string $currency_code Sofort currency code. For example, **EUR**. + * + * @return self + */ + public function setCurrencyCode($currency_code) + { + if (is_null($currency_code)) { + throw new \InvalidArgumentException('non-nullable currency_code cannot be null'); + } + $this->container['currency_code'] = $currency_code; + + return $this; + } + + /** + * Gets logo + * + * @return string + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string $logo Sofort logo. Format: Base64-encoded string. + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Standalone.php b/src/Adyen/Model/Management/Standalone.php new file mode 100644 index 000000000..2e0fa217d --- /dev/null +++ b/src/Adyen/Model/Management/Standalone.php @@ -0,0 +1,419 @@ + + */ +class Standalone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Standalone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency_code' => 'string', + 'enable_standalone' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_code' => null, + 'enable_standalone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency_code' => false, + 'enable_standalone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_code' => 'currencyCode', + 'enable_standalone' => 'enableStandalone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_code' => 'setCurrencyCode', + 'enable_standalone' => 'setEnableStandalone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_code' => 'getCurrencyCode', + 'enable_standalone' => 'getEnableStandalone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency_code', $data ?? [], null); + $this->setIfExists('enable_standalone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_code + * + * @return string|null + */ + public function getCurrencyCode() + { + return $this->container['currency_code']; + } + + /** + * Sets currency_code + * + * @param string|null $currency_code The default currency of the standalone payment terminal as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. + * + * @return self + */ + public function setCurrencyCode($currency_code) + { + if (is_null($currency_code)) { + throw new \InvalidArgumentException('non-nullable currency_code cannot be null'); + } + $this->container['currency_code'] = $currency_code; + + return $this; + } + + /** + * Gets enable_standalone + * + * @return bool|null + */ + public function getEnableStandalone() + { + return $this->container['enable_standalone']; + } + + /** + * Sets enable_standalone + * + * @param bool|null $enable_standalone Enable standalone mode. + * + * @return self + */ + public function setEnableStandalone($enable_standalone) + { + if (is_null($enable_standalone)) { + throw new \InvalidArgumentException('non-nullable enable_standalone cannot be null'); + } + $this->container['enable_standalone'] = $enable_standalone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Store.php b/src/Adyen/Model/Management/Store.php new file mode 100644 index 000000000..028dd6ac4 --- /dev/null +++ b/src/Adyen/Model/Management/Store.php @@ -0,0 +1,794 @@ + + */ +class Store implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Store'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\Links', + 'address' => '\Adyen\Model\Management\StoreLocation', + 'business_line_ids' => 'string[]', + 'description' => 'string', + 'external_reference_id' => 'string', + 'id' => 'string', + 'merchant_id' => 'string', + 'phone_number' => 'string', + 'reference' => 'string', + 'shopper_statement' => 'string', + 'split_configuration' => '\Adyen\Model\Management\StoreSplitConfiguration', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'address' => null, + 'business_line_ids' => null, + 'description' => null, + 'external_reference_id' => null, + 'id' => null, + 'merchant_id' => null, + 'phone_number' => null, + 'reference' => null, + 'shopper_statement' => null, + 'split_configuration' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'address' => false, + 'business_line_ids' => false, + 'description' => false, + 'external_reference_id' => false, + 'id' => false, + 'merchant_id' => false, + 'phone_number' => false, + 'reference' => false, + 'shopper_statement' => false, + 'split_configuration' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'address' => 'address', + 'business_line_ids' => 'businessLineIds', + 'description' => 'description', + 'external_reference_id' => 'externalReferenceId', + 'id' => 'id', + 'merchant_id' => 'merchantId', + 'phone_number' => 'phoneNumber', + 'reference' => 'reference', + 'shopper_statement' => 'shopperStatement', + 'split_configuration' => 'splitConfiguration', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'address' => 'setAddress', + 'business_line_ids' => 'setBusinessLineIds', + 'description' => 'setDescription', + 'external_reference_id' => 'setExternalReferenceId', + 'id' => 'setId', + 'merchant_id' => 'setMerchantId', + 'phone_number' => 'setPhoneNumber', + 'reference' => 'setReference', + 'shopper_statement' => 'setShopperStatement', + 'split_configuration' => 'setSplitConfiguration', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'address' => 'getAddress', + 'business_line_ids' => 'getBusinessLineIds', + 'description' => 'getDescription', + 'external_reference_id' => 'getExternalReferenceId', + 'id' => 'getId', + 'merchant_id' => 'getMerchantId', + 'phone_number' => 'getPhoneNumber', + 'reference' => 'getReference', + 'shopper_statement' => 'getShopperStatement', + 'split_configuration' => 'getSplitConfiguration', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('business_line_ids', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('external_reference_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('split_configuration', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _links + * + * @return \Adyen\Model\Management\Links|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\Links|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets address + * + * @return \Adyen\Model\Management\StoreLocation|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Management\StoreLocation|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets business_line_ids + * + * @return string[]|null + */ + public function getBusinessLineIds() + { + return $this->container['business_line_ids']; + } + + /** + * Sets business_line_ids + * + * @param string[]|null $business_line_ids The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. + * + * @return self + */ + public function setBusinessLineIds($business_line_ids) + { + if (is_null($business_line_ids)) { + throw new \InvalidArgumentException('non-nullable business_line_ids cannot be null'); + } + $this->container['business_line_ids'] = $business_line_ids; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the store. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets external_reference_id + * + * @return string|null + */ + public function getExternalReferenceId() + { + return $this->container['external_reference_id']; + } + + /** + * Sets external_reference_id + * + * @param string|null $external_reference_id When using the Zip payment method: The location ID that Zip has assigned to your store. + * + * @return self + */ + public function setExternalReferenceId($external_reference_id) + { + if (is_null($external_reference_id)) { + throw new \InvalidArgumentException('non-nullable external_reference_id cannot be null'); + } + $this->container['external_reference_id'] = $external_reference_id; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the store. This value is generated by Adyen. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets merchant_id + * + * @return string|null + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string|null $merchant_id The unique identifier of the merchant account that the store belongs to. + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + $this->container['merchant_id'] = $merchant_id; + + 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 store, including '+' and country code. + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference A reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_) + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string|null $shopper_statement The store name shown on the shopper's bank or credit card statement and on the shopper receipt. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets split_configuration + * + * @return \Adyen\Model\Management\StoreSplitConfiguration|null + */ + public function getSplitConfiguration() + { + return $this->container['split_configuration']; + } + + /** + * Sets split_configuration + * + * @param \Adyen\Model\Management\StoreSplitConfiguration|null $split_configuration split_configuration + * + * @return self + */ + public function setSplitConfiguration($split_configuration) + { + if (is_null($split_configuration)) { + throw new \InvalidArgumentException('non-nullable split_configuration cannot be null'); + } + $this->container['split_configuration'] = $split_configuration; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the store. Possible values are: - **active**. This value is assigned automatically when a store is created. - **inactive**. The terminals under the store are blocked from accepting new transactions, but capturing outstanding transactions is still possible. - **closed**. This status is irreversible. The terminals under the store are reassigned to the merchant inventory. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/StoreCreationRequest.php b/src/Adyen/Model/Management/StoreCreationRequest.php new file mode 100644 index 000000000..30fd05d8a --- /dev/null +++ b/src/Adyen/Model/Management/StoreCreationRequest.php @@ -0,0 +1,635 @@ + + */ +class StoreCreationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoreCreationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\Management\StoreLocation', + 'business_line_ids' => 'string[]', + 'description' => 'string', + 'external_reference_id' => 'string', + 'phone_number' => 'string', + 'reference' => 'string', + 'shopper_statement' => 'string', + 'split_configuration' => '\Adyen\Model\Management\StoreSplitConfiguration' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'business_line_ids' => null, + 'description' => null, + 'external_reference_id' => null, + 'phone_number' => null, + 'reference' => null, + 'shopper_statement' => null, + 'split_configuration' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'business_line_ids' => false, + 'description' => false, + 'external_reference_id' => false, + 'phone_number' => false, + 'reference' => false, + 'shopper_statement' => false, + 'split_configuration' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'business_line_ids' => 'businessLineIds', + 'description' => 'description', + 'external_reference_id' => 'externalReferenceId', + 'phone_number' => 'phoneNumber', + 'reference' => 'reference', + 'shopper_statement' => 'shopperStatement', + 'split_configuration' => 'splitConfiguration' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'business_line_ids' => 'setBusinessLineIds', + 'description' => 'setDescription', + 'external_reference_id' => 'setExternalReferenceId', + 'phone_number' => 'setPhoneNumber', + 'reference' => 'setReference', + 'shopper_statement' => 'setShopperStatement', + 'split_configuration' => 'setSplitConfiguration' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'business_line_ids' => 'getBusinessLineIds', + 'description' => 'getDescription', + 'external_reference_id' => 'getExternalReferenceId', + 'phone_number' => 'getPhoneNumber', + 'reference' => 'getReference', + 'shopper_statement' => 'getShopperStatement', + 'split_configuration' => 'getSplitConfiguration' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('business_line_ids', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('external_reference_id', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('split_configuration', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['phone_number'] === null) { + $invalidProperties[] = "'phone_number' can't be null"; + } + if ($this->container['shopper_statement'] === null) { + $invalidProperties[] = "'shopper_statement' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\Management\StoreLocation + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Management\StoreLocation $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets business_line_ids + * + * @return string[]|null + */ + public function getBusinessLineIds() + { + return $this->container['business_line_ids']; + } + + /** + * Sets business_line_ids + * + * @param string[]|null $business_line_ids The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. + * + * @return self + */ + public function setBusinessLineIds($business_line_ids) + { + if (is_null($business_line_ids)) { + throw new \InvalidArgumentException('non-nullable business_line_ids cannot be null'); + } + $this->container['business_line_ids'] = $business_line_ids; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description of the store. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets external_reference_id + * + * @return string|null + */ + public function getExternalReferenceId() + { + return $this->container['external_reference_id']; + } + + /** + * Sets external_reference_id + * + * @param string|null $external_reference_id When using the Zip payment method: The location ID that Zip has assigned to your store. + * + * @return self + */ + public function setExternalReferenceId($external_reference_id) + { + if (is_null($external_reference_id)) { + throw new \InvalidArgumentException('non-nullable external_reference_id cannot be null'); + } + $this->container['external_reference_id'] = $external_reference_id; + + return $this; + } + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number The phone number of the store, including '+' and country code. + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string $shopper_statement The store name to be shown on the shopper's bank or credit card statement and on the shopper receipt. Maximum length: 22 characters; can't be all numbers. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets split_configuration + * + * @return \Adyen\Model\Management\StoreSplitConfiguration|null + */ + public function getSplitConfiguration() + { + return $this->container['split_configuration']; + } + + /** + * Sets split_configuration + * + * @param \Adyen\Model\Management\StoreSplitConfiguration|null $split_configuration split_configuration + * + * @return self + */ + public function setSplitConfiguration($split_configuration) + { + if (is_null($split_configuration)) { + throw new \InvalidArgumentException('non-nullable split_configuration cannot be null'); + } + $this->container['split_configuration'] = $split_configuration; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php b/src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php new file mode 100644 index 000000000..2c733a814 --- /dev/null +++ b/src/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.php @@ -0,0 +1,672 @@ + + */ +class StoreCreationWithMerchantCodeRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoreCreationWithMerchantCodeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\Management\StoreLocation', + 'business_line_ids' => 'string[]', + 'description' => 'string', + 'external_reference_id' => 'string', + 'merchant_id' => 'string', + 'phone_number' => 'string', + 'reference' => 'string', + 'shopper_statement' => 'string', + 'split_configuration' => '\Adyen\Model\Management\StoreSplitConfiguration' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'business_line_ids' => null, + 'description' => null, + 'external_reference_id' => null, + 'merchant_id' => null, + 'phone_number' => null, + 'reference' => null, + 'shopper_statement' => null, + 'split_configuration' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'business_line_ids' => false, + 'description' => false, + 'external_reference_id' => false, + 'merchant_id' => false, + 'phone_number' => false, + 'reference' => false, + 'shopper_statement' => false, + 'split_configuration' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'business_line_ids' => 'businessLineIds', + 'description' => 'description', + 'external_reference_id' => 'externalReferenceId', + 'merchant_id' => 'merchantId', + 'phone_number' => 'phoneNumber', + 'reference' => 'reference', + 'shopper_statement' => 'shopperStatement', + 'split_configuration' => 'splitConfiguration' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'business_line_ids' => 'setBusinessLineIds', + 'description' => 'setDescription', + 'external_reference_id' => 'setExternalReferenceId', + 'merchant_id' => 'setMerchantId', + 'phone_number' => 'setPhoneNumber', + 'reference' => 'setReference', + 'shopper_statement' => 'setShopperStatement', + 'split_configuration' => 'setSplitConfiguration' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'business_line_ids' => 'getBusinessLineIds', + 'description' => 'getDescription', + 'external_reference_id' => 'getExternalReferenceId', + 'merchant_id' => 'getMerchantId', + 'phone_number' => 'getPhoneNumber', + 'reference' => 'getReference', + 'shopper_statement' => 'getShopperStatement', + 'split_configuration' => 'getSplitConfiguration' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('business_line_ids', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('external_reference_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('split_configuration', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['merchant_id'] === null) { + $invalidProperties[] = "'merchant_id' can't be null"; + } + if ($this->container['phone_number'] === null) { + $invalidProperties[] = "'phone_number' can't be null"; + } + if ($this->container['shopper_statement'] === null) { + $invalidProperties[] = "'shopper_statement' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\Management\StoreLocation + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Management\StoreLocation $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets business_line_ids + * + * @return string[]|null + */ + public function getBusinessLineIds() + { + return $this->container['business_line_ids']; + } + + /** + * Sets business_line_ids + * + * @param string[]|null $business_line_ids The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. + * + * @return self + */ + public function setBusinessLineIds($business_line_ids) + { + if (is_null($business_line_ids)) { + throw new \InvalidArgumentException('non-nullable business_line_ids cannot be null'); + } + $this->container['business_line_ids'] = $business_line_ids; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description of the store. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets external_reference_id + * + * @return string|null + */ + public function getExternalReferenceId() + { + return $this->container['external_reference_id']; + } + + /** + * Sets external_reference_id + * + * @param string|null $external_reference_id When using the Zip payment method: The location ID that Zip has assigned to your store. + * + * @return self + */ + public function setExternalReferenceId($external_reference_id) + { + if (is_null($external_reference_id)) { + throw new \InvalidArgumentException('non-nullable external_reference_id cannot be null'); + } + $this->container['external_reference_id'] = $external_reference_id; + + return $this; + } + + /** + * Gets merchant_id + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string $merchant_id The unique identifier of the merchant account that the store belongs to. + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + + /** + * Gets phone_number + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string $phone_number The phone number of the store, including '+' and country code. + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + throw new \InvalidArgumentException('non-nullable reference cannot be null'); + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return string + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param string $shopper_statement The store name to be shown on the shopper's bank or credit card statement and on the shopper receipt. Maximum length: 22 characters; can't be all numbers. + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets split_configuration + * + * @return \Adyen\Model\Management\StoreSplitConfiguration|null + */ + public function getSplitConfiguration() + { + return $this->container['split_configuration']; + } + + /** + * Sets split_configuration + * + * @param \Adyen\Model\Management\StoreSplitConfiguration|null $split_configuration split_configuration + * + * @return self + */ + public function setSplitConfiguration($split_configuration) + { + if (is_null($split_configuration)) { + throw new \InvalidArgumentException('non-nullable split_configuration cannot be null'); + } + $this->container['split_configuration'] = $split_configuration; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/StoreLocation.php b/src/Adyen/Model/Management/StoreLocation.php new file mode 100644 index 000000000..7653cb49c --- /dev/null +++ b/src/Adyen/Model/Management/StoreLocation.php @@ -0,0 +1,592 @@ + + */ +class StoreLocation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoreLocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'line3' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'line1' => null, + 'line2' => null, + 'line3' => null, + 'postal_code' => null, + 'state_or_province' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country' => 'country', + 'line1' => 'line1', + 'line2' => 'line2', + 'line3' => 'line3', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country' => 'setCountry', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'line3' => 'setLine3', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country' => 'getCountry', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'line3' => 'getLine3', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('line3', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country The two-letter country code in [ISO_3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 The street address. + * + * @return self + */ + public function setLine1($line1) + { + if (is_null($line1)) { + throw new \InvalidArgumentException('non-nullable line1 cannot be null'); + } + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 Second address line. + * + * @return self + */ + public function setLine2($line2) + { + if (is_null($line2)) { + throw new \InvalidArgumentException('non-nullable line2 cannot be null'); + } + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets line3 + * + * @return string|null + */ + public function getLine3() + { + return $this->container['line3']; + } + + /** + * Sets line3 + * + * @param string|null $line3 Third address line. + * + * @return self + */ + public function setLine3($line3) + { + if (is_null($line3)) { + throw new \InvalidArgumentException('non-nullable line3 cannot be null'); + } + $this->container['line3'] = $line3; + + 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. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The state or province code as defined in [ISO 3166-2](https://www.iso.org/standard/72483.html). For example, **ON** for Ontario, Canada. Required for the following countries: - Australia - Brazil - Canada - India - Mexico - New Zealand - United States + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/StoreSplitConfiguration.php b/src/Adyen/Model/Management/StoreSplitConfiguration.php new file mode 100644 index 000000000..5ed9f7b5b --- /dev/null +++ b/src/Adyen/Model/Management/StoreSplitConfiguration.php @@ -0,0 +1,419 @@ + + */ +class StoreSplitConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StoreSplitConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balance_account_id' => 'string', + 'split_configuration_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balance_account_id' => null, + 'split_configuration_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balance_account_id' => false, + 'split_configuration_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balance_account_id' => 'balanceAccountId', + 'split_configuration_id' => 'splitConfigurationId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balance_account_id' => 'setBalanceAccountId', + 'split_configuration_id' => 'setSplitConfigurationId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balance_account_id' => 'getBalanceAccountId', + 'split_configuration_id' => 'getSplitConfigurationId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('balance_account_id', $data ?? [], null); + $this->setIfExists('split_configuration_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balance_account_id + * + * @return string|null + */ + public function getBalanceAccountId() + { + return $this->container['balance_account_id']; + } + + /** + * Sets balance_account_id + * + * @param string|null $balance_account_id The [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id) linked to the account holder. + * + * @return self + */ + public function setBalanceAccountId($balance_account_id) + { + if (is_null($balance_account_id)) { + throw new \InvalidArgumentException('non-nullable balance_account_id cannot be null'); + } + $this->container['balance_account_id'] = $balance_account_id; + + return $this; + } + + /** + * Gets split_configuration_id + * + * @return string|null + */ + public function getSplitConfigurationId() + { + return $this->container['split_configuration_id']; + } + + /** + * Sets split_configuration_id + * + * @param string|null $split_configuration_id The UUID of the [split configuration](https://docs.adyen.com/marketplaces-and-platforms/classic/split-configuration-for-stores) from the Customer Area. + * + * @return self + */ + public function setSplitConfigurationId($split_configuration_id) + { + if (is_null($split_configuration_id)) { + throw new \InvalidArgumentException('non-nullable split_configuration_id cannot be null'); + } + $this->container['split_configuration_id'] = $split_configuration_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Surcharge.php b/src/Adyen/Model/Management/Surcharge.php new file mode 100644 index 000000000..3894ad23b --- /dev/null +++ b/src/Adyen/Model/Management/Surcharge.php @@ -0,0 +1,419 @@ + + */ +class Surcharge implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Surcharge'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ask_confirmation' => 'bool', + 'configurations' => '\Adyen\Model\Management\Configuration[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ask_confirmation' => null, + 'configurations' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'ask_confirmation' => false, + 'configurations' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ask_confirmation' => 'askConfirmation', + 'configurations' => 'configurations' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ask_confirmation' => 'setAskConfirmation', + 'configurations' => 'setConfigurations' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ask_confirmation' => 'getAskConfirmation', + 'configurations' => 'getConfigurations' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ask_confirmation', $data ?? [], null); + $this->setIfExists('configurations', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ask_confirmation + * + * @return bool|null + */ + public function getAskConfirmation() + { + return $this->container['ask_confirmation']; + } + + /** + * Sets ask_confirmation + * + * @param bool|null $ask_confirmation Show the surcharge details on the terminal, so the shopper can confirm. + * + * @return self + */ + public function setAskConfirmation($ask_confirmation) + { + if (is_null($ask_confirmation)) { + throw new \InvalidArgumentException('non-nullable ask_confirmation cannot be null'); + } + $this->container['ask_confirmation'] = $ask_confirmation; + + return $this; + } + + /** + * Gets configurations + * + * @return \Adyen\Model\Management\Configuration[]|null + */ + public function getConfigurations() + { + return $this->container['configurations']; + } + + /** + * Sets configurations + * + * @param \Adyen\Model\Management\Configuration[]|null $configurations Surcharge fees or percentages for specific payment methods, funding sources (credit or debit), and currencies. + * + * @return self + */ + public function setConfigurations($configurations) + { + if (is_null($configurations)) { + throw new \InvalidArgumentException('non-nullable configurations cannot be null'); + } + $this->container['configurations'] = $configurations; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/SwishInfo.php b/src/Adyen/Model/Management/SwishInfo.php new file mode 100644 index 000000000..e0bda0886 --- /dev/null +++ b/src/Adyen/Model/Management/SwishInfo.php @@ -0,0 +1,385 @@ + + */ +class SwishInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SwishInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'swish_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'swish_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'swish_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'swish_number' => 'swishNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'swish_number' => 'setSwishNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'swish_number' => 'getSwishNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('swish_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 swish_number + * + * @return string|null + */ + public function getSwishNumber() + { + return $this->container['swish_number']; + } + + /** + * Sets swish_number + * + * @param string|null $swish_number Swish number. Format: 10 digits without spaces. For example, **1231111111**. + * + * @return self + */ + public function setSwishNumber($swish_number) + { + if (is_null($swish_number)) { + throw new \InvalidArgumentException('non-nullable swish_number cannot be null'); + } + $this->container['swish_number'] = $swish_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Terminal.php b/src/Adyen/Model/Management/Terminal.php new file mode 100644 index 000000000..fd2349081 --- /dev/null +++ b/src/Adyen/Model/Management/Terminal.php @@ -0,0 +1,1099 @@ + + */ +class Terminal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Terminal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'assigned' => 'bool', + 'bluetooth_ip' => 'string', + 'bluetooth_mac' => 'string', + 'city' => 'string', + 'company_account' => 'string', + 'country_code' => 'string', + 'device_model' => 'string', + 'ethernet_ip' => 'string', + 'ethernet_mac' => 'string', + 'firmware_version' => 'string', + 'iccid' => 'string', + 'id' => 'string', + 'last_activity_date_time' => '\DateTime', + 'last_transaction_date_time' => '\DateTime', + 'link_negotiation' => 'string', + 'serial_number' => 'string', + 'sim_status' => 'string', + 'status' => 'string', + 'store_status' => 'string', + 'wifi_ip' => 'string', + 'wifi_mac' => 'string', + 'wifi_ssid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'assigned' => null, + 'bluetooth_ip' => null, + 'bluetooth_mac' => null, + 'city' => null, + 'company_account' => null, + 'country_code' => null, + 'device_model' => null, + 'ethernet_ip' => null, + 'ethernet_mac' => null, + 'firmware_version' => null, + 'iccid' => null, + 'id' => null, + 'last_activity_date_time' => 'date-time', + 'last_transaction_date_time' => 'date-time', + 'link_negotiation' => null, + 'serial_number' => null, + 'sim_status' => null, + 'status' => null, + 'store_status' => null, + 'wifi_ip' => null, + 'wifi_mac' => null, + 'wifi_ssid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'assigned' => false, + 'bluetooth_ip' => false, + 'bluetooth_mac' => false, + 'city' => false, + 'company_account' => false, + 'country_code' => false, + 'device_model' => false, + 'ethernet_ip' => false, + 'ethernet_mac' => false, + 'firmware_version' => false, + 'iccid' => false, + 'id' => false, + 'last_activity_date_time' => false, + 'last_transaction_date_time' => false, + 'link_negotiation' => false, + 'serial_number' => false, + 'sim_status' => false, + 'status' => false, + 'store_status' => false, + 'wifi_ip' => false, + 'wifi_mac' => false, + 'wifi_ssid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'assigned' => 'assigned', + 'bluetooth_ip' => 'bluetoothIp', + 'bluetooth_mac' => 'bluetoothMac', + 'city' => 'city', + 'company_account' => 'companyAccount', + 'country_code' => 'countryCode', + 'device_model' => 'deviceModel', + 'ethernet_ip' => 'ethernetIp', + 'ethernet_mac' => 'ethernetMac', + 'firmware_version' => 'firmwareVersion', + 'iccid' => 'iccid', + 'id' => 'id', + 'last_activity_date_time' => 'lastActivityDateTime', + 'last_transaction_date_time' => 'lastTransactionDateTime', + 'link_negotiation' => 'linkNegotiation', + 'serial_number' => 'serialNumber', + 'sim_status' => 'simStatus', + 'status' => 'status', + 'store_status' => 'storeStatus', + 'wifi_ip' => 'wifiIp', + 'wifi_mac' => 'wifiMac', + 'wifi_ssid' => 'wifiSsid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'assigned' => 'setAssigned', + 'bluetooth_ip' => 'setBluetoothIp', + 'bluetooth_mac' => 'setBluetoothMac', + 'city' => 'setCity', + 'company_account' => 'setCompanyAccount', + 'country_code' => 'setCountryCode', + 'device_model' => 'setDeviceModel', + 'ethernet_ip' => 'setEthernetIp', + 'ethernet_mac' => 'setEthernetMac', + 'firmware_version' => 'setFirmwareVersion', + 'iccid' => 'setIccid', + 'id' => 'setId', + 'last_activity_date_time' => 'setLastActivityDateTime', + 'last_transaction_date_time' => 'setLastTransactionDateTime', + 'link_negotiation' => 'setLinkNegotiation', + 'serial_number' => 'setSerialNumber', + 'sim_status' => 'setSimStatus', + 'status' => 'setStatus', + 'store_status' => 'setStoreStatus', + 'wifi_ip' => 'setWifiIp', + 'wifi_mac' => 'setWifiMac', + 'wifi_ssid' => 'setWifiSsid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'assigned' => 'getAssigned', + 'bluetooth_ip' => 'getBluetoothIp', + 'bluetooth_mac' => 'getBluetoothMac', + 'city' => 'getCity', + 'company_account' => 'getCompanyAccount', + 'country_code' => 'getCountryCode', + 'device_model' => 'getDeviceModel', + 'ethernet_ip' => 'getEthernetIp', + 'ethernet_mac' => 'getEthernetMac', + 'firmware_version' => 'getFirmwareVersion', + 'iccid' => 'getIccid', + 'id' => 'getId', + 'last_activity_date_time' => 'getLastActivityDateTime', + 'last_transaction_date_time' => 'getLastTransactionDateTime', + 'link_negotiation' => 'getLinkNegotiation', + 'serial_number' => 'getSerialNumber', + 'sim_status' => 'getSimStatus', + 'status' => 'getStatus', + 'store_status' => 'getStoreStatus', + 'wifi_ip' => 'getWifiIp', + 'wifi_mac' => 'getWifiMac', + 'wifi_ssid' => 'getWifiSsid' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('assigned', $data ?? [], null); + $this->setIfExists('bluetooth_ip', $data ?? [], null); + $this->setIfExists('bluetooth_mac', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('company_account', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('device_model', $data ?? [], null); + $this->setIfExists('ethernet_ip', $data ?? [], null); + $this->setIfExists('ethernet_mac', $data ?? [], null); + $this->setIfExists('firmware_version', $data ?? [], null); + $this->setIfExists('iccid', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('last_activity_date_time', $data ?? [], null); + $this->setIfExists('last_transaction_date_time', $data ?? [], null); + $this->setIfExists('link_negotiation', $data ?? [], null); + $this->setIfExists('serial_number', $data ?? [], null); + $this->setIfExists('sim_status', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('store_status', $data ?? [], null); + $this->setIfExists('wifi_ip', $data ?? [], null); + $this->setIfExists('wifi_mac', $data ?? [], null); + $this->setIfExists('wifi_ssid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets assigned + * + * @return bool|null + */ + public function getAssigned() + { + return $this->container['assigned']; + } + + /** + * Sets assigned + * + * @param bool|null $assigned The [assignment status](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api) of the terminal. If true, the terminal is assigned. If false, the terminal is in inventory and can't be boarded. + * + * @return self + */ + public function setAssigned($assigned) + { + if (is_null($assigned)) { + throw new \InvalidArgumentException('non-nullable assigned cannot be null'); + } + $this->container['assigned'] = $assigned; + + return $this; + } + + /** + * Gets bluetooth_ip + * + * @return string|null + */ + public function getBluetoothIp() + { + return $this->container['bluetooth_ip']; + } + + /** + * Sets bluetooth_ip + * + * @param string|null $bluetooth_ip The Bluetooth IP address of the terminal. + * + * @return self + */ + public function setBluetoothIp($bluetooth_ip) + { + if (is_null($bluetooth_ip)) { + throw new \InvalidArgumentException('non-nullable bluetooth_ip cannot be null'); + } + $this->container['bluetooth_ip'] = $bluetooth_ip; + + return $this; + } + + /** + * Gets bluetooth_mac + * + * @return string|null + */ + public function getBluetoothMac() + { + return $this->container['bluetooth_mac']; + } + + /** + * Sets bluetooth_mac + * + * @param string|null $bluetooth_mac The Bluetooth MAC address of the terminal. + * + * @return self + */ + public function setBluetoothMac($bluetooth_mac) + { + if (is_null($bluetooth_mac)) { + throw new \InvalidArgumentException('non-nullable bluetooth_mac cannot be null'); + } + $this->container['bluetooth_mac'] = $bluetooth_mac; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city where the terminal is located. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets company_account + * + * @return string|null + */ + public function getCompanyAccount() + { + return $this->container['company_account']; + } + + /** + * Sets company_account + * + * @param string|null $company_account The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. + * + * @return self + */ + public function setCompanyAccount($company_account) + { + if (is_null($company_account)) { + throw new \InvalidArgumentException('non-nullable company_account cannot be null'); + } + $this->container['company_account'] = $company_account; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The country code of the country where the terminal is located. + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets device_model + * + * @return string|null + */ + public function getDeviceModel() + { + return $this->container['device_model']; + } + + /** + * Sets device_model + * + * @param string|null $device_model The model name of the terminal. + * + * @return self + */ + public function setDeviceModel($device_model) + { + if (is_null($device_model)) { + throw new \InvalidArgumentException('non-nullable device_model cannot be null'); + } + $this->container['device_model'] = $device_model; + + return $this; + } + + /** + * Gets ethernet_ip + * + * @return string|null + */ + public function getEthernetIp() + { + return $this->container['ethernet_ip']; + } + + /** + * Sets ethernet_ip + * + * @param string|null $ethernet_ip The ethernet IP address of the terminal. + * + * @return self + */ + public function setEthernetIp($ethernet_ip) + { + if (is_null($ethernet_ip)) { + throw new \InvalidArgumentException('non-nullable ethernet_ip cannot be null'); + } + $this->container['ethernet_ip'] = $ethernet_ip; + + return $this; + } + + /** + * Gets ethernet_mac + * + * @return string|null + */ + public function getEthernetMac() + { + return $this->container['ethernet_mac']; + } + + /** + * Sets ethernet_mac + * + * @param string|null $ethernet_mac The ethernet MAC address of the terminal. + * + * @return self + */ + public function setEthernetMac($ethernet_mac) + { + if (is_null($ethernet_mac)) { + throw new \InvalidArgumentException('non-nullable ethernet_mac cannot be null'); + } + $this->container['ethernet_mac'] = $ethernet_mac; + + return $this; + } + + /** + * Gets firmware_version + * + * @return string|null + */ + public function getFirmwareVersion() + { + return $this->container['firmware_version']; + } + + /** + * Sets firmware_version + * + * @param string|null $firmware_version The software release currently in use on the terminal. + * + * @return self + */ + public function setFirmwareVersion($firmware_version) + { + if (is_null($firmware_version)) { + throw new \InvalidArgumentException('non-nullable firmware_version cannot be null'); + } + $this->container['firmware_version'] = $firmware_version; + + return $this; + } + + /** + * Gets iccid + * + * @return string|null + */ + public function getIccid() + { + return $this->container['iccid']; + } + + /** + * Sets iccid + * + * @param string|null $iccid The integrated circuit card identifier (ICCID) of the SIM card in the terminal. + * + * @return self + */ + public function setIccid($iccid) + { + if (is_null($iccid)) { + throw new \InvalidArgumentException('non-nullable iccid cannot be null'); + } + $this->container['iccid'] = $iccid; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the terminal. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets last_activity_date_time + * + * @return \DateTime|null + */ + public function getLastActivityDateTime() + { + return $this->container['last_activity_date_time']; + } + + /** + * Sets last_activity_date_time + * + * @param \DateTime|null $last_activity_date_time Date and time of the last activity on the terminal. Not included when the last activity was more than 14 days ago. + * + * @return self + */ + public function setLastActivityDateTime($last_activity_date_time) + { + if (is_null($last_activity_date_time)) { + throw new \InvalidArgumentException('non-nullable last_activity_date_time cannot be null'); + } + $this->container['last_activity_date_time'] = $last_activity_date_time; + + return $this; + } + + /** + * Gets last_transaction_date_time + * + * @return \DateTime|null + */ + public function getLastTransactionDateTime() + { + return $this->container['last_transaction_date_time']; + } + + /** + * Sets last_transaction_date_time + * + * @param \DateTime|null $last_transaction_date_time Date and time of the last transaction on the terminal. Not included when the last transaction was more than 14 days ago. + * + * @return self + */ + public function setLastTransactionDateTime($last_transaction_date_time) + { + if (is_null($last_transaction_date_time)) { + throw new \InvalidArgumentException('non-nullable last_transaction_date_time cannot be null'); + } + $this->container['last_transaction_date_time'] = $last_transaction_date_time; + + return $this; + } + + /** + * Gets link_negotiation + * + * @return string|null + */ + public function getLinkNegotiation() + { + return $this->container['link_negotiation']; + } + + /** + * Sets link_negotiation + * + * @param string|null $link_negotiation The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex + * + * @return self + */ + public function setLinkNegotiation($link_negotiation) + { + if (is_null($link_negotiation)) { + throw new \InvalidArgumentException('non-nullable link_negotiation cannot be null'); + } + $this->container['link_negotiation'] = $link_negotiation; + + return $this; + } + + /** + * Gets serial_number + * + * @return string|null + */ + public function getSerialNumber() + { + return $this->container['serial_number']; + } + + /** + * Sets serial_number + * + * @param string|null $serial_number The serial number of the terminal. + * + * @return self + */ + public function setSerialNumber($serial_number) + { + if (is_null($serial_number)) { + throw new \InvalidArgumentException('non-nullable serial_number cannot be null'); + } + $this->container['serial_number'] = $serial_number; + + return $this; + } + + /** + * Gets sim_status + * + * @return string|null + */ + public function getSimStatus() + { + return $this->container['sim_status']; + } + + /** + * Sets sim_status + * + * @param string|null $sim_status On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. + * + * @return self + */ + public function setSimStatus($sim_status) + { + if (is_null($sim_status)) { + throw new \InvalidArgumentException('non-nullable sim_status cannot be null'); + } + $this->container['sim_status'] = $sim_status; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Indicates when the terminal was last online, whether the terminal is being reassigned, or whether the terminal is turned off. If the terminal was last online more that a week ago, it is also shown as turned off. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets store_status + * + * @return string|null + */ + public function getStoreStatus() + { + return $this->container['store_status']; + } + + /** + * Sets store_status + * + * @param string|null $store_status The status of the store that the terminal is assigned to. + * + * @return self + */ + public function setStoreStatus($store_status) + { + if (is_null($store_status)) { + throw new \InvalidArgumentException('non-nullable store_status cannot be null'); + } + $this->container['store_status'] = $store_status; + + return $this; + } + + /** + * Gets wifi_ip + * + * @return string|null + */ + public function getWifiIp() + { + return $this->container['wifi_ip']; + } + + /** + * Sets wifi_ip + * + * @param string|null $wifi_ip The terminal's IP address in your Wi-Fi network. + * + * @return self + */ + public function setWifiIp($wifi_ip) + { + if (is_null($wifi_ip)) { + throw new \InvalidArgumentException('non-nullable wifi_ip cannot be null'); + } + $this->container['wifi_ip'] = $wifi_ip; + + return $this; + } + + /** + * Gets wifi_mac + * + * @return string|null + */ + public function getWifiMac() + { + return $this->container['wifi_mac']; + } + + /** + * Sets wifi_mac + * + * @param string|null $wifi_mac The terminal's MAC address in your Wi-Fi network. + * + * @return self + */ + public function setWifiMac($wifi_mac) + { + if (is_null($wifi_mac)) { + throw new \InvalidArgumentException('non-nullable wifi_mac cannot be null'); + } + $this->container['wifi_mac'] = $wifi_mac; + + return $this; + } + + /** + * Gets wifi_ssid + * + * @return string|null + */ + public function getWifiSsid() + { + return $this->container['wifi_ssid']; + } + + /** + * Sets wifi_ssid + * + * @param string|null $wifi_ssid The SSID of the Wi-Fi network that your terminal is connected to. + * + * @return self + */ + public function setWifiSsid($wifi_ssid) + { + if (is_null($wifi_ssid)) { + throw new \InvalidArgumentException('non-nullable wifi_ssid cannot be null'); + } + $this->container['wifi_ssid'] = $wifi_ssid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalActionScheduleDetail.php b/src/Adyen/Model/Management/TerminalActionScheduleDetail.php new file mode 100644 index 000000000..be8cd0061 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalActionScheduleDetail.php @@ -0,0 +1,419 @@ + + */ +class TerminalActionScheduleDetail implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalActionScheduleDetail'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'terminal_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'terminal_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'terminal_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'terminal_id' => 'terminalId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'terminal_id' => 'setTerminalId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'terminal_id' => 'getTerminalId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('terminal_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the action on the specified terminal. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets terminal_id + * + * @return string|null + */ + public function getTerminalId() + { + return $this->container['terminal_id']; + } + + /** + * Sets terminal_id + * + * @param string|null $terminal_id The unique ID of the terminal that the action applies to. + * + * @return self + */ + public function setTerminalId($terminal_id) + { + if (is_null($terminal_id)) { + throw new \InvalidArgumentException('non-nullable terminal_id cannot be null'); + } + $this->container['terminal_id'] = $terminal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalModelsResponse.php b/src/Adyen/Model/Management/TerminalModelsResponse.php new file mode 100644 index 000000000..f26d39152 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalModelsResponse.php @@ -0,0 +1,385 @@ + + */ +class TerminalModelsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalModelsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\IdName[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\IdName[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\IdName[]|null $data The terminal models that the API credential has access to. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalOrder.php b/src/Adyen/Model/Management/TerminalOrder.php new file mode 100644 index 000000000..f6fab6e98 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalOrder.php @@ -0,0 +1,623 @@ + + */ +class TerminalOrder implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalOrder'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_entity' => '\Adyen\Model\Management\BillingEntity', + 'customer_order_reference' => 'string', + 'id' => 'string', + 'items' => '\Adyen\Model\Management\OrderItem[]', + 'order_date' => 'string', + 'shipping_location' => '\Adyen\Model\Management\ShippingLocation', + 'status' => 'string', + 'tracking_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_entity' => null, + 'customer_order_reference' => null, + 'id' => null, + 'items' => null, + 'order_date' => null, + 'shipping_location' => null, + 'status' => null, + 'tracking_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_entity' => false, + 'customer_order_reference' => false, + 'id' => false, + 'items' => false, + 'order_date' => false, + 'shipping_location' => false, + 'status' => false, + 'tracking_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_entity' => 'billingEntity', + 'customer_order_reference' => 'customerOrderReference', + 'id' => 'id', + 'items' => 'items', + 'order_date' => 'orderDate', + 'shipping_location' => 'shippingLocation', + 'status' => 'status', + 'tracking_url' => 'trackingUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_entity' => 'setBillingEntity', + 'customer_order_reference' => 'setCustomerOrderReference', + 'id' => 'setId', + 'items' => 'setItems', + 'order_date' => 'setOrderDate', + 'shipping_location' => 'setShippingLocation', + 'status' => 'setStatus', + 'tracking_url' => 'setTrackingUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_entity' => 'getBillingEntity', + 'customer_order_reference' => 'getCustomerOrderReference', + 'id' => 'getId', + 'items' => 'getItems', + 'order_date' => 'getOrderDate', + 'shipping_location' => 'getShippingLocation', + 'status' => 'getStatus', + 'tracking_url' => 'getTrackingUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('billing_entity', $data ?? [], null); + $this->setIfExists('customer_order_reference', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('order_date', $data ?? [], null); + $this->setIfExists('shipping_location', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('tracking_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 billing_entity + * + * @return \Adyen\Model\Management\BillingEntity|null + */ + public function getBillingEntity() + { + return $this->container['billing_entity']; + } + + /** + * Sets billing_entity + * + * @param \Adyen\Model\Management\BillingEntity|null $billing_entity billing_entity + * + * @return self + */ + public function setBillingEntity($billing_entity) + { + if (is_null($billing_entity)) { + throw new \InvalidArgumentException('non-nullable billing_entity cannot be null'); + } + $this->container['billing_entity'] = $billing_entity; + + return $this; + } + + /** + * Gets customer_order_reference + * + * @return string|null + */ + public function getCustomerOrderReference() + { + return $this->container['customer_order_reference']; + } + + /** + * Sets customer_order_reference + * + * @param string|null $customer_order_reference The merchant-defined purchase order number. This will be printed on the packing list. + * + * @return self + */ + public function setCustomerOrderReference($customer_order_reference) + { + if (is_null($customer_order_reference)) { + throw new \InvalidArgumentException('non-nullable customer_order_reference cannot be null'); + } + $this->container['customer_order_reference'] = $customer_order_reference; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the order. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets items + * + * @return \Adyen\Model\Management\OrderItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Adyen\Model\Management\OrderItem[]|null $items The products included in the order. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets order_date + * + * @return string|null + */ + public function getOrderDate() + { + return $this->container['order_date']; + } + + /** + * Sets order_date + * + * @param string|null $order_date The date and time that the order was placed, in UTC ISO 8601 format. For example, \"2011-12-03T10:15:30Z\". + * + * @return self + */ + public function setOrderDate($order_date) + { + if (is_null($order_date)) { + throw new \InvalidArgumentException('non-nullable order_date cannot be null'); + } + $this->container['order_date'] = $order_date; + + return $this; + } + + /** + * Gets shipping_location + * + * @return \Adyen\Model\Management\ShippingLocation|null + */ + public function getShippingLocation() + { + return $this->container['shipping_location']; + } + + /** + * Sets shipping_location + * + * @param \Adyen\Model\Management\ShippingLocation|null $shipping_location shipping_location + * + * @return self + */ + public function setShippingLocation($shipping_location) + { + if (is_null($shipping_location)) { + throw new \InvalidArgumentException('non-nullable shipping_location cannot be null'); + } + $this->container['shipping_location'] = $shipping_location; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The processing status of the order. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets tracking_url + * + * @return string|null + */ + public function getTrackingUrl() + { + return $this->container['tracking_url']; + } + + /** + * Sets tracking_url + * + * @param string|null $tracking_url The URL, provided by the carrier company, where the shipment can be tracked. + * + * @return self + */ + public function setTrackingUrl($tracking_url) + { + if (is_null($tracking_url)) { + throw new \InvalidArgumentException('non-nullable tracking_url cannot be null'); + } + $this->container['tracking_url'] = $tracking_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalOrderRequest.php b/src/Adyen/Model/Management/TerminalOrderRequest.php new file mode 100644 index 000000000..ff53c2863 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalOrderRequest.php @@ -0,0 +1,521 @@ + + */ +class TerminalOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalOrderRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'billing_entity_id' => 'string', + 'customer_order_reference' => 'string', + 'items' => '\Adyen\Model\Management\OrderItem[]', + 'shipping_location_id' => 'string', + 'tax_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'billing_entity_id' => null, + 'customer_order_reference' => null, + 'items' => null, + 'shipping_location_id' => null, + 'tax_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'billing_entity_id' => false, + 'customer_order_reference' => false, + 'items' => false, + 'shipping_location_id' => false, + 'tax_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'billing_entity_id' => 'billingEntityId', + 'customer_order_reference' => 'customerOrderReference', + 'items' => 'items', + 'shipping_location_id' => 'shippingLocationId', + 'tax_id' => 'taxId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'billing_entity_id' => 'setBillingEntityId', + 'customer_order_reference' => 'setCustomerOrderReference', + 'items' => 'setItems', + 'shipping_location_id' => 'setShippingLocationId', + 'tax_id' => 'setTaxId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'billing_entity_id' => 'getBillingEntityId', + 'customer_order_reference' => 'getCustomerOrderReference', + 'items' => 'getItems', + 'shipping_location_id' => 'getShippingLocationId', + '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->setIfExists('billing_entity_id', $data ?? [], null); + $this->setIfExists('customer_order_reference', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('shipping_location_id', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets billing_entity_id + * + * @return string|null + */ + public function getBillingEntityId() + { + return $this->container['billing_entity_id']; + } + + /** + * Sets billing_entity_id + * + * @param string|null $billing_entity_id The identification of the billing entity to use for the order. + * + * @return self + */ + public function setBillingEntityId($billing_entity_id) + { + if (is_null($billing_entity_id)) { + throw new \InvalidArgumentException('non-nullable billing_entity_id cannot be null'); + } + $this->container['billing_entity_id'] = $billing_entity_id; + + return $this; + } + + /** + * Gets customer_order_reference + * + * @return string|null + */ + public function getCustomerOrderReference() + { + return $this->container['customer_order_reference']; + } + + /** + * Sets customer_order_reference + * + * @param string|null $customer_order_reference The merchant-defined purchase order reference. + * + * @return self + */ + public function setCustomerOrderReference($customer_order_reference) + { + if (is_null($customer_order_reference)) { + throw new \InvalidArgumentException('non-nullable customer_order_reference cannot be null'); + } + $this->container['customer_order_reference'] = $customer_order_reference; + + return $this; + } + + /** + * Gets items + * + * @return \Adyen\Model\Management\OrderItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Adyen\Model\Management\OrderItem[]|null $items The products included in the order. + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets shipping_location_id + * + * @return string|null + */ + public function getShippingLocationId() + { + return $this->container['shipping_location_id']; + } + + /** + * Sets shipping_location_id + * + * @param string|null $shipping_location_id The identification of the shipping location to use for the order. + * + * @return self + */ + public function setShippingLocationId($shipping_location_id) + { + if (is_null($shipping_location_id)) { + throw new \InvalidArgumentException('non-nullable shipping_location_id cannot be null'); + } + $this->container['shipping_location_id'] = $shipping_location_id; + + return $this; + } + + /** + * Gets tax_id + * + * @return string|null + */ + public function getTaxId() + { + return $this->container['tax_id']; + } + + /** + * Sets tax_id + * + * @param string|null $tax_id The tax number of the billing entity. + * + * @return self + */ + public function setTaxId($tax_id) + { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } + $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 + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalOrdersResponse.php b/src/Adyen/Model/Management/TerminalOrdersResponse.php new file mode 100644 index 000000000..69c6b6ec6 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalOrdersResponse.php @@ -0,0 +1,385 @@ + + */ +class TerminalOrdersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalOrdersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\TerminalOrder[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\TerminalOrder[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\TerminalOrder[]|null $data List of orders for payment terminal packages and parts. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalProduct.php b/src/Adyen/Model/Management/TerminalProduct.php new file mode 100644 index 000000000..601295926 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalProduct.php @@ -0,0 +1,521 @@ + + */ +class TerminalProduct implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'id' => 'string', + 'items_included' => 'string[]', + 'name' => 'string', + 'price' => '\Adyen\Model\Management\TerminalProductPrice' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'id' => null, + 'items_included' => null, + 'name' => null, + 'price' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'id' => false, + 'items_included' => false, + 'name' => false, + 'price' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'id' => 'id', + 'items_included' => 'itemsIncluded', + 'name' => 'name', + 'price' => 'price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'id' => 'setId', + 'items_included' => 'setItemsIncluded', + 'name' => 'setName', + 'price' => 'setPrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'id' => 'getId', + 'items_included' => 'getItemsIncluded', + 'name' => 'getName', + 'price' => 'getPrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('items_included', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Information about items included and integration options. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the product. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets items_included + * + * @return string[]|null + */ + public function getItemsIncluded() + { + return $this->container['items_included']; + } + + /** + * Sets items_included + * + * @param string[]|null $items_included A list of parts included in the terminal package. + * + * @return self + */ + public function setItemsIncluded($items_included) + { + if (is_null($items_included)) { + throw new \InvalidArgumentException('non-nullable items_included cannot be null'); + } + $this->container['items_included'] = $items_included; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The descriptive name of the product. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets price + * + * @return \Adyen\Model\Management\TerminalProductPrice|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param \Adyen\Model\Management\TerminalProductPrice|null $price price + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalProductPrice.php b/src/Adyen/Model/Management/TerminalProductPrice.php new file mode 100644 index 000000000..4fd3aaac3 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalProductPrice.php @@ -0,0 +1,419 @@ + + */ +class TerminalProductPrice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalProductPrice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return object|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param object|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalProductsResponse.php b/src/Adyen/Model/Management/TerminalProductsResponse.php new file mode 100644 index 000000000..883bb2ee5 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalProductsResponse.php @@ -0,0 +1,385 @@ + + */ +class TerminalProductsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalProductsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\TerminalProduct[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\TerminalProduct[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\TerminalProduct[]|null $data Terminal products that can be ordered. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TerminalSettings.php b/src/Adyen/Model/Management/TerminalSettings.php new file mode 100644 index 000000000..fd2ee24d1 --- /dev/null +++ b/src/Adyen/Model/Management/TerminalSettings.php @@ -0,0 +1,929 @@ + + */ +class TerminalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TerminalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cardholder_receipt' => '\Adyen\Model\Management\CardholderReceipt', + 'connectivity' => '\Adyen\Model\Management\Connectivity', + 'gratuities' => '\Adyen\Model\Management\Gratuity[]', + 'hardware' => '\Adyen\Model\Management\Hardware', + 'nexo' => '\Adyen\Model\Management\Nexo', + 'offline_processing' => '\Adyen\Model\Management\OfflineProcessing', + 'opi' => '\Adyen\Model\Management\Opi', + 'passcodes' => '\Adyen\Model\Management\Passcodes', + 'pay_at_table' => '\Adyen\Model\Management\PayAtTable', + 'payment' => '\Adyen\Model\Management\Payment', + 'receipt_options' => '\Adyen\Model\Management\ReceiptOptions', + 'receipt_printing' => '\Adyen\Model\Management\ReceiptPrinting', + 'signature' => '\Adyen\Model\Management\Signature', + 'standalone' => '\Adyen\Model\Management\Standalone', + 'surcharge' => '\Adyen\Model\Management\Surcharge', + 'timeouts' => '\Adyen\Model\Management\Timeouts', + 'wifi_profiles' => '\Adyen\Model\Management\WifiProfiles' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cardholder_receipt' => null, + 'connectivity' => null, + 'gratuities' => null, + 'hardware' => null, + 'nexo' => null, + 'offline_processing' => null, + 'opi' => null, + 'passcodes' => null, + 'pay_at_table' => null, + 'payment' => null, + 'receipt_options' => null, + 'receipt_printing' => null, + 'signature' => null, + 'standalone' => null, + 'surcharge' => null, + 'timeouts' => null, + 'wifi_profiles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cardholder_receipt' => false, + 'connectivity' => false, + 'gratuities' => false, + 'hardware' => false, + 'nexo' => false, + 'offline_processing' => false, + 'opi' => false, + 'passcodes' => false, + 'pay_at_table' => false, + 'payment' => false, + 'receipt_options' => false, + 'receipt_printing' => false, + 'signature' => false, + 'standalone' => false, + 'surcharge' => false, + 'timeouts' => false, + 'wifi_profiles' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cardholder_receipt' => 'cardholderReceipt', + 'connectivity' => 'connectivity', + 'gratuities' => 'gratuities', + 'hardware' => 'hardware', + 'nexo' => 'nexo', + 'offline_processing' => 'offlineProcessing', + 'opi' => 'opi', + 'passcodes' => 'passcodes', + 'pay_at_table' => 'payAtTable', + 'payment' => 'payment', + 'receipt_options' => 'receiptOptions', + 'receipt_printing' => 'receiptPrinting', + 'signature' => 'signature', + 'standalone' => 'standalone', + 'surcharge' => 'surcharge', + 'timeouts' => 'timeouts', + 'wifi_profiles' => 'wifiProfiles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cardholder_receipt' => 'setCardholderReceipt', + 'connectivity' => 'setConnectivity', + 'gratuities' => 'setGratuities', + 'hardware' => 'setHardware', + 'nexo' => 'setNexo', + 'offline_processing' => 'setOfflineProcessing', + 'opi' => 'setOpi', + 'passcodes' => 'setPasscodes', + 'pay_at_table' => 'setPayAtTable', + 'payment' => 'setPayment', + 'receipt_options' => 'setReceiptOptions', + 'receipt_printing' => 'setReceiptPrinting', + 'signature' => 'setSignature', + 'standalone' => 'setStandalone', + 'surcharge' => 'setSurcharge', + 'timeouts' => 'setTimeouts', + 'wifi_profiles' => 'setWifiProfiles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cardholder_receipt' => 'getCardholderReceipt', + 'connectivity' => 'getConnectivity', + 'gratuities' => 'getGratuities', + 'hardware' => 'getHardware', + 'nexo' => 'getNexo', + 'offline_processing' => 'getOfflineProcessing', + 'opi' => 'getOpi', + 'passcodes' => 'getPasscodes', + 'pay_at_table' => 'getPayAtTable', + 'payment' => 'getPayment', + 'receipt_options' => 'getReceiptOptions', + 'receipt_printing' => 'getReceiptPrinting', + 'signature' => 'getSignature', + 'standalone' => 'getStandalone', + 'surcharge' => 'getSurcharge', + 'timeouts' => 'getTimeouts', + 'wifi_profiles' => 'getWifiProfiles' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cardholder_receipt', $data ?? [], null); + $this->setIfExists('connectivity', $data ?? [], null); + $this->setIfExists('gratuities', $data ?? [], null); + $this->setIfExists('hardware', $data ?? [], null); + $this->setIfExists('nexo', $data ?? [], null); + $this->setIfExists('offline_processing', $data ?? [], null); + $this->setIfExists('opi', $data ?? [], null); + $this->setIfExists('passcodes', $data ?? [], null); + $this->setIfExists('pay_at_table', $data ?? [], null); + $this->setIfExists('payment', $data ?? [], null); + $this->setIfExists('receipt_options', $data ?? [], null); + $this->setIfExists('receipt_printing', $data ?? [], null); + $this->setIfExists('signature', $data ?? [], null); + $this->setIfExists('standalone', $data ?? [], null); + $this->setIfExists('surcharge', $data ?? [], null); + $this->setIfExists('timeouts', $data ?? [], null); + $this->setIfExists('wifi_profiles', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cardholder_receipt + * + * @return \Adyen\Model\Management\CardholderReceipt|null + */ + public function getCardholderReceipt() + { + return $this->container['cardholder_receipt']; + } + + /** + * Sets cardholder_receipt + * + * @param \Adyen\Model\Management\CardholderReceipt|null $cardholder_receipt cardholder_receipt + * + * @return self + */ + public function setCardholderReceipt($cardholder_receipt) + { + if (is_null($cardholder_receipt)) { + throw new \InvalidArgumentException('non-nullable cardholder_receipt cannot be null'); + } + $this->container['cardholder_receipt'] = $cardholder_receipt; + + return $this; + } + + /** + * Gets connectivity + * + * @return \Adyen\Model\Management\Connectivity|null + */ + public function getConnectivity() + { + return $this->container['connectivity']; + } + + /** + * Sets connectivity + * + * @param \Adyen\Model\Management\Connectivity|null $connectivity connectivity + * + * @return self + */ + public function setConnectivity($connectivity) + { + if (is_null($connectivity)) { + throw new \InvalidArgumentException('non-nullable connectivity cannot be null'); + } + $this->container['connectivity'] = $connectivity; + + return $this; + } + + /** + * Gets gratuities + * + * @return \Adyen\Model\Management\Gratuity[]|null + */ + public function getGratuities() + { + return $this->container['gratuities']; + } + + /** + * Sets gratuities + * + * @param \Adyen\Model\Management\Gratuity[]|null $gratuities Settings for tipping with or without predefined options to choose from. The maximum number of predefined options is four, or three plus the option to enter a custom tip. + * + * @return self + */ + public function setGratuities($gratuities) + { + if (is_null($gratuities)) { + throw new \InvalidArgumentException('non-nullable gratuities cannot be null'); + } + $this->container['gratuities'] = $gratuities; + + return $this; + } + + /** + * Gets hardware + * + * @return \Adyen\Model\Management\Hardware|null + */ + public function getHardware() + { + return $this->container['hardware']; + } + + /** + * Sets hardware + * + * @param \Adyen\Model\Management\Hardware|null $hardware hardware + * + * @return self + */ + public function setHardware($hardware) + { + if (is_null($hardware)) { + throw new \InvalidArgumentException('non-nullable hardware cannot be null'); + } + $this->container['hardware'] = $hardware; + + return $this; + } + + /** + * Gets nexo + * + * @return \Adyen\Model\Management\Nexo|null + */ + public function getNexo() + { + return $this->container['nexo']; + } + + /** + * Sets nexo + * + * @param \Adyen\Model\Management\Nexo|null $nexo nexo + * + * @return self + */ + public function setNexo($nexo) + { + if (is_null($nexo)) { + throw new \InvalidArgumentException('non-nullable nexo cannot be null'); + } + $this->container['nexo'] = $nexo; + + return $this; + } + + /** + * Gets offline_processing + * + * @return \Adyen\Model\Management\OfflineProcessing|null + */ + public function getOfflineProcessing() + { + return $this->container['offline_processing']; + } + + /** + * Sets offline_processing + * + * @param \Adyen\Model\Management\OfflineProcessing|null $offline_processing offline_processing + * + * @return self + */ + public function setOfflineProcessing($offline_processing) + { + if (is_null($offline_processing)) { + throw new \InvalidArgumentException('non-nullable offline_processing cannot be null'); + } + $this->container['offline_processing'] = $offline_processing; + + return $this; + } + + /** + * Gets opi + * + * @return \Adyen\Model\Management\Opi|null + */ + public function getOpi() + { + return $this->container['opi']; + } + + /** + * Sets opi + * + * @param \Adyen\Model\Management\Opi|null $opi opi + * + * @return self + */ + public function setOpi($opi) + { + if (is_null($opi)) { + throw new \InvalidArgumentException('non-nullable opi cannot be null'); + } + $this->container['opi'] = $opi; + + return $this; + } + + /** + * Gets passcodes + * + * @return \Adyen\Model\Management\Passcodes|null + */ + public function getPasscodes() + { + return $this->container['passcodes']; + } + + /** + * Sets passcodes + * + * @param \Adyen\Model\Management\Passcodes|null $passcodes passcodes + * + * @return self + */ + public function setPasscodes($passcodes) + { + if (is_null($passcodes)) { + throw new \InvalidArgumentException('non-nullable passcodes cannot be null'); + } + $this->container['passcodes'] = $passcodes; + + return $this; + } + + /** + * Gets pay_at_table + * + * @return \Adyen\Model\Management\PayAtTable|null + */ + public function getPayAtTable() + { + return $this->container['pay_at_table']; + } + + /** + * Sets pay_at_table + * + * @param \Adyen\Model\Management\PayAtTable|null $pay_at_table pay_at_table + * + * @return self + */ + public function setPayAtTable($pay_at_table) + { + if (is_null($pay_at_table)) { + throw new \InvalidArgumentException('non-nullable pay_at_table cannot be null'); + } + $this->container['pay_at_table'] = $pay_at_table; + + return $this; + } + + /** + * Gets payment + * + * @return \Adyen\Model\Management\Payment|null + */ + public function getPayment() + { + return $this->container['payment']; + } + + /** + * Sets payment + * + * @param \Adyen\Model\Management\Payment|null $payment payment + * + * @return self + */ + public function setPayment($payment) + { + if (is_null($payment)) { + throw new \InvalidArgumentException('non-nullable payment cannot be null'); + } + $this->container['payment'] = $payment; + + return $this; + } + + /** + * Gets receipt_options + * + * @return \Adyen\Model\Management\ReceiptOptions|null + */ + public function getReceiptOptions() + { + return $this->container['receipt_options']; + } + + /** + * Sets receipt_options + * + * @param \Adyen\Model\Management\ReceiptOptions|null $receipt_options receipt_options + * + * @return self + */ + public function setReceiptOptions($receipt_options) + { + if (is_null($receipt_options)) { + throw new \InvalidArgumentException('non-nullable receipt_options cannot be null'); + } + $this->container['receipt_options'] = $receipt_options; + + return $this; + } + + /** + * Gets receipt_printing + * + * @return \Adyen\Model\Management\ReceiptPrinting|null + */ + public function getReceiptPrinting() + { + return $this->container['receipt_printing']; + } + + /** + * Sets receipt_printing + * + * @param \Adyen\Model\Management\ReceiptPrinting|null $receipt_printing receipt_printing + * + * @return self + */ + public function setReceiptPrinting($receipt_printing) + { + if (is_null($receipt_printing)) { + throw new \InvalidArgumentException('non-nullable receipt_printing cannot be null'); + } + $this->container['receipt_printing'] = $receipt_printing; + + return $this; + } + + /** + * Gets signature + * + * @return \Adyen\Model\Management\Signature|null + */ + public function getSignature() + { + return $this->container['signature']; + } + + /** + * Sets signature + * + * @param \Adyen\Model\Management\Signature|null $signature signature + * + * @return self + */ + public function setSignature($signature) + { + if (is_null($signature)) { + throw new \InvalidArgumentException('non-nullable signature cannot be null'); + } + $this->container['signature'] = $signature; + + return $this; + } + + /** + * Gets standalone + * + * @return \Adyen\Model\Management\Standalone|null + */ + public function getStandalone() + { + return $this->container['standalone']; + } + + /** + * Sets standalone + * + * @param \Adyen\Model\Management\Standalone|null $standalone standalone + * + * @return self + */ + public function setStandalone($standalone) + { + if (is_null($standalone)) { + throw new \InvalidArgumentException('non-nullable standalone cannot be null'); + } + $this->container['standalone'] = $standalone; + + return $this; + } + + /** + * Gets surcharge + * + * @return \Adyen\Model\Management\Surcharge|null + */ + public function getSurcharge() + { + return $this->container['surcharge']; + } + + /** + * Sets surcharge + * + * @param \Adyen\Model\Management\Surcharge|null $surcharge surcharge + * + * @return self + */ + public function setSurcharge($surcharge) + { + if (is_null($surcharge)) { + throw new \InvalidArgumentException('non-nullable surcharge cannot be null'); + } + $this->container['surcharge'] = $surcharge; + + return $this; + } + + /** + * Gets timeouts + * + * @return \Adyen\Model\Management\Timeouts|null + */ + public function getTimeouts() + { + return $this->container['timeouts']; + } + + /** + * Sets timeouts + * + * @param \Adyen\Model\Management\Timeouts|null $timeouts timeouts + * + * @return self + */ + public function setTimeouts($timeouts) + { + if (is_null($timeouts)) { + throw new \InvalidArgumentException('non-nullable timeouts cannot be null'); + } + $this->container['timeouts'] = $timeouts; + + return $this; + } + + /** + * Gets wifi_profiles + * + * @return \Adyen\Model\Management\WifiProfiles|null + */ + public function getWifiProfiles() + { + return $this->container['wifi_profiles']; + } + + /** + * Sets wifi_profiles + * + * @param \Adyen\Model\Management\WifiProfiles|null $wifi_profiles wifi_profiles + * + * @return self + */ + public function setWifiProfiles($wifi_profiles) + { + if (is_null($wifi_profiles)) { + throw new \InvalidArgumentException('non-nullable wifi_profiles cannot be null'); + } + $this->container['wifi_profiles'] = $wifi_profiles; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TestCompanyWebhookRequest.php b/src/Adyen/Model/Management/TestCompanyWebhookRequest.php new file mode 100644 index 000000000..af9355b08 --- /dev/null +++ b/src/Adyen/Model/Management/TestCompanyWebhookRequest.php @@ -0,0 +1,453 @@ + + */ +class TestCompanyWebhookRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TestCompanyWebhookRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_ids' => 'string[]', + 'notification' => '\Adyen\Model\Management\CustomNotification', + 'types' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_ids' => null, + 'notification' => null, + 'types' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_ids' => false, + 'notification' => false, + 'types' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_ids' => 'merchantIds', + 'notification' => 'notification', + 'types' => 'types' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_ids' => 'setMerchantIds', + 'notification' => 'setNotification', + 'types' => 'setTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_ids' => 'getMerchantIds', + 'notification' => 'getNotification', + 'types' => 'getTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_ids', $data ?? [], null); + $this->setIfExists('notification', $data ?? [], null); + $this->setIfExists('types', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_ids + * + * @return string[]|null + */ + public function getMerchantIds() + { + return $this->container['merchant_ids']; + } + + /** + * Sets merchant_ids + * + * @param string[]|null $merchant_ids List of `merchantId` values for which test webhooks will be sent. The list can have a maximum of 20 `merchantId` values. If not specified, we send sample notifications to all the merchant accounts that the webhook is configured for. If this is more than 20 merchant accounts, use this list to specify a subset of the merchant accounts for which to send test notifications. + * + * @return self + */ + public function setMerchantIds($merchant_ids) + { + if (is_null($merchant_ids)) { + throw new \InvalidArgumentException('non-nullable merchant_ids cannot be null'); + } + $this->container['merchant_ids'] = $merchant_ids; + + return $this; + } + + /** + * Gets notification + * + * @return \Adyen\Model\Management\CustomNotification|null + */ + public function getNotification() + { + return $this->container['notification']; + } + + /** + * Sets notification + * + * @param \Adyen\Model\Management\CustomNotification|null $notification notification + * + * @return self + */ + public function setNotification($notification) + { + if (is_null($notification)) { + throw new \InvalidArgumentException('non-nullable notification cannot be null'); + } + $this->container['notification'] = $notification; + + return $this; + } + + /** + * Gets types + * + * @return string[]|null + */ + public function getTypes() + { + return $this->container['types']; + } + + /** + * Sets types + * + * @param string[]|null $types List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** + * + * @return self + */ + public function setTypes($types) + { + if (is_null($types)) { + throw new \InvalidArgumentException('non-nullable types cannot be null'); + } + $this->container['types'] = $types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TestOutput.php b/src/Adyen/Model/Management/TestOutput.php new file mode 100644 index 000000000..92ba24eb9 --- /dev/null +++ b/src/Adyen/Model/Management/TestOutput.php @@ -0,0 +1,558 @@ + + */ +class TestOutput implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TestOutput'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchant_id' => 'string', + 'output' => 'string', + 'request_sent' => 'string', + 'response_code' => 'string', + 'response_time' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchant_id' => null, + 'output' => null, + 'request_sent' => null, + 'response_code' => null, + 'response_time' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchant_id' => false, + 'output' => false, + 'request_sent' => false, + 'response_code' => false, + 'response_time' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchant_id' => 'merchantId', + 'output' => 'output', + 'request_sent' => 'requestSent', + 'response_code' => 'responseCode', + 'response_time' => 'responseTime', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchant_id' => 'setMerchantId', + 'output' => 'setOutput', + 'request_sent' => 'setRequestSent', + 'response_code' => 'setResponseCode', + 'response_time' => 'setResponseTime', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchant_id' => 'getMerchantId', + 'output' => 'getOutput', + 'request_sent' => 'getRequestSent', + 'response_code' => 'getResponseCode', + 'response_time' => 'getResponseTime', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('output', $data ?? [], null); + $this->setIfExists('request_sent', $data ?? [], null); + $this->setIfExists('response_code', $data ?? [], null); + $this->setIfExists('response_time', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchant_id + * + * @return string|null + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string|null $merchant_id Unique identifier of the merchant account that the notification is about. + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + + /** + * Gets output + * + * @return string|null + */ + public function getOutput() + { + return $this->container['output']; + } + + /** + * Sets output + * + * @param string|null $output The response your server returned for the test webhook. Your server must respond with **[accepted]** for the test webhook to be successful (`data.status`: **success**). Find out more about [accepting notifications](https://docs.adyen.com/development-resources/webhooks#accept-notifications) You can use the value of this field together with the [`responseCode`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-responseCode) value to troubleshoot unsuccessful test webhooks. + * + * @return self + */ + public function setOutput($output) + { + if (is_null($output)) { + throw new \InvalidArgumentException('non-nullable output cannot be null'); + } + $this->container['output'] = $output; + + return $this; + } + + /** + * Gets request_sent + * + * @return string|null + */ + public function getRequestSent() + { + return $this->container['request_sent']; + } + + /** + * Sets request_sent + * + * @param string|null $request_sent The [body of the notification webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#notification-structure) that was sent to your server. + * + * @return self + */ + public function setRequestSent($request_sent) + { + if (is_null($request_sent)) { + throw new \InvalidArgumentException('non-nullable request_sent cannot be null'); + } + $this->container['request_sent'] = $request_sent; + + return $this; + } + + /** + * Gets response_code + * + * @return string|null + */ + public function getResponseCode() + { + return $this->container['response_code']; + } + + /** + * Sets response_code + * + * @param string|null $response_code The HTTP response code for your server's response to the test webhook. You can use the value of this field together with the the [`output`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-output) field value to troubleshoot failed test webhooks. + * + * @return self + */ + public function setResponseCode($response_code) + { + if (is_null($response_code)) { + throw new \InvalidArgumentException('non-nullable response_code cannot be null'); + } + $this->container['response_code'] = $response_code; + + return $this; + } + + /** + * Gets response_time + * + * @return string|null + */ + public function getResponseTime() + { + return $this->container['response_time']; + } + + /** + * Sets response_time + * + * @param string|null $response_time The time between sending the test webhook and receiving the response from your server. You can use it as an indication of how long your server takes to process a webhook notification. Measured in milliseconds, for example **304 ms**. + * + * @return self + */ + public function setResponseTime($response_time) + { + if (is_null($response_time)) { + throw new \InvalidArgumentException('non-nullable response_time cannot be null'); + } + $this->container['response_time'] = $response_time; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the test request. Possible values are: * **success**, if `data.output`: **[accepted]** and `data.responseCode`: **200**. * **failed**, in all other cases. You can use the value of the [`output`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-output) field together with the [`responseCode`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/merchants/{merchantId}/webhooks/{id}/test__resParam_data-responseCode) value to troubleshoot failed test webhooks. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TestWebhookRequest.php b/src/Adyen/Model/Management/TestWebhookRequest.php new file mode 100644 index 000000000..c84a4fd6a --- /dev/null +++ b/src/Adyen/Model/Management/TestWebhookRequest.php @@ -0,0 +1,419 @@ + + */ +class TestWebhookRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TestWebhookRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'notification' => '\Adyen\Model\Management\CustomNotification', + 'types' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'notification' => null, + 'types' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'notification' => false, + 'types' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notification' => 'notification', + 'types' => 'types' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notification' => 'setNotification', + 'types' => 'setTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notification' => 'getNotification', + 'types' => 'getTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('notification', $data ?? [], null); + $this->setIfExists('types', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets notification + * + * @return \Adyen\Model\Management\CustomNotification|null + */ + public function getNotification() + { + return $this->container['notification']; + } + + /** + * Sets notification + * + * @param \Adyen\Model\Management\CustomNotification|null $notification notification + * + * @return self + */ + public function setNotification($notification) + { + if (is_null($notification)) { + throw new \InvalidArgumentException('non-nullable notification cannot be null'); + } + $this->container['notification'] = $notification; + + return $this; + } + + /** + * Gets types + * + * @return string[]|null + */ + public function getTypes() + { + return $this->container['types']; + } + + /** + * Sets types + * + * @param string[]|null $types List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** + * + * @return self + */ + public function setTypes($types) + { + if (is_null($types)) { + throw new \InvalidArgumentException('non-nullable types cannot be null'); + } + $this->container['types'] = $types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/TestWebhookResponse.php b/src/Adyen/Model/Management/TestWebhookResponse.php new file mode 100644 index 000000000..345ae159e --- /dev/null +++ b/src/Adyen/Model/Management/TestWebhookResponse.php @@ -0,0 +1,385 @@ + + */ +class TestWebhookResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TestWebhookResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\Management\TestOutput[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Adyen\Model\Management\TestOutput[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\Management\TestOutput[]|null $data List with test results. Each test webhook we send has a list element with the result. + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Timeouts.php b/src/Adyen/Model/Management/Timeouts.php new file mode 100644 index 000000000..80d3a077c --- /dev/null +++ b/src/Adyen/Model/Management/Timeouts.php @@ -0,0 +1,383 @@ + + */ +class Timeouts implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Timeouts'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'from_active_to_sleep' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from_active_to_sleep' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'from_active_to_sleep' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from_active_to_sleep' => 'fromActiveToSleep' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from_active_to_sleep' => 'setFromActiveToSleep' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from_active_to_sleep' => 'getFromActiveToSleep' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('from_active_to_sleep', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets from_active_to_sleep + * + * @return int|null + */ + public function getFromActiveToSleep() + { + return $this->container['from_active_to_sleep']; + } + + /** + * Sets from_active_to_sleep + * + * @param int|null $from_active_to_sleep Indicates the number of seconds of inactivity after which the terminal display goes into sleep mode. + * + * @return self + */ + public function setFromActiveToSleep($from_active_to_sleep) + { + // Do nothing for nullable integers + $this->container['from_active_to_sleep'] = $from_active_to_sleep; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UninstallAndroidAppDetails.php b/src/Adyen/Model/Management/UninstallAndroidAppDetails.php new file mode 100644 index 000000000..de0d08e8d --- /dev/null +++ b/src/Adyen/Model/Management/UninstallAndroidAppDetails.php @@ -0,0 +1,450 @@ + + */ +class UninstallAndroidAppDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UninstallAndroidAppDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'app_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'app_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'app_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'app_id' => 'appId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'app_id' => 'setAppId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'app_id' => 'getAppId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_UNINSTALL_ANDROID_APP = 'UninstallAndroidApp'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UNINSTALL_ANDROID_APP, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('app_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'UninstallAndroidApp'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets app_id + * + * @return string|null + */ + public function getAppId() + { + return $this->container['app_id']; + } + + /** + * Sets app_id + * + * @param string|null $app_id The unique identifier of the app to be uninstalled. + * + * @return self + */ + public function setAppId($app_id) + { + if (is_null($app_id)) { + throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + } + $this->container['app_id'] = $app_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of terminal action: Uninstall an Android app. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UninstallAndroidCertificateDetails.php b/src/Adyen/Model/Management/UninstallAndroidCertificateDetails.php new file mode 100644 index 000000000..1a1cc8395 --- /dev/null +++ b/src/Adyen/Model/Management/UninstallAndroidCertificateDetails.php @@ -0,0 +1,450 @@ + + */ +class UninstallAndroidCertificateDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UninstallAndroidCertificateDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'certificate_id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'certificate_id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'certificate_id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'certificate_id' => 'certificateId', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'certificate_id' => 'setCertificateId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'certificate_id' => 'getCertificateId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_UNINSTALL_ANDROID_CERTIFICATE = 'UninstallAndroidCertificate'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UNINSTALL_ANDROID_CERTIFICATE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('certificate_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'UninstallAndroidCertificate'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets certificate_id + * + * @return string|null + */ + public function getCertificateId() + { + return $this->container['certificate_id']; + } + + /** + * Sets certificate_id + * + * @param string|null $certificate_id The unique identifier of the certificate to be uninstalled. + * + * @return self + */ + public function setCertificateId($certificate_id) + { + if (is_null($certificate_id)) { + throw new \InvalidArgumentException('non-nullable certificate_id cannot be null'); + } + $this->container['certificate_id'] = $certificate_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of terminal action: Uninstall an Android certificate. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdatableAddress.php b/src/Adyen/Model/Management/UpdatableAddress.php new file mode 100644 index 000000000..6ac0ec730 --- /dev/null +++ b/src/Adyen/Model/Management/UpdatableAddress.php @@ -0,0 +1,555 @@ + + */ +class UpdatableAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdatableAddress'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'line3' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'city' => null, + 'line1' => null, + 'line2' => null, + 'line3' => null, + 'postal_code' => null, + 'state_or_province' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, + 'postal_code' => false, + 'state_or_province' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'line1' => 'line1', + 'line2' => 'line2', + 'line3' => 'line3', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'line3' => 'setLine3', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'line3' => 'getLine3', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('line3', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The name of the city. + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 The street address. + * + * @return self + */ + public function setLine1($line1) + { + if (is_null($line1)) { + throw new \InvalidArgumentException('non-nullable line1 cannot be null'); + } + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 Second address line. + * + * @return self + */ + public function setLine2($line2) + { + if (is_null($line2)) { + throw new \InvalidArgumentException('non-nullable line2 cannot be null'); + } + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets line3 + * + * @return string|null + */ + public function getLine3() + { + return $this->container['line3']; + } + + /** + * Sets line3 + * + * @param string|null $line3 Third address line. + * + * @return self + */ + public function setLine3($line3) + { + if (is_null($line3)) { + throw new \InvalidArgumentException('non-nullable line3 cannot be null'); + } + $this->container['line3'] = $line3; + + 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. + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province The state or province code as defined in [ISO 3166-2](https://www.iso.org/standard/72483.html). For example, **ON** for Ontario, Canada. Required for the following countries: - Australia - Brazil - Canada - India - Mexico - New Zealand - United States + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php b/src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php new file mode 100644 index 000000000..f6a692e26 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.php @@ -0,0 +1,521 @@ + + */ +class UpdateCompanyApiCredentialRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateCompanyApiCredentialRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'active' => 'bool', + 'allowed_origins' => 'string[]', + 'associated_merchant_accounts' => 'string[]', + 'description' => 'string', + 'roles' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active' => null, + 'allowed_origins' => null, + 'associated_merchant_accounts' => null, + 'description' => null, + 'roles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'active' => false, + 'allowed_origins' => false, + 'associated_merchant_accounts' => false, + 'description' => false, + 'roles' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'allowed_origins' => 'allowedOrigins', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'description' => 'description', + 'roles' => 'roles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'allowed_origins' => 'setAllowedOrigins', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'description' => 'setDescription', + 'roles' => 'setRoles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'allowed_origins' => 'getAllowedOrigins', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'description' => 'getDescription', + 'roles' => 'getRoles' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates if the API credential is enabled. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets allowed_origins + * + * @return string[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param string[]|null $allowed_origins The new list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts List of merchant accounts that the API credential has access to. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) of the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateCompanyUserRequest.php b/src/Adyen/Model/Management/UpdateCompanyUserRequest.php new file mode 100644 index 000000000..d849e0a9e --- /dev/null +++ b/src/Adyen/Model/Management/UpdateCompanyUserRequest.php @@ -0,0 +1,657 @@ + + */ +class UpdateCompanyUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateCompanyUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_groups' => 'string[]', + 'active' => 'bool', + 'associated_merchant_accounts' => 'string[]', + 'authn_apps_to_add' => 'string[]', + 'authn_apps_to_remove' => 'string[]', + 'email' => 'string', + 'name' => '\Adyen\Model\Management\Name2', + 'roles' => 'string[]', + 'time_zone_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_groups' => null, + 'active' => null, + 'associated_merchant_accounts' => null, + 'authn_apps_to_add' => null, + 'authn_apps_to_remove' => null, + 'email' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_groups' => false, + 'active' => false, + 'associated_merchant_accounts' => false, + 'authn_apps_to_add' => false, + 'authn_apps_to_remove' => false, + 'email' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_groups' => 'accountGroups', + 'active' => 'active', + 'associated_merchant_accounts' => 'associatedMerchantAccounts', + 'authn_apps_to_add' => 'authnAppsToAdd', + 'authn_apps_to_remove' => 'authnAppsToRemove', + 'email' => 'email', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_groups' => 'setAccountGroups', + 'active' => 'setActive', + 'associated_merchant_accounts' => 'setAssociatedMerchantAccounts', + 'authn_apps_to_add' => 'setAuthnAppsToAdd', + 'authn_apps_to_remove' => 'setAuthnAppsToRemove', + 'email' => 'setEmail', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_groups' => 'getAccountGroups', + 'active' => 'getActive', + 'associated_merchant_accounts' => 'getAssociatedMerchantAccounts', + 'authn_apps_to_add' => 'getAuthnAppsToAdd', + 'authn_apps_to_remove' => 'getAuthnAppsToRemove', + 'email' => 'getEmail', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('associated_merchant_accounts', $data ?? [], null); + $this->setIfExists('authn_apps_to_add', $data ?? [], null); + $this->setIfExists('authn_apps_to_remove', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates whether this user is active. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets associated_merchant_accounts + * + * @return string[]|null + */ + public function getAssociatedMerchantAccounts() + { + return $this->container['associated_merchant_accounts']; + } + + /** + * Sets associated_merchant_accounts + * + * @param string[]|null $associated_merchant_accounts The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) to associate the user with. + * + * @return self + */ + public function setAssociatedMerchantAccounts($associated_merchant_accounts) + { + if (is_null($associated_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable associated_merchant_accounts cannot be null'); + } + $this->container['associated_merchant_accounts'] = $associated_merchant_accounts; + + return $this; + } + + /** + * Gets authn_apps_to_add + * + * @return string[]|null + */ + public function getAuthnAppsToAdd() + { + return $this->container['authn_apps_to_add']; + } + + /** + * Sets authn_apps_to_add + * + * @param string[]|null $authn_apps_to_add Set of authn apps to add to this user + * + * @return self + */ + public function setAuthnAppsToAdd($authn_apps_to_add) + { + if (is_null($authn_apps_to_add)) { + throw new \InvalidArgumentException('non-nullable authn_apps_to_add cannot be null'); + } + $this->container['authn_apps_to_add'] = $authn_apps_to_add; + + return $this; + } + + /** + * Gets authn_apps_to_remove + * + * @return string[]|null + */ + public function getAuthnAppsToRemove() + { + return $this->container['authn_apps_to_remove']; + } + + /** + * Sets authn_apps_to_remove + * + * @param string[]|null $authn_apps_to_remove Set of authn apps to remove from this user + * + * @return self + */ + public function setAuthnAppsToRemove($authn_apps_to_remove) + { + if (is_null($authn_apps_to_remove)) { + throw new \InvalidArgumentException('non-nullable authn_apps_to_remove cannot be null'); + } + $this->container['authn_apps_to_remove'] = $authn_apps_to_remove; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name2|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name2|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string|null + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string|null $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php b/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php new file mode 100644 index 000000000..6cf507c57 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateCompanyWebhookRequest.php @@ -0,0 +1,1009 @@ + + */ +class UpdateCompanyWebhookRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateCompanyWebhookRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accepts_expired_certificate' => 'bool', + 'accepts_self_signed_certificate' => 'bool', + 'accepts_untrusted_root_certificate' => 'bool', + 'active' => 'bool', + 'additional_settings' => '\Adyen\Model\Management\AdditionalSettings', + 'communication_format' => 'string', + 'description' => 'string', + 'filter_merchant_account_type' => 'string', + 'filter_merchant_accounts' => 'string[]', + 'network_type' => 'string', + 'password' => 'string', + 'populate_soap_action_header' => 'bool', + 'ssl_version' => 'string', + 'url' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accepts_expired_certificate' => null, + 'accepts_self_signed_certificate' => null, + 'accepts_untrusted_root_certificate' => null, + 'active' => null, + 'additional_settings' => null, + 'communication_format' => null, + 'description' => null, + 'filter_merchant_account_type' => null, + 'filter_merchant_accounts' => null, + 'network_type' => null, + 'password' => null, + 'populate_soap_action_header' => null, + 'ssl_version' => null, + 'url' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accepts_expired_certificate' => false, + 'accepts_self_signed_certificate' => false, + 'accepts_untrusted_root_certificate' => false, + 'active' => false, + 'additional_settings' => false, + 'communication_format' => false, + 'description' => false, + 'filter_merchant_account_type' => false, + 'filter_merchant_accounts' => false, + 'network_type' => false, + 'password' => false, + 'populate_soap_action_header' => false, + 'ssl_version' => false, + 'url' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accepts_expired_certificate' => 'acceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'acceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'acceptsUntrustedRootCertificate', + 'active' => 'active', + 'additional_settings' => 'additionalSettings', + 'communication_format' => 'communicationFormat', + 'description' => 'description', + 'filter_merchant_account_type' => 'filterMerchantAccountType', + 'filter_merchant_accounts' => 'filterMerchantAccounts', + 'network_type' => 'networkType', + 'password' => 'password', + 'populate_soap_action_header' => 'populateSoapActionHeader', + 'ssl_version' => 'sslVersion', + 'url' => 'url', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accepts_expired_certificate' => 'setAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'setAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'setAcceptsUntrustedRootCertificate', + 'active' => 'setActive', + 'additional_settings' => 'setAdditionalSettings', + 'communication_format' => 'setCommunicationFormat', + 'description' => 'setDescription', + 'filter_merchant_account_type' => 'setFilterMerchantAccountType', + 'filter_merchant_accounts' => 'setFilterMerchantAccounts', + 'network_type' => 'setNetworkType', + 'password' => 'setPassword', + 'populate_soap_action_header' => 'setPopulateSoapActionHeader', + 'ssl_version' => 'setSslVersion', + 'url' => 'setUrl', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accepts_expired_certificate' => 'getAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'getAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'getAcceptsUntrustedRootCertificate', + 'active' => 'getActive', + 'additional_settings' => 'getAdditionalSettings', + 'communication_format' => 'getCommunicationFormat', + 'description' => 'getDescription', + 'filter_merchant_account_type' => 'getFilterMerchantAccountType', + 'filter_merchant_accounts' => 'getFilterMerchantAccounts', + 'network_type' => 'getNetworkType', + 'password' => 'getPassword', + 'populate_soap_action_header' => 'getPopulateSoapActionHeader', + 'ssl_version' => 'getSslVersion', + 'url' => 'getUrl', + 'username' => 'getUsername' + ]; + + /** + * 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 COMMUNICATION_FORMAT_HTTP = 'http'; + public const COMMUNICATION_FORMAT_JSON = 'json'; + public const COMMUNICATION_FORMAT_SOAP = 'soap'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS = 'allAccounts'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS = 'excludeAccounts'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS = 'includeAccounts'; + public const NETWORK_TYPE_LOCAL = 'LOCAL'; + public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const SSL_VERSION_HTTP = 'HTTP'; + public const SSL_VERSION_SSL = 'SSL'; + public const SSL_VERSION_SSLV3 = 'SSLv3'; + public const SSL_VERSION_TLS = 'TLS'; + public const SSL_VERSION_TLSV1 = 'TLSv1'; + public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; + public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; + public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCommunicationFormatAllowableValues() + { + return [ + self::COMMUNICATION_FORMAT_HTTP, + self::COMMUNICATION_FORMAT_JSON, + self::COMMUNICATION_FORMAT_SOAP, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFilterMerchantAccountTypeAllowableValues() + { + return [ + self::FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS, + self::FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS, + self::FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNetworkTypeAllowableValues() + { + return [ + self::NETWORK_TYPE_LOCAL, + self::NETWORK_TYPE__PUBLIC, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSslVersionAllowableValues() + { + return [ + self::SSL_VERSION_HTTP, + self::SSL_VERSION_SSL, + self::SSL_VERSION_SSLV3, + self::SSL_VERSION_TLS, + self::SSL_VERSION_TLSV1, + self::SSL_VERSION_TLSV1_1, + self::SSL_VERSION_TLSV1_2, + self::SSL_VERSION_TLSV1_3, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accepts_expired_certificate', $data ?? [], null); + $this->setIfExists('accepts_self_signed_certificate', $data ?? [], null); + $this->setIfExists('accepts_untrusted_root_certificate', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('additional_settings', $data ?? [], null); + $this->setIfExists('communication_format', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('filter_merchant_account_type', $data ?? [], null); + $this->setIfExists('filter_merchant_accounts', $data ?? [], null); + $this->setIfExists('network_type', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('populate_soap_action_header', $data ?? [], null); + $this->setIfExists('ssl_version', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!is_null($this->container['communication_format']) && !in_array($this->container['communication_format'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'communication_format', must be one of '%s'", + $this->container['communication_format'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); + if (!is_null($this->container['filter_merchant_account_type']) && !in_array($this->container['filter_merchant_account_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'filter_merchant_account_type', must be one of '%s'", + $this->container['filter_merchant_account_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!is_null($this->container['network_type']) && !in_array($this->container['network_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'network_type', must be one of '%s'", + $this->container['network_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSslVersionAllowableValues(); + if (!is_null($this->container['ssl_version']) && !in_array($this->container['ssl_version'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ssl_version', must be one of '%s'", + $this->container['ssl_version'], + 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 accepts_expired_certificate + * + * @return bool|null + */ + public function getAcceptsExpiredCertificate() + { + return $this->container['accepts_expired_certificate']; + } + + /** + * Sets accepts_expired_certificate + * + * @param bool|null $accepts_expired_certificate Indicates if expired SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsExpiredCertificate($accepts_expired_certificate) + { + if (is_null($accepts_expired_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_expired_certificate cannot be null'); + } + $this->container['accepts_expired_certificate'] = $accepts_expired_certificate; + + return $this; + } + + /** + * Gets accepts_self_signed_certificate + * + * @return bool|null + */ + public function getAcceptsSelfSignedCertificate() + { + return $this->container['accepts_self_signed_certificate']; + } + + /** + * Sets accepts_self_signed_certificate + * + * @param bool|null $accepts_self_signed_certificate Indicates if self-signed SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsSelfSignedCertificate($accepts_self_signed_certificate) + { + if (is_null($accepts_self_signed_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_self_signed_certificate cannot be null'); + } + $this->container['accepts_self_signed_certificate'] = $accepts_self_signed_certificate; + + return $this; + } + + /** + * Gets accepts_untrusted_root_certificate + * + * @return bool|null + */ + public function getAcceptsUntrustedRootCertificate() + { + return $this->container['accepts_untrusted_root_certificate']; + } + + /** + * Sets accepts_untrusted_root_certificate + * + * @param bool|null $accepts_untrusted_root_certificate Indicates if untrusted SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsUntrustedRootCertificate($accepts_untrusted_root_certificate) + { + if (is_null($accepts_untrusted_root_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_untrusted_root_certificate cannot be null'); + } + $this->container['accepts_untrusted_root_certificate'] = $accepts_untrusted_root_certificate; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets additional_settings + * + * @return \Adyen\Model\Management\AdditionalSettings|null + */ + public function getAdditionalSettings() + { + return $this->container['additional_settings']; + } + + /** + * Sets additional_settings + * + * @param \Adyen\Model\Management\AdditionalSettings|null $additional_settings additional_settings + * + * @return self + */ + public function setAdditionalSettings($additional_settings) + { + if (is_null($additional_settings)) { + throw new \InvalidArgumentException('non-nullable additional_settings cannot be null'); + } + $this->container['additional_settings'] = $additional_settings; + + return $this; + } + + /** + * Gets communication_format + * + * @return string|null + */ + public function getCommunicationFormat() + { + return $this->container['communication_format']; + } + + /** + * Sets communication_format + * + * @param string|null $communication_format Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + * + * @return self + */ + public function setCommunicationFormat($communication_format) + { + if (is_null($communication_format)) { + throw new \InvalidArgumentException('non-nullable communication_format cannot be null'); + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!in_array($communication_format, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'communication_format', must be one of '%s'", + $communication_format, + implode("', '", $allowedValues) + ) + ); + } + $this->container['communication_format'] = $communication_format; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for this webhook configuration. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets filter_merchant_account_type + * + * @return string|null + */ + public function getFilterMerchantAccountType() + { + return $this->container['filter_merchant_account_type']; + } + + /** + * Sets filter_merchant_account_type + * + * @param string|null $filter_merchant_account_type Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **includeAccounts**: The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts**: The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. * **allAccounts**: Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. + * + * @return self + */ + public function setFilterMerchantAccountType($filter_merchant_account_type) + { + if (is_null($filter_merchant_account_type)) { + throw new \InvalidArgumentException('non-nullable filter_merchant_account_type cannot be null'); + } + $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); + if (!in_array($filter_merchant_account_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_merchant_account_type', must be one of '%s'", + $filter_merchant_account_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_merchant_account_type'] = $filter_merchant_account_type; + + return $this; + } + + /** + * Gets filter_merchant_accounts + * + * @return string[]|null + */ + public function getFilterMerchantAccounts() + { + return $this->container['filter_merchant_accounts']; + } + + /** + * Sets filter_merchant_accounts + * + * @param string[]|null $filter_merchant_accounts A list of merchant account names that are included or excluded from receiving the webhook. Inclusion or exclusion is based on the value defined for `filterMerchantAccountType`. Required if `filterMerchantAccountType` is either: * **includeAccounts** * **excludeAccounts** Not needed for `filterMerchantAccountType`: **allAccounts**. + * + * @return self + */ + public function setFilterMerchantAccounts($filter_merchant_accounts) + { + if (is_null($filter_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable filter_merchant_accounts cannot be null'); + } + $this->container['filter_merchant_accounts'] = $filter_merchant_accounts; + + return $this; + } + + /** + * Gets network_type + * + * @return string|null + */ + public function getNetworkType() + { + return $this->container['network_type']; + } + + /** + * Sets network_type + * + * @param string|null $network_type Network type for Terminal API notification webhooks. Possible values: * **public** * **local** Default Value: **public**. + * + * @return self + */ + public function setNetworkType($network_type) + { + if (is_null($network_type)) { + throw new \InvalidArgumentException('non-nullable network_type cannot be null'); + } + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!in_array($network_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'network_type', must be one of '%s'", + $network_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['network_type'] = $network_type; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password Password to access the webhook URL. + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets populate_soap_action_header + * + * @return bool|null + */ + public function getPopulateSoapActionHeader() + { + return $this->container['populate_soap_action_header']; + } + + /** + * Sets populate_soap_action_header + * + * @param bool|null $populate_soap_action_header Indicates if the SOAP action header needs to be populated. Default value: **false**. Only applies if `communicationFormat`: **soap**. + * + * @return self + */ + public function setPopulateSoapActionHeader($populate_soap_action_header) + { + if (is_null($populate_soap_action_header)) { + throw new \InvalidArgumentException('non-nullable populate_soap_action_header cannot be null'); + } + $this->container['populate_soap_action_header'] = $populate_soap_action_header; + + return $this; + } + + /** + * Gets ssl_version + * + * @return string|null + */ + public function getSslVersion() + { + return $this->container['ssl_version']; + } + + /** + * Sets ssl_version + * + * @param string|null $ssl_version SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. + * + * @return self + */ + public function setSslVersion($ssl_version) + { + if (is_null($ssl_version)) { + throw new \InvalidArgumentException('non-nullable ssl_version cannot be null'); + } + $allowedValues = $this->getSslVersionAllowableValues(); + if (!in_array($ssl_version, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ssl_version', must be one of '%s'", + $ssl_version, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ssl_version'] = $ssl_version; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username Username to access the webhook URL. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php b/src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php new file mode 100644 index 000000000..e83da0432 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.php @@ -0,0 +1,487 @@ + + */ +class UpdateMerchantApiCredentialRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateMerchantApiCredentialRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'active' => 'bool', + 'allowed_origins' => 'string[]', + 'description' => 'string', + 'roles' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active' => null, + 'allowed_origins' => null, + 'description' => null, + 'roles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'active' => false, + 'allowed_origins' => false, + 'description' => false, + 'roles' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active' => 'active', + 'allowed_origins' => 'allowedOrigins', + 'description' => 'description', + 'roles' => 'roles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active' => 'setActive', + 'allowed_origins' => 'setAllowedOrigins', + 'description' => 'setDescription', + 'roles' => 'setRoles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active' => 'getActive', + 'allowed_origins' => 'getAllowedOrigins', + 'description' => 'getDescription', + 'roles' => 'getRoles' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('allowed_origins', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates if the API credential is enabled. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets allowed_origins + * + * @return string[]|null + */ + public function getAllowedOrigins() + { + return $this->container['allowed_origins']; + } + + /** + * Sets allowed_origins + * + * @param string[]|null $allowed_origins The new list of [allowed origins](https://docs.adyen.com/development-resources/client-side-authentication#allowed-origins) for the API credential. + * + * @return self + */ + public function setAllowedOrigins($allowed_origins) + { + if (is_null($allowed_origins)) { + throw new \InvalidArgumentException('non-nullable allowed_origins cannot be null'); + } + $this->container['allowed_origins'] = $allowed_origins; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the API credential. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles List of [roles](https://docs.adyen.com/development-resources/api-credentials#roles-1) for the API credential. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateMerchantUserRequest.php b/src/Adyen/Model/Management/UpdateMerchantUserRequest.php new file mode 100644 index 000000000..a045258d5 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateMerchantUserRequest.php @@ -0,0 +1,623 @@ + + */ +class UpdateMerchantUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateMerchantUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_groups' => 'string[]', + 'active' => 'bool', + 'authn_apps_to_add' => 'string[]', + 'authn_apps_to_remove' => 'string[]', + 'email' => 'string', + 'name' => '\Adyen\Model\Management\Name2', + 'roles' => 'string[]', + 'time_zone_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_groups' => null, + 'active' => null, + 'authn_apps_to_add' => null, + 'authn_apps_to_remove' => null, + 'email' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_groups' => false, + 'active' => false, + 'authn_apps_to_add' => false, + 'authn_apps_to_remove' => false, + 'email' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_groups' => 'accountGroups', + 'active' => 'active', + 'authn_apps_to_add' => 'authnAppsToAdd', + 'authn_apps_to_remove' => 'authnAppsToRemove', + 'email' => 'email', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_groups' => 'setAccountGroups', + 'active' => 'setActive', + 'authn_apps_to_add' => 'setAuthnAppsToAdd', + 'authn_apps_to_remove' => 'setAuthnAppsToRemove', + 'email' => 'setEmail', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_groups' => 'getAccountGroups', + 'active' => 'getActive', + 'authn_apps_to_add' => 'getAuthnAppsToAdd', + 'authn_apps_to_remove' => 'getAuthnAppsToRemove', + 'email' => 'getEmail', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('authn_apps_to_add', $data ?? [], null); + $this->setIfExists('authn_apps_to_remove', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Sets the status of the user to active (**true**) or inactive (**false**). + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets authn_apps_to_add + * + * @return string[]|null + */ + public function getAuthnAppsToAdd() + { + return $this->container['authn_apps_to_add']; + } + + /** + * Sets authn_apps_to_add + * + * @param string[]|null $authn_apps_to_add Set of authn apps to add to this user + * + * @return self + */ + public function setAuthnAppsToAdd($authn_apps_to_add) + { + if (is_null($authn_apps_to_add)) { + throw new \InvalidArgumentException('non-nullable authn_apps_to_add cannot be null'); + } + $this->container['authn_apps_to_add'] = $authn_apps_to_add; + + return $this; + } + + /** + * Gets authn_apps_to_remove + * + * @return string[]|null + */ + public function getAuthnAppsToRemove() + { + return $this->container['authn_apps_to_remove']; + } + + /** + * Sets authn_apps_to_remove + * + * @param string[]|null $authn_apps_to_remove Set of authn apps to remove from this user + * + * @return self + */ + public function setAuthnAppsToRemove($authn_apps_to_remove) + { + if (is_null($authn_apps_to_remove)) { + throw new \InvalidArgumentException('non-nullable authn_apps_to_remove cannot be null'); + } + $this->container['authn_apps_to_remove'] = $authn_apps_to_remove; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name2|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name2|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string|null + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string|null $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php b/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php new file mode 100644 index 000000000..8bb44d5a8 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateMerchantWebhookRequest.php @@ -0,0 +1,906 @@ + + */ +class UpdateMerchantWebhookRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateMerchantWebhookRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accepts_expired_certificate' => 'bool', + 'accepts_self_signed_certificate' => 'bool', + 'accepts_untrusted_root_certificate' => 'bool', + 'active' => 'bool', + 'additional_settings' => '\Adyen\Model\Management\AdditionalSettings', + 'communication_format' => 'string', + 'description' => 'string', + 'network_type' => 'string', + 'password' => 'string', + 'populate_soap_action_header' => 'bool', + 'ssl_version' => 'string', + 'url' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accepts_expired_certificate' => null, + 'accepts_self_signed_certificate' => null, + 'accepts_untrusted_root_certificate' => null, + 'active' => null, + 'additional_settings' => null, + 'communication_format' => null, + 'description' => null, + 'network_type' => null, + 'password' => null, + 'populate_soap_action_header' => null, + 'ssl_version' => null, + 'url' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accepts_expired_certificate' => false, + 'accepts_self_signed_certificate' => false, + 'accepts_untrusted_root_certificate' => false, + 'active' => false, + 'additional_settings' => false, + 'communication_format' => false, + 'description' => false, + 'network_type' => false, + 'password' => false, + 'populate_soap_action_header' => false, + 'ssl_version' => false, + 'url' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accepts_expired_certificate' => 'acceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'acceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'acceptsUntrustedRootCertificate', + 'active' => 'active', + 'additional_settings' => 'additionalSettings', + 'communication_format' => 'communicationFormat', + 'description' => 'description', + 'network_type' => 'networkType', + 'password' => 'password', + 'populate_soap_action_header' => 'populateSoapActionHeader', + 'ssl_version' => 'sslVersion', + 'url' => 'url', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accepts_expired_certificate' => 'setAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'setAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'setAcceptsUntrustedRootCertificate', + 'active' => 'setActive', + 'additional_settings' => 'setAdditionalSettings', + 'communication_format' => 'setCommunicationFormat', + 'description' => 'setDescription', + 'network_type' => 'setNetworkType', + 'password' => 'setPassword', + 'populate_soap_action_header' => 'setPopulateSoapActionHeader', + 'ssl_version' => 'setSslVersion', + 'url' => 'setUrl', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accepts_expired_certificate' => 'getAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'getAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'getAcceptsUntrustedRootCertificate', + 'active' => 'getActive', + 'additional_settings' => 'getAdditionalSettings', + 'communication_format' => 'getCommunicationFormat', + 'description' => 'getDescription', + 'network_type' => 'getNetworkType', + 'password' => 'getPassword', + 'populate_soap_action_header' => 'getPopulateSoapActionHeader', + 'ssl_version' => 'getSslVersion', + 'url' => 'getUrl', + 'username' => 'getUsername' + ]; + + /** + * 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 COMMUNICATION_FORMAT_HTTP = 'http'; + public const COMMUNICATION_FORMAT_JSON = 'json'; + public const COMMUNICATION_FORMAT_SOAP = 'soap'; + public const NETWORK_TYPE_LOCAL = 'LOCAL'; + public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const SSL_VERSION_HTTP = 'HTTP'; + public const SSL_VERSION_SSL = 'SSL'; + public const SSL_VERSION_SSLV3 = 'SSLv3'; + public const SSL_VERSION_TLS = 'TLS'; + public const SSL_VERSION_TLSV1 = 'TLSv1'; + public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; + public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; + public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCommunicationFormatAllowableValues() + { + return [ + self::COMMUNICATION_FORMAT_HTTP, + self::COMMUNICATION_FORMAT_JSON, + self::COMMUNICATION_FORMAT_SOAP, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNetworkTypeAllowableValues() + { + return [ + self::NETWORK_TYPE_LOCAL, + self::NETWORK_TYPE__PUBLIC, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSslVersionAllowableValues() + { + return [ + self::SSL_VERSION_HTTP, + self::SSL_VERSION_SSL, + self::SSL_VERSION_SSLV3, + self::SSL_VERSION_TLS, + self::SSL_VERSION_TLSV1, + self::SSL_VERSION_TLSV1_1, + self::SSL_VERSION_TLSV1_2, + self::SSL_VERSION_TLSV1_3, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('accepts_expired_certificate', $data ?? [], null); + $this->setIfExists('accepts_self_signed_certificate', $data ?? [], null); + $this->setIfExists('accepts_untrusted_root_certificate', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('additional_settings', $data ?? [], null); + $this->setIfExists('communication_format', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('network_type', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('populate_soap_action_header', $data ?? [], null); + $this->setIfExists('ssl_version', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!is_null($this->container['communication_format']) && !in_array($this->container['communication_format'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'communication_format', must be one of '%s'", + $this->container['communication_format'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!is_null($this->container['network_type']) && !in_array($this->container['network_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'network_type', must be one of '%s'", + $this->container['network_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSslVersionAllowableValues(); + if (!is_null($this->container['ssl_version']) && !in_array($this->container['ssl_version'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ssl_version', must be one of '%s'", + $this->container['ssl_version'], + 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 accepts_expired_certificate + * + * @return bool|null + */ + public function getAcceptsExpiredCertificate() + { + return $this->container['accepts_expired_certificate']; + } + + /** + * Sets accepts_expired_certificate + * + * @param bool|null $accepts_expired_certificate Indicates if expired SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsExpiredCertificate($accepts_expired_certificate) + { + if (is_null($accepts_expired_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_expired_certificate cannot be null'); + } + $this->container['accepts_expired_certificate'] = $accepts_expired_certificate; + + return $this; + } + + /** + * Gets accepts_self_signed_certificate + * + * @return bool|null + */ + public function getAcceptsSelfSignedCertificate() + { + return $this->container['accepts_self_signed_certificate']; + } + + /** + * Sets accepts_self_signed_certificate + * + * @param bool|null $accepts_self_signed_certificate Indicates if self-signed SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsSelfSignedCertificate($accepts_self_signed_certificate) + { + if (is_null($accepts_self_signed_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_self_signed_certificate cannot be null'); + } + $this->container['accepts_self_signed_certificate'] = $accepts_self_signed_certificate; + + return $this; + } + + /** + * Gets accepts_untrusted_root_certificate + * + * @return bool|null + */ + public function getAcceptsUntrustedRootCertificate() + { + return $this->container['accepts_untrusted_root_certificate']; + } + + /** + * Sets accepts_untrusted_root_certificate + * + * @param bool|null $accepts_untrusted_root_certificate Indicates if untrusted SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsUntrustedRootCertificate($accepts_untrusted_root_certificate) + { + if (is_null($accepts_untrusted_root_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_untrusted_root_certificate cannot be null'); + } + $this->container['accepts_untrusted_root_certificate'] = $accepts_untrusted_root_certificate; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets additional_settings + * + * @return \Adyen\Model\Management\AdditionalSettings|null + */ + public function getAdditionalSettings() + { + return $this->container['additional_settings']; + } + + /** + * Sets additional_settings + * + * @param \Adyen\Model\Management\AdditionalSettings|null $additional_settings additional_settings + * + * @return self + */ + public function setAdditionalSettings($additional_settings) + { + if (is_null($additional_settings)) { + throw new \InvalidArgumentException('non-nullable additional_settings cannot be null'); + } + $this->container['additional_settings'] = $additional_settings; + + return $this; + } + + /** + * Gets communication_format + * + * @return string|null + */ + public function getCommunicationFormat() + { + return $this->container['communication_format']; + } + + /** + * Sets communication_format + * + * @param string|null $communication_format Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + * + * @return self + */ + public function setCommunicationFormat($communication_format) + { + if (is_null($communication_format)) { + throw new \InvalidArgumentException('non-nullable communication_format cannot be null'); + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!in_array($communication_format, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'communication_format', must be one of '%s'", + $communication_format, + implode("', '", $allowedValues) + ) + ); + } + $this->container['communication_format'] = $communication_format; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for this webhook configuration. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets network_type + * + * @return string|null + */ + public function getNetworkType() + { + return $this->container['network_type']; + } + + /** + * Sets network_type + * + * @param string|null $network_type Network type for Terminal API notification webhooks. Possible values: * **public** * **local** Default Value: **public**. + * + * @return self + */ + public function setNetworkType($network_type) + { + if (is_null($network_type)) { + throw new \InvalidArgumentException('non-nullable network_type cannot be null'); + } + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!in_array($network_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'network_type', must be one of '%s'", + $network_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['network_type'] = $network_type; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password Password to access the webhook URL. + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets populate_soap_action_header + * + * @return bool|null + */ + public function getPopulateSoapActionHeader() + { + return $this->container['populate_soap_action_header']; + } + + /** + * Sets populate_soap_action_header + * + * @param bool|null $populate_soap_action_header Indicates if the SOAP action header needs to be populated. Default value: **false**. Only applies if `communicationFormat`: **soap**. + * + * @return self + */ + public function setPopulateSoapActionHeader($populate_soap_action_header) + { + if (is_null($populate_soap_action_header)) { + throw new \InvalidArgumentException('non-nullable populate_soap_action_header cannot be null'); + } + $this->container['populate_soap_action_header'] = $populate_soap_action_header; + + return $this; + } + + /** + * Gets ssl_version + * + * @return string|null + */ + public function getSslVersion() + { + return $this->container['ssl_version']; + } + + /** + * Sets ssl_version + * + * @param string|null $ssl_version SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. + * + * @return self + */ + public function setSslVersion($ssl_version) + { + if (is_null($ssl_version)) { + throw new \InvalidArgumentException('non-nullable ssl_version cannot be null'); + } + $allowedValues = $this->getSslVersionAllowableValues(); + if (!in_array($ssl_version, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ssl_version', must be one of '%s'", + $ssl_version, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ssl_version'] = $ssl_version; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username Username to access the webhook URL. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php new file mode 100644 index 000000000..944aa7b77 --- /dev/null +++ b/src/Adyen/Model/Management/UpdatePaymentMethodInfo.php @@ -0,0 +1,555 @@ + + */ +class UpdatePaymentMethodInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdatePaymentMethodInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'countries' => 'string[]', + 'currencies' => 'string[]', + 'custom_routing_flags' => 'string[]', + 'enabled' => 'bool', + 'shopper_statement' => '\Adyen\Model\Management\ShopperStatement', + 'store_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'countries' => null, + 'currencies' => null, + 'custom_routing_flags' => null, + 'enabled' => null, + 'shopper_statement' => null, + 'store_ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'countries' => false, + 'currencies' => false, + 'custom_routing_flags' => false, + 'enabled' => false, + 'shopper_statement' => false, + 'store_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'countries' => 'countries', + 'currencies' => 'currencies', + 'custom_routing_flags' => 'customRoutingFlags', + 'enabled' => 'enabled', + 'shopper_statement' => 'shopperStatement', + 'store_ids' => 'storeIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'countries' => 'setCountries', + 'currencies' => 'setCurrencies', + 'custom_routing_flags' => 'setCustomRoutingFlags', + 'enabled' => 'setEnabled', + 'shopper_statement' => 'setShopperStatement', + 'store_ids' => 'setStoreIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'countries' => 'getCountries', + 'currencies' => 'getCurrencies', + 'custom_routing_flags' => 'getCustomRoutingFlags', + 'enabled' => 'getEnabled', + 'shopper_statement' => 'getShopperStatement', + 'store_ids' => 'getStoreIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('countries', $data ?? [], null); + $this->setIfExists('currencies', $data ?? [], null); + $this->setIfExists('custom_routing_flags', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('shopper_statement', $data ?? [], null); + $this->setIfExists('store_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets countries + * + * @return string[]|null + */ + public function getCountries() + { + return $this->container['countries']; + } + + /** + * Sets countries + * + * @param string[]|null $countries The list of countries where a payment method is available. By default, all countries supported by the payment method. + * + * @return self + */ + public function setCountries($countries) + { + if (is_null($countries)) { + throw new \InvalidArgumentException('non-nullable countries cannot be null'); + } + $this->container['countries'] = $countries; + + return $this; + } + + /** + * Gets currencies + * + * @return string[]|null + */ + public function getCurrencies() + { + return $this->container['currencies']; + } + + /** + * Sets currencies + * + * @param string[]|null $currencies The list of currencies that a payment method supports. By default, all currencies supported by the payment method. + * + * @return self + */ + public function setCurrencies($currencies) + { + if (is_null($currencies)) { + throw new \InvalidArgumentException('non-nullable currencies cannot be null'); + } + $this->container['currencies'] = $currencies; + + return $this; + } + + /** + * Gets custom_routing_flags + * + * @return string[]|null + */ + public function getCustomRoutingFlags() + { + return $this->container['custom_routing_flags']; + } + + /** + * Sets custom_routing_flags + * + * @param string[]|null $custom_routing_flags Custom routing flags for acquirer routing. + * + * @return self + */ + public function setCustomRoutingFlags($custom_routing_flags) + { + if (is_null($custom_routing_flags)) { + throw new \InvalidArgumentException('non-nullable custom_routing_flags cannot be null'); + } + $this->container['custom_routing_flags'] = $custom_routing_flags; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates whether the payment method is enabled (**true**) or disabled (**false**). + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets shopper_statement + * + * @return \Adyen\Model\Management\ShopperStatement|null + */ + public function getShopperStatement() + { + return $this->container['shopper_statement']; + } + + /** + * Sets shopper_statement + * + * @param \Adyen\Model\Management\ShopperStatement|null $shopper_statement shopper_statement + * + * @return self + */ + public function setShopperStatement($shopper_statement) + { + if (is_null($shopper_statement)) { + throw new \InvalidArgumentException('non-nullable shopper_statement cannot be null'); + } + $this->container['shopper_statement'] = $shopper_statement; + + return $this; + } + + /** + * Gets store_ids + * + * @return string[]|null + */ + public function getStoreIds() + { + return $this->container['store_ids']; + } + + /** + * Sets store_ids + * + * @param string[]|null $store_ids The list of stores for this payment method + * + * @return self + */ + public function setStoreIds($store_ids) + { + if (is_null($store_ids)) { + throw new \InvalidArgumentException('non-nullable store_ids cannot be null'); + } + $this->container['store_ids'] = $store_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdatePayoutSettingsRequest.php b/src/Adyen/Model/Management/UpdatePayoutSettingsRequest.php new file mode 100644 index 000000000..2291e855c --- /dev/null +++ b/src/Adyen/Model/Management/UpdatePayoutSettingsRequest.php @@ -0,0 +1,385 @@ + + */ +class UpdatePayoutSettingsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdatePayoutSettingsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'enabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Indicates if payouts to this bank account are enabled. Default: **true**. To receive payouts into this bank account, both `enabled` and `allowed` must be **true**. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/UpdateStoreRequest.php b/src/Adyen/Model/Management/UpdateStoreRequest.php new file mode 100644 index 000000000..a82f151b6 --- /dev/null +++ b/src/Adyen/Model/Management/UpdateStoreRequest.php @@ -0,0 +1,590 @@ + + */ +class UpdateStoreRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateStoreRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\Management\UpdatableAddress', + 'business_line_ids' => 'string[]', + 'description' => 'string', + 'external_reference_id' => 'string', + 'split_configuration' => '\Adyen\Model\Management\StoreSplitConfiguration', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'business_line_ids' => null, + 'description' => null, + 'external_reference_id' => null, + 'split_configuration' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'business_line_ids' => false, + 'description' => false, + 'external_reference_id' => false, + 'split_configuration' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'business_line_ids' => 'businessLineIds', + 'description' => 'description', + 'external_reference_id' => 'externalReferenceId', + 'split_configuration' => 'splitConfiguration', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'business_line_ids' => 'setBusinessLineIds', + 'description' => 'setDescription', + 'external_reference_id' => 'setExternalReferenceId', + 'split_configuration' => 'setSplitConfiguration', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'business_line_ids' => 'getBusinessLineIds', + 'description' => 'getDescription', + 'external_reference_id' => 'getExternalReferenceId', + 'split_configuration' => 'getSplitConfiguration', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_CLOSED, + self::STATUS_INACTIVE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('business_line_ids', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('external_reference_id', $data ?? [], null); + $this->setIfExists('split_configuration', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\Management\UpdatableAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\Management\UpdatableAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets business_line_ids + * + * @return string[]|null + */ + public function getBusinessLineIds() + { + return $this->container['business_line_ids']; + } + + /** + * Sets business_line_ids + * + * @param string[]|null $business_line_ids The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. + * + * @return self + */ + public function setBusinessLineIds($business_line_ids) + { + if (is_null($business_line_ids)) { + throw new \InvalidArgumentException('non-nullable business_line_ids cannot be null'); + } + $this->container['business_line_ids'] = $business_line_ids; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the store. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets external_reference_id + * + * @return string|null + */ + public function getExternalReferenceId() + { + return $this->container['external_reference_id']; + } + + /** + * Sets external_reference_id + * + * @param string|null $external_reference_id When using the Zip payment method: The location ID that Zip has assigned to your store. + * + * @return self + */ + public function setExternalReferenceId($external_reference_id) + { + if (is_null($external_reference_id)) { + throw new \InvalidArgumentException('non-nullable external_reference_id cannot be null'); + } + $this->container['external_reference_id'] = $external_reference_id; + + return $this; + } + + /** + * Gets split_configuration + * + * @return \Adyen\Model\Management\StoreSplitConfiguration|null + */ + public function getSplitConfiguration() + { + return $this->container['split_configuration']; + } + + /** + * Sets split_configuration + * + * @param \Adyen\Model\Management\StoreSplitConfiguration|null $split_configuration split_configuration + * + * @return self + */ + public function setSplitConfiguration($split_configuration) + { + if (is_null($split_configuration)) { + throw new \InvalidArgumentException('non-nullable split_configuration cannot be null'); + } + $this->container['split_configuration'] = $split_configuration; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the store. Possible values are: - **active**: This value is assigned automatically when a store is created. - **inactive**: The maximum [transaction limits and number of Store-and-Forward transactions](https://docs.adyen.com/point-of-sale/determine-account-structure/configure-features#payment-features) for the store are set to 0. This blocks new transactions, but captures are still possible. - **closed**: The terminals of the store are reassigned to the merchant inventory, so they can't process payments. You can change the status from **active** to **inactive**, and from **inactive** to **active** or **closed**. Once **closed**, a store can't be reopened. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Url.php b/src/Adyen/Model/Management/Url.php new file mode 100644 index 000000000..c9dbaa290 --- /dev/null +++ b/src/Adyen/Model/Management/Url.php @@ -0,0 +1,487 @@ + + */ +class Url implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Url'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'encrypted' => 'bool', + 'password' => 'string', + 'url' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'encrypted' => null, + 'password' => null, + 'url' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'encrypted' => false, + 'password' => false, + 'url' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'encrypted' => 'encrypted', + 'password' => 'password', + 'url' => 'url', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'encrypted' => 'setEncrypted', + 'password' => 'setPassword', + 'url' => 'setUrl', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'encrypted' => 'getEncrypted', + 'password' => 'getPassword', + 'url' => 'getUrl', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('encrypted', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets encrypted + * + * @return bool|null + */ + public function getEncrypted() + { + return $this->container['encrypted']; + } + + /** + * Sets encrypted + * + * @param bool|null $encrypted Indicates if the message sent to this URL should be encrypted. + * + * @return self + */ + public function setEncrypted($encrypted) + { + if (is_null($encrypted)) { + throw new \InvalidArgumentException('non-nullable encrypted cannot be null'); + } + $this->container['encrypted'] = $encrypted; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password The password for authentication of the notifications. + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL in the format: http(s)://domain.com. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username The username for authentication of the notifications. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/User.php b/src/Adyen/Model/Management/User.php new file mode 100644 index 000000000..928929509 --- /dev/null +++ b/src/Adyen/Model/Management/User.php @@ -0,0 +1,706 @@ + + */ +class User implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'User'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\Links', + 'account_groups' => 'string[]', + 'active' => 'bool', + 'authn_apps' => 'string[]', + 'email' => 'string', + 'id' => 'string', + 'name' => '\Adyen\Model\Management\Name', + 'roles' => 'string[]', + 'time_zone_code' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'account_groups' => null, + 'active' => null, + 'authn_apps' => null, + 'email' => null, + 'id' => null, + 'name' => null, + 'roles' => null, + 'time_zone_code' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'account_groups' => false, + 'active' => false, + 'authn_apps' => false, + 'email' => false, + 'id' => false, + 'name' => false, + 'roles' => false, + 'time_zone_code' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'account_groups' => 'accountGroups', + 'active' => 'active', + 'authn_apps' => 'authnApps', + 'email' => 'email', + 'id' => 'id', + 'name' => 'name', + 'roles' => 'roles', + 'time_zone_code' => 'timeZoneCode', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'account_groups' => 'setAccountGroups', + 'active' => 'setActive', + 'authn_apps' => 'setAuthnApps', + 'email' => 'setEmail', + 'id' => 'setId', + 'name' => 'setName', + 'roles' => 'setRoles', + 'time_zone_code' => 'setTimeZoneCode', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'account_groups' => 'getAccountGroups', + 'active' => 'getActive', + 'authn_apps' => 'getAuthnApps', + 'email' => 'getEmail', + 'id' => 'getId', + 'name' => 'getName', + 'roles' => 'getRoles', + 'time_zone_code' => 'getTimeZoneCode', + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('account_groups', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('authn_apps', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('time_zone_code', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['time_zone_code'] === null) { + $invalidProperties[] = "'time_zone_code' can't be null"; + } + if ($this->container['username'] === null) { + $invalidProperties[] = "'username' 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 _links + * + * @return \Adyen\Model\Management\Links|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\Links|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets account_groups + * + * @return string[]|null + */ + public function getAccountGroups() + { + return $this->container['account_groups']; + } + + /** + * Sets account_groups + * + * @param string[]|null $account_groups The list of [account groups](https://docs.adyen.com/account/account-structure#account-groups) associated with this user. + * + * @return self + */ + public function setAccountGroups($account_groups) + { + if (is_null($account_groups)) { + throw new \InvalidArgumentException('non-nullable account_groups cannot be null'); + } + $this->container['account_groups'] = $account_groups; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Indicates whether this user is active. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets authn_apps + * + * @return string[]|null + */ + public function getAuthnApps() + { + return $this->container['authn_apps']; + } + + /** + * Sets authn_apps + * + * @param string[]|null $authn_apps Set of authn apps available to this user + * + * @return self + */ + public function setAuthnApps($authn_apps) + { + if (is_null($authn_apps)) { + throw new \InvalidArgumentException('non-nullable authn_apps cannot be null'); + } + $this->container['authn_apps'] = $authn_apps; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email address of the user. + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the user. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return \Adyen\Model\Management\Name|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param \Adyen\Model\Management\Name|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles The list of [roles](https://docs.adyen.com/account/user-roles) for this user. + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets time_zone_code + * + * @return string + */ + public function getTimeZoneCode() + { + return $this->container['time_zone_code']; + } + + /** + * Sets time_zone_code + * + * @param string $time_zone_code The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. + * + * @return self + */ + public function setTimeZoneCode($time_zone_code) + { + if (is_null($time_zone_code)) { + throw new \InvalidArgumentException('non-nullable time_zone_code cannot be null'); + } + $this->container['time_zone_code'] = $time_zone_code; + + return $this; + } + + /** + * Gets username + * + * @return string + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string $username The username for this user. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/VippsInfo.php b/src/Adyen/Model/Management/VippsInfo.php new file mode 100644 index 000000000..28053f1cb --- /dev/null +++ b/src/Adyen/Model/Management/VippsInfo.php @@ -0,0 +1,422 @@ + + */ +class VippsInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VippsInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'logo' => 'string', + 'subscription_cancel_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'logo' => null, + 'subscription_cancel_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'logo' => false, + 'subscription_cancel_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'logo' => 'logo', + 'subscription_cancel_url' => 'subscriptionCancelUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'logo' => 'setLogo', + 'subscription_cancel_url' => 'setSubscriptionCancelUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'logo' => 'getLogo', + 'subscription_cancel_url' => 'getSubscriptionCancelUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('logo', $data ?? [], null); + $this->setIfExists('subscription_cancel_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['logo'] === null) { + $invalidProperties[] = "'logo' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets logo + * + * @return string + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string $logo Vipps logo. Format: Base64-encoded string. + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + + /** + * Gets subscription_cancel_url + * + * @return string|null + */ + public function getSubscriptionCancelUrl() + { + return $this->container['subscription_cancel_url']; + } + + /** + * Sets subscription_cancel_url + * + * @param string|null $subscription_cancel_url Vipps subscription cancel url + * + * @return self + */ + public function setSubscriptionCancelUrl($subscription_cancel_url) + { + if (is_null($subscription_cancel_url)) { + throw new \InvalidArgumentException('non-nullable subscription_cancel_url cannot be null'); + } + $this->container['subscription_cancel_url'] = $subscription_cancel_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/Webhook.php b/src/Adyen/Model/Management/Webhook.php new file mode 100644 index 000000000..3a99c36c1 --- /dev/null +++ b/src/Adyen/Model/Management/Webhook.php @@ -0,0 +1,1259 @@ + + */ +class Webhook implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Webhook'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '_links' => '\Adyen\Model\Management\WebhookLinks', + 'accepts_expired_certificate' => 'bool', + 'accepts_self_signed_certificate' => 'bool', + 'accepts_untrusted_root_certificate' => 'bool', + 'account_reference' => 'string', + 'active' => 'bool', + 'additional_settings' => '\Adyen\Model\Management\AdditionalSettingsResponse', + 'certificate_alias' => 'string', + 'communication_format' => 'string', + 'description' => 'string', + 'filter_merchant_account_type' => 'string', + 'filter_merchant_accounts' => 'string[]', + 'has_error' => 'bool', + 'has_password' => 'bool', + 'hmac_key_check_value' => 'string', + 'id' => 'string', + 'network_type' => 'string', + 'populate_soap_action_header' => 'bool', + 'ssl_version' => 'string', + 'type' => 'string', + 'url' => 'string', + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_links' => null, + 'accepts_expired_certificate' => null, + 'accepts_self_signed_certificate' => null, + 'accepts_untrusted_root_certificate' => null, + 'account_reference' => null, + 'active' => null, + 'additional_settings' => null, + 'certificate_alias' => null, + 'communication_format' => null, + 'description' => null, + 'filter_merchant_account_type' => null, + 'filter_merchant_accounts' => null, + 'has_error' => null, + 'has_password' => null, + 'hmac_key_check_value' => null, + 'id' => null, + 'network_type' => null, + 'populate_soap_action_header' => null, + 'ssl_version' => null, + 'type' => null, + 'url' => null, + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '_links' => false, + 'accepts_expired_certificate' => false, + 'accepts_self_signed_certificate' => false, + 'accepts_untrusted_root_certificate' => false, + 'account_reference' => false, + 'active' => false, + 'additional_settings' => false, + 'certificate_alias' => false, + 'communication_format' => false, + 'description' => false, + 'filter_merchant_account_type' => false, + 'filter_merchant_accounts' => false, + 'has_error' => false, + 'has_password' => false, + 'hmac_key_check_value' => false, + 'id' => false, + 'network_type' => false, + 'populate_soap_action_header' => false, + 'ssl_version' => false, + 'type' => false, + 'url' => false, + 'username' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_links' => '_links', + 'accepts_expired_certificate' => 'acceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'acceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'acceptsUntrustedRootCertificate', + 'account_reference' => 'accountReference', + 'active' => 'active', + 'additional_settings' => 'additionalSettings', + 'certificate_alias' => 'certificateAlias', + 'communication_format' => 'communicationFormat', + 'description' => 'description', + 'filter_merchant_account_type' => 'filterMerchantAccountType', + 'filter_merchant_accounts' => 'filterMerchantAccounts', + 'has_error' => 'hasError', + 'has_password' => 'hasPassword', + 'hmac_key_check_value' => 'hmacKeyCheckValue', + 'id' => 'id', + 'network_type' => 'networkType', + 'populate_soap_action_header' => 'populateSoapActionHeader', + 'ssl_version' => 'sslVersion', + 'type' => 'type', + 'url' => 'url', + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_links' => 'setLinks', + 'accepts_expired_certificate' => 'setAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'setAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'setAcceptsUntrustedRootCertificate', + 'account_reference' => 'setAccountReference', + 'active' => 'setActive', + 'additional_settings' => 'setAdditionalSettings', + 'certificate_alias' => 'setCertificateAlias', + 'communication_format' => 'setCommunicationFormat', + 'description' => 'setDescription', + 'filter_merchant_account_type' => 'setFilterMerchantAccountType', + 'filter_merchant_accounts' => 'setFilterMerchantAccounts', + 'has_error' => 'setHasError', + 'has_password' => 'setHasPassword', + 'hmac_key_check_value' => 'setHmacKeyCheckValue', + 'id' => 'setId', + 'network_type' => 'setNetworkType', + 'populate_soap_action_header' => 'setPopulateSoapActionHeader', + 'ssl_version' => 'setSslVersion', + 'type' => 'setType', + 'url' => 'setUrl', + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_links' => 'getLinks', + 'accepts_expired_certificate' => 'getAcceptsExpiredCertificate', + 'accepts_self_signed_certificate' => 'getAcceptsSelfSignedCertificate', + 'accepts_untrusted_root_certificate' => 'getAcceptsUntrustedRootCertificate', + 'account_reference' => 'getAccountReference', + 'active' => 'getActive', + 'additional_settings' => 'getAdditionalSettings', + 'certificate_alias' => 'getCertificateAlias', + 'communication_format' => 'getCommunicationFormat', + 'description' => 'getDescription', + 'filter_merchant_account_type' => 'getFilterMerchantAccountType', + 'filter_merchant_accounts' => 'getFilterMerchantAccounts', + 'has_error' => 'getHasError', + 'has_password' => 'getHasPassword', + 'hmac_key_check_value' => 'getHmacKeyCheckValue', + 'id' => 'getId', + 'network_type' => 'getNetworkType', + 'populate_soap_action_header' => 'getPopulateSoapActionHeader', + 'ssl_version' => 'getSslVersion', + 'type' => 'getType', + 'url' => 'getUrl', + 'username' => 'getUsername' + ]; + + /** + * 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 COMMUNICATION_FORMAT_HTTP = 'http'; + public const COMMUNICATION_FORMAT_JSON = 'json'; + public const COMMUNICATION_FORMAT_SOAP = 'soap'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS = 'allAccounts'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS = 'excludeAccounts'; + public const FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS = 'includeAccounts'; + public const NETWORK_TYPE_LOCAL = 'LOCAL'; + public const NETWORK_TYPE__PUBLIC = 'PUBLIC'; + public const SSL_VERSION_HTTP = 'HTTP'; + public const SSL_VERSION_SSL = 'SSL'; + public const SSL_VERSION_SSLV3 = 'SSLv3'; + public const SSL_VERSION_TLS = 'TLS'; + public const SSL_VERSION_TLSV1 = 'TLSv1'; + public const SSL_VERSION_TLSV1_1 = 'TLSv1.1'; + public const SSL_VERSION_TLSV1_2 = 'TLSv1.2'; + public const SSL_VERSION_TLSV1_3 = 'TLSv1.3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCommunicationFormatAllowableValues() + { + return [ + self::COMMUNICATION_FORMAT_HTTP, + self::COMMUNICATION_FORMAT_JSON, + self::COMMUNICATION_FORMAT_SOAP, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFilterMerchantAccountTypeAllowableValues() + { + return [ + self::FILTER_MERCHANT_ACCOUNT_TYPE_ALL_ACCOUNTS, + self::FILTER_MERCHANT_ACCOUNT_TYPE_EXCLUDE_ACCOUNTS, + self::FILTER_MERCHANT_ACCOUNT_TYPE_INCLUDE_ACCOUNTS, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNetworkTypeAllowableValues() + { + return [ + self::NETWORK_TYPE_LOCAL, + self::NETWORK_TYPE__PUBLIC, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSslVersionAllowableValues() + { + return [ + self::SSL_VERSION_HTTP, + self::SSL_VERSION_SSL, + self::SSL_VERSION_SSLV3, + self::SSL_VERSION_TLS, + self::SSL_VERSION_TLSV1, + self::SSL_VERSION_TLSV1_1, + self::SSL_VERSION_TLSV1_2, + self::SSL_VERSION_TLSV1_3, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('_links', $data ?? [], null); + $this->setIfExists('accepts_expired_certificate', $data ?? [], null); + $this->setIfExists('accepts_self_signed_certificate', $data ?? [], null); + $this->setIfExists('accepts_untrusted_root_certificate', $data ?? [], null); + $this->setIfExists('account_reference', $data ?? [], null); + $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('additional_settings', $data ?? [], null); + $this->setIfExists('certificate_alias', $data ?? [], null); + $this->setIfExists('communication_format', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('filter_merchant_account_type', $data ?? [], null); + $this->setIfExists('filter_merchant_accounts', $data ?? [], null); + $this->setIfExists('has_error', $data ?? [], null); + $this->setIfExists('has_password', $data ?? [], null); + $this->setIfExists('hmac_key_check_value', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('network_type', $data ?? [], null); + $this->setIfExists('populate_soap_action_header', $data ?? [], null); + $this->setIfExists('ssl_version', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['communication_format'] === null) { + $invalidProperties[] = "'communication_format' can't be null"; + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!is_null($this->container['communication_format']) && !in_array($this->container['communication_format'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'communication_format', must be one of '%s'", + $this->container['communication_format'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); + if (!is_null($this->container['filter_merchant_account_type']) && !in_array($this->container['filter_merchant_account_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'filter_merchant_account_type', must be one of '%s'", + $this->container['filter_merchant_account_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!is_null($this->container['network_type']) && !in_array($this->container['network_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'network_type', must be one of '%s'", + $this->container['network_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSslVersionAllowableValues(); + if (!is_null($this->container['ssl_version']) && !in_array($this->container['ssl_version'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'ssl_version', must be one of '%s'", + $this->container['ssl_version'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' 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 _links + * + * @return \Adyen\Model\Management\WebhookLinks|null + */ + public function getLinks() + { + return $this->container['_links']; + } + + /** + * Sets _links + * + * @param \Adyen\Model\Management\WebhookLinks|null $_links _links + * + * @return self + */ + public function setLinks($_links) + { + if (is_null($_links)) { + throw new \InvalidArgumentException('non-nullable _links cannot be null'); + } + $this->container['_links'] = $_links; + + return $this; + } + + /** + * Gets accepts_expired_certificate + * + * @return bool|null + */ + public function getAcceptsExpiredCertificate() + { + return $this->container['accepts_expired_certificate']; + } + + /** + * Sets accepts_expired_certificate + * + * @param bool|null $accepts_expired_certificate Indicates if expired SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsExpiredCertificate($accepts_expired_certificate) + { + if (is_null($accepts_expired_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_expired_certificate cannot be null'); + } + $this->container['accepts_expired_certificate'] = $accepts_expired_certificate; + + return $this; + } + + /** + * Gets accepts_self_signed_certificate + * + * @return bool|null + */ + public function getAcceptsSelfSignedCertificate() + { + return $this->container['accepts_self_signed_certificate']; + } + + /** + * Sets accepts_self_signed_certificate + * + * @param bool|null $accepts_self_signed_certificate Indicates if self-signed SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsSelfSignedCertificate($accepts_self_signed_certificate) + { + if (is_null($accepts_self_signed_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_self_signed_certificate cannot be null'); + } + $this->container['accepts_self_signed_certificate'] = $accepts_self_signed_certificate; + + return $this; + } + + /** + * Gets accepts_untrusted_root_certificate + * + * @return bool|null + */ + public function getAcceptsUntrustedRootCertificate() + { + return $this->container['accepts_untrusted_root_certificate']; + } + + /** + * Sets accepts_untrusted_root_certificate + * + * @param bool|null $accepts_untrusted_root_certificate Indicates if untrusted SSL certificates are accepted. Default value: **false**. + * + * @return self + */ + public function setAcceptsUntrustedRootCertificate($accepts_untrusted_root_certificate) + { + if (is_null($accepts_untrusted_root_certificate)) { + throw new \InvalidArgumentException('non-nullable accepts_untrusted_root_certificate cannot be null'); + } + $this->container['accepts_untrusted_root_certificate'] = $accepts_untrusted_root_certificate; + + return $this; + } + + /** + * Gets account_reference + * + * @return string|null + */ + public function getAccountReference() + { + return $this->container['account_reference']; + } + + /** + * Sets account_reference + * + * @param string|null $account_reference Reference to the account the webook is set on. + * + * @return self + */ + public function setAccountReference($account_reference) + { + if (is_null($account_reference)) { + throw new \InvalidArgumentException('non-nullable account_reference cannot be null'); + } + $this->container['account_reference'] = $account_reference; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Indicates if the webhook configuration is active. The field must be **true** for you to receive webhooks about events related an account. + * + * @return self + */ + public function setActive($active) + { + if (is_null($active)) { + throw new \InvalidArgumentException('non-nullable active cannot be null'); + } + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets additional_settings + * + * @return \Adyen\Model\Management\AdditionalSettingsResponse|null + */ + public function getAdditionalSettings() + { + return $this->container['additional_settings']; + } + + /** + * Sets additional_settings + * + * @param \Adyen\Model\Management\AdditionalSettingsResponse|null $additional_settings additional_settings + * + * @return self + */ + public function setAdditionalSettings($additional_settings) + { + if (is_null($additional_settings)) { + throw new \InvalidArgumentException('non-nullable additional_settings cannot be null'); + } + $this->container['additional_settings'] = $additional_settings; + + return $this; + } + + /** + * Gets certificate_alias + * + * @return string|null + */ + public function getCertificateAlias() + { + return $this->container['certificate_alias']; + } + + /** + * Sets certificate_alias + * + * @param string|null $certificate_alias The alias of our SSL certificate. When you receive a notification from us, the alias from the HMAC signature will match this alias. + * + * @return self + */ + public function setCertificateAlias($certificate_alias) + { + if (is_null($certificate_alias)) { + throw new \InvalidArgumentException('non-nullable certificate_alias cannot be null'); + } + $this->container['certificate_alias'] = $certificate_alias; + + return $this; + } + + /** + * Gets communication_format + * + * @return string + */ + public function getCommunicationFormat() + { + return $this->container['communication_format']; + } + + /** + * Sets communication_format + * + * @param string $communication_format Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + * + * @return self + */ + public function setCommunicationFormat($communication_format) + { + if (is_null($communication_format)) { + throw new \InvalidArgumentException('non-nullable communication_format cannot be null'); + } + $allowedValues = $this->getCommunicationFormatAllowableValues(); + if (!in_array($communication_format, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'communication_format', must be one of '%s'", + $communication_format, + implode("', '", $allowedValues) + ) + ); + } + $this->container['communication_format'] = $communication_format; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for this webhook configuration. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets filter_merchant_account_type + * + * @return string|null + */ + public function getFilterMerchantAccountType() + { + return $this->container['filter_merchant_account_type']; + } + + /** + * Sets filter_merchant_account_type + * + * @param string|null $filter_merchant_account_type Shows how merchant accounts are included in company-level webhooks. Possible values: * **includeAccounts** * **excludeAccounts** * **allAccounts**: Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. + * + * @return self + */ + public function setFilterMerchantAccountType($filter_merchant_account_type) + { + if (is_null($filter_merchant_account_type)) { + throw new \InvalidArgumentException('non-nullable filter_merchant_account_type cannot be null'); + } + $allowedValues = $this->getFilterMerchantAccountTypeAllowableValues(); + if (!in_array($filter_merchant_account_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_merchant_account_type', must be one of '%s'", + $filter_merchant_account_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_merchant_account_type'] = $filter_merchant_account_type; + + return $this; + } + + /** + * Gets filter_merchant_accounts + * + * @return string[]|null + */ + public function getFilterMerchantAccounts() + { + return $this->container['filter_merchant_accounts']; + } + + /** + * Sets filter_merchant_accounts + * + * @param string[]|null $filter_merchant_accounts A list of merchant account names that are included or excluded from receiving the webhook. Inclusion or exclusion is based on the value defined for `filterMerchantAccountType`. Required if `filterMerchantAccountType` is either: * **includeAccounts** * **excludeAccounts** Not needed for `filterMerchantAccountType`: **allAccounts**. + * + * @return self + */ + public function setFilterMerchantAccounts($filter_merchant_accounts) + { + if (is_null($filter_merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable filter_merchant_accounts cannot be null'); + } + $this->container['filter_merchant_accounts'] = $filter_merchant_accounts; + + return $this; + } + + /** + * Gets has_error + * + * @return bool|null + */ + public function getHasError() + { + return $this->container['has_error']; + } + + /** + * Sets has_error + * + * @param bool|null $has_error Indicates if the webhook configuration has errors that need troubleshooting. If the value is **true**, troubleshoot the configuration using the [testing endpoint](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookid}/test). + * + * @return self + */ + public function setHasError($has_error) + { + if (is_null($has_error)) { + throw new \InvalidArgumentException('non-nullable has_error cannot be null'); + } + $this->container['has_error'] = $has_error; + + return $this; + } + + /** + * Gets has_password + * + * @return bool|null + */ + public function getHasPassword() + { + return $this->container['has_password']; + } + + /** + * Sets has_password + * + * @param bool|null $has_password Indicates if the webhook is password protected. + * + * @return self + */ + public function setHasPassword($has_password) + { + if (is_null($has_password)) { + throw new \InvalidArgumentException('non-nullable has_password cannot be null'); + } + $this->container['has_password'] = $has_password; + + return $this; + } + + /** + * Gets hmac_key_check_value + * + * @return string|null + */ + public function getHmacKeyCheckValue() + { + return $this->container['hmac_key_check_value']; + } + + /** + * Sets hmac_key_check_value + * + * @param string|null $hmac_key_check_value The [checksum](https://en.wikipedia.org/wiki/Key_checksum_value) of the HMAC key generated for this webhook. You can use this value to uniquely identify the HMAC key configured for this webhook. + * + * @return self + */ + public function setHmacKeyCheckValue($hmac_key_check_value) + { + if (is_null($hmac_key_check_value)) { + throw new \InvalidArgumentException('non-nullable hmac_key_check_value cannot be null'); + } + $this->container['hmac_key_check_value'] = $hmac_key_check_value; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Unique identifier for this webhook. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets network_type + * + * @return string|null + */ + public function getNetworkType() + { + return $this->container['network_type']; + } + + /** + * Sets network_type + * + * @param string|null $network_type Network type for Terminal API details webhooks. + * + * @return self + */ + public function setNetworkType($network_type) + { + if (is_null($network_type)) { + throw new \InvalidArgumentException('non-nullable network_type cannot be null'); + } + $allowedValues = $this->getNetworkTypeAllowableValues(); + if (!in_array($network_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'network_type', must be one of '%s'", + $network_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['network_type'] = $network_type; + + return $this; + } + + /** + * Gets populate_soap_action_header + * + * @return bool|null + */ + public function getPopulateSoapActionHeader() + { + return $this->container['populate_soap_action_header']; + } + + /** + * Sets populate_soap_action_header + * + * @param bool|null $populate_soap_action_header Indicates if the SOAP action header needs to be populated. Default value: **false**. Only applies if `communicationFormat`: **soap**. + * + * @return self + */ + public function setPopulateSoapActionHeader($populate_soap_action_header) + { + if (is_null($populate_soap_action_header)) { + throw new \InvalidArgumentException('non-nullable populate_soap_action_header cannot be null'); + } + $this->container['populate_soap_action_header'] = $populate_soap_action_header; + + return $this; + } + + /** + * Gets ssl_version + * + * @return string|null + */ + public function getSslVersion() + { + return $this->container['ssl_version']; + } + + /** + * Sets ssl_version + * + * @param string|null $ssl_version SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. + * + * @return self + */ + public function setSslVersion($ssl_version) + { + if (is_null($ssl_version)) { + throw new \InvalidArgumentException('non-nullable ssl_version cannot be null'); + } + $allowedValues = $this->getSslVersionAllowableValues(); + if (!in_array($ssl_version, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'ssl_version', must be one of '%s'", + $ssl_version, + implode("', '", $allowedValues) + ) + ); + } + $this->container['ssl_version'] = $ssl_version; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of webhook. Possible values are: - **standard** - **account-settings-notification** - **banktransfer-notification** - **boletobancario-notification** - **directdebit-notification** - **pending-notification** - **ideal-notification** - **ideal-pending-notification** - **report-notification** - **terminal-api-notification** Find out more about [standard notification webhooks](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes) and [other types of notifications](https://docs.adyen.com/development-resources/webhooks/understand-notifications#other-notifications). + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username Username to access the webhook URL. + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/WebhookLinks.php b/src/Adyen/Model/Management/WebhookLinks.php new file mode 100644 index 000000000..ba1d341e6 --- /dev/null +++ b/src/Adyen/Model/Management/WebhookLinks.php @@ -0,0 +1,530 @@ + + */ +class WebhookLinks implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WebhookLinks'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company' => '\Adyen\Model\Management\LinksElement', + 'generate_hmac' => '\Adyen\Model\Management\LinksElement', + 'merchant' => '\Adyen\Model\Management\LinksElement', + 'self' => '\Adyen\Model\Management\LinksElement', + 'test_webhook' => '\Adyen\Model\Management\LinksElement' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company' => null, + 'generate_hmac' => null, + 'merchant' => null, + 'self' => null, + 'test_webhook' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'company' => false, + 'generate_hmac' => false, + 'merchant' => false, + 'self' => false, + 'test_webhook' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company' => 'company', + 'generate_hmac' => 'generateHmac', + 'merchant' => 'merchant', + 'self' => 'self', + 'test_webhook' => 'testWebhook' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company' => 'setCompany', + 'generate_hmac' => 'setGenerateHmac', + 'merchant' => 'setMerchant', + 'self' => 'setSelf', + 'test_webhook' => 'setTestWebhook' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company' => 'getCompany', + 'generate_hmac' => 'getGenerateHmac', + 'merchant' => 'getMerchant', + 'self' => 'getSelf', + 'test_webhook' => 'getTestWebhook' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('company', $data ?? [], null); + $this->setIfExists('generate_hmac', $data ?? [], null); + $this->setIfExists('merchant', $data ?? [], null); + $this->setIfExists('self', $data ?? [], null); + $this->setIfExists('test_webhook', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['generate_hmac'] === null) { + $invalidProperties[] = "'generate_hmac' can't be null"; + } + if ($this->container['self'] === null) { + $invalidProperties[] = "'self' can't be null"; + } + if ($this->container['test_webhook'] === null) { + $invalidProperties[] = "'test_webhook' 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 company + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getCompany() + { + return $this->container['company']; + } + + /** + * Sets company + * + * @param \Adyen\Model\Management\LinksElement|null $company company + * + * @return self + */ + public function setCompany($company) + { + if (is_null($company)) { + throw new \InvalidArgumentException('non-nullable company cannot be null'); + } + $this->container['company'] = $company; + + return $this; + } + + /** + * Gets generate_hmac + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getGenerateHmac() + { + return $this->container['generate_hmac']; + } + + /** + * Sets generate_hmac + * + * @param \Adyen\Model\Management\LinksElement $generate_hmac generate_hmac + * + * @return self + */ + public function setGenerateHmac($generate_hmac) + { + if (is_null($generate_hmac)) { + throw new \InvalidArgumentException('non-nullable generate_hmac cannot be null'); + } + $this->container['generate_hmac'] = $generate_hmac; + + return $this; + } + + /** + * Gets merchant + * + * @return \Adyen\Model\Management\LinksElement|null + */ + public function getMerchant() + { + return $this->container['merchant']; + } + + /** + * Sets merchant + * + * @param \Adyen\Model\Management\LinksElement|null $merchant merchant + * + * @return self + */ + public function setMerchant($merchant) + { + if (is_null($merchant)) { + throw new \InvalidArgumentException('non-nullable merchant cannot be null'); + } + $this->container['merchant'] = $merchant; + + return $this; + } + + /** + * Gets self + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getSelf() + { + return $this->container['self']; + } + + /** + * Sets self + * + * @param \Adyen\Model\Management\LinksElement $self self + * + * @return self + */ + public function setSelf($self) + { + if (is_null($self)) { + throw new \InvalidArgumentException('non-nullable self cannot be null'); + } + $this->container['self'] = $self; + + return $this; + } + + /** + * Gets test_webhook + * + * @return \Adyen\Model\Management\LinksElement + */ + public function getTestWebhook() + { + return $this->container['test_webhook']; + } + + /** + * Sets test_webhook + * + * @param \Adyen\Model\Management\LinksElement $test_webhook test_webhook + * + * @return self + */ + public function setTestWebhook($test_webhook) + { + if (is_null($test_webhook)) { + throw new \InvalidArgumentException('non-nullable test_webhook cannot be null'); + } + $this->container['test_webhook'] = $test_webhook; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/Management/WifiProfiles.php b/src/Adyen/Model/Management/WifiProfiles.php new file mode 100644 index 000000000..2924cf07e --- /dev/null +++ b/src/Adyen/Model/Management/WifiProfiles.php @@ -0,0 +1,419 @@ + + */ +class WifiProfiles implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WifiProfiles'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'profiles' => '\Adyen\Model\Management\Profile[]', + 'settings' => '\Adyen\Model\Management\Settings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'profiles' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'profiles' => false, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'profiles' => 'profiles', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'profiles' => 'setProfiles', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'profiles' => 'getProfiles', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('profiles', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets profiles + * + * @return \Adyen\Model\Management\Profile[]|null + */ + public function getProfiles() + { + return $this->container['profiles']; + } + + /** + * Sets profiles + * + * @param \Adyen\Model\Management\Profile[]|null $profiles List of remote Wi-Fi profiles. + * + * @return self + */ + public function setProfiles($profiles) + { + if (is_null($profiles)) { + throw new \InvalidArgumentException('non-nullable profiles cannot be null'); + } + $this->container['profiles'] = $profiles; + + return $this; + } + + /** + * Gets settings + * + * @return \Adyen\Model\Management\Settings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \Adyen\Model\Management\Settings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Service/Management/APICredentialsCompanyLevelApi.php b/src/Adyen/Service/Management/APICredentialsCompanyLevelApi.php new file mode 100644 index 000000000..46b36ed9c --- /dev/null +++ b/src/Adyen/Service/Management/APICredentialsCompanyLevelApi.php @@ -0,0 +1,106 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of API credentials + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListCompanyApiCredentialsResponse + * @throws AdyenException + */ + public function listApiCredentials(string $companyId, array $requestOptions = null): \Adyen\Model\Management\ListCompanyApiCredentialsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/apiCredentials"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListCompanyApiCredentialsResponse::class); + } + + /** + * Get an API credential + * + * @param string $companyId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CompanyApiCredential + * @throws AdyenException + */ + public function getApiCredential(string $companyId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\CompanyApiCredential + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}'], [$companyId, $apiCredentialId], "/companies/{companyId}/apiCredentials/{apiCredentialId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CompanyApiCredential::class); + } + + /** + * Update an API credential. + * + * @param string $companyId + * @param string $apiCredentialId + * @param \Adyen\Model\Management\UpdateCompanyApiCredentialRequest $updateCompanyApiCredentialRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CompanyApiCredential + * @throws AdyenException + */ + public function updateApiCredential(string $companyId, string $apiCredentialId, \Adyen\Model\Management\UpdateCompanyApiCredentialRequest $updateCompanyApiCredentialRequest, array $requestOptions = null): \Adyen\Model\Management\CompanyApiCredential + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}'], [$companyId, $apiCredentialId], "/companies/{companyId}/apiCredentials/{apiCredentialId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateCompanyApiCredentialRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CompanyApiCredential::class); + } + + /** + * Create an API credential. + * + * @param string $companyId + * @param \Adyen\Model\Management\CreateCompanyApiCredentialRequest $createCompanyApiCredentialRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CreateCompanyApiCredentialResponse + * @throws AdyenException + */ + public function createApiCredential(string $companyId, \Adyen\Model\Management\CreateCompanyApiCredentialRequest $createCompanyApiCredentialRequest, array $requestOptions = null): \Adyen\Model\Management\CreateCompanyApiCredentialResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/apiCredentials"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createCompanyApiCredentialRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CreateCompanyApiCredentialResponse::class); + } +} diff --git a/src/Adyen/Service/Management/APICredentialsMerchantLevelApi.php b/src/Adyen/Service/Management/APICredentialsMerchantLevelApi.php new file mode 100644 index 000000000..137bc6001 --- /dev/null +++ b/src/Adyen/Service/Management/APICredentialsMerchantLevelApi.php @@ -0,0 +1,106 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of API credentials + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListMerchantApiCredentialsResponse + * @throws AdyenException + */ + public function listApiCredentials(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\ListMerchantApiCredentialsResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/apiCredentials"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListMerchantApiCredentialsResponse::class); + } + + /** + * Get an API credential + * + * @param string $merchantId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ApiCredential + * @throws AdyenException + */ + public function getApiCredential(string $merchantId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\ApiCredential + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}'], [$merchantId, $apiCredentialId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ApiCredential::class); + } + + /** + * Update an API credential + * + * @param string $merchantId + * @param string $apiCredentialId + * @param \Adyen\Model\Management\UpdateMerchantApiCredentialRequest $updateMerchantApiCredentialRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ApiCredential + * @throws AdyenException + */ + public function updateApiCredential(string $merchantId, string $apiCredentialId, \Adyen\Model\Management\UpdateMerchantApiCredentialRequest $updateMerchantApiCredentialRequest, array $requestOptions = null): \Adyen\Model\Management\ApiCredential + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}'], [$merchantId, $apiCredentialId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateMerchantApiCredentialRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ApiCredential::class); + } + + /** + * Create an API credential + * + * @param string $merchantId + * @param \Adyen\Model\Management\CreateMerchantApiCredentialRequest $createMerchantApiCredentialRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CreateApiCredentialResponse + * @throws AdyenException + */ + public function createApiCredential(string $merchantId, \Adyen\Model\Management\CreateMerchantApiCredentialRequest $createMerchantApiCredentialRequest, array $requestOptions = null): \Adyen\Model\Management\CreateApiCredentialResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/apiCredentials"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createMerchantApiCredentialRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CreateApiCredentialResponse::class); + } +} diff --git a/src/Adyen/Service/Management/APIKeyCompanyLevelApi.php b/src/Adyen/Service/Management/APIKeyCompanyLevelApi.php new file mode 100644 index 000000000..81c826467 --- /dev/null +++ b/src/Adyen/Service/Management/APIKeyCompanyLevelApi.php @@ -0,0 +1,58 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Generate new API key + * + * @param string $companyId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\GenerateApiKeyResponse + * @throws AdyenException + */ + public function generateNewApiKey(string $companyId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\GenerateApiKeyResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}'], [$companyId, $apiCredentialId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\GenerateApiKeyResponse::class); + } +} diff --git a/src/Adyen/Service/Management/APIKeyMerchantLevelApi.php b/src/Adyen/Service/Management/APIKeyMerchantLevelApi.php new file mode 100644 index 000000000..e2204cb11 --- /dev/null +++ b/src/Adyen/Service/Management/APIKeyMerchantLevelApi.php @@ -0,0 +1,58 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Generate new API key + * + * @param string $merchantId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\GenerateApiKeyResponse + * @throws AdyenException + */ + public function generateNewApiKey(string $merchantId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\GenerateApiKeyResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}'], [$merchantId, $apiCredentialId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\GenerateApiKeyResponse::class); + } +} diff --git a/src/Adyen/Service/Management/AccountCompanyLevelApi.php b/src/Adyen/Service/Management/AccountCompanyLevelApi.php new file mode 100644 index 000000000..d9d6f60ab --- /dev/null +++ b/src/Adyen/Service/Management/AccountCompanyLevelApi.php @@ -0,0 +1,86 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of company accounts + * + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListCompanyResponse + * @throws AdyenException + */ + public function listCompanyAccounts(array $requestOptions = null): \Adyen\Model\Management\ListCompanyResponse + { + $endpoint = $this->baseURL . "/companies"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListCompanyResponse::class); + } + + /** + * Get a company account + * + * @param string $companyId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Company + * @throws AdyenException + */ + public function getCompanyAccount(string $companyId, array $requestOptions = null): \Adyen\Model\Management\Company + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Company::class); + } + + /** + * Get a list of merchant accounts + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListMerchantResponse + * @throws AdyenException + */ + public function listMerchantAccounts(string $companyId, array $requestOptions = null): \Adyen\Model\Management\ListMerchantResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/merchants"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListMerchantResponse::class); + } +} diff --git a/src/Adyen/Service/Management/AccountMerchantLevelApi.php b/src/Adyen/Service/Management/AccountMerchantLevelApi.php new file mode 100644 index 000000000..6e278b43b --- /dev/null +++ b/src/Adyen/Service/Management/AccountMerchantLevelApi.php @@ -0,0 +1,101 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of merchant accounts + * + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListMerchantResponse + * @throws AdyenException + */ + public function listMerchantAccounts(array $requestOptions = null): \Adyen\Model\Management\ListMerchantResponse + { + $endpoint = $this->baseURL . "/merchants"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListMerchantResponse::class); + } + + /** + * Get a merchant account + * + * @param string $merchantId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Merchant + * @throws AdyenException + */ + public function getMerchantAccount(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\Merchant + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Merchant::class); + } + + /** + * Create a merchant account + * + * @param \Adyen\Model\Management\CreateMerchantRequest $createMerchantRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CreateMerchantResponse + * @throws AdyenException + */ + public function createMerchantAccount(\Adyen\Model\Management\CreateMerchantRequest $createMerchantRequest, array $requestOptions = null): \Adyen\Model\Management\CreateMerchantResponse + { + $endpoint = $this->baseURL . "/merchants"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createMerchantRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CreateMerchantResponse::class); + } + + /** + * Request to activate a merchant account + * + * @param string $merchantId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\RequestActivationResponse + * @throws AdyenException + */ + public function requestToActivateMerchantAccount(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\RequestActivationResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/activate"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\RequestActivationResponse::class); + } +} diff --git a/src/Adyen/Service/Management/AccountStoreLevelApi.php b/src/Adyen/Service/Management/AccountStoreLevelApi.php new file mode 100644 index 000000000..801ccf6f0 --- /dev/null +++ b/src/Adyen/Service/Management/AccountStoreLevelApi.php @@ -0,0 +1,166 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of stores + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'reference'=> string]] + * @return \Adyen\Model\Management\ListStoresResponse + * @throws AdyenException + */ + public function listStoresByMerchantId(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\ListStoresResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/stores"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListStoresResponse::class); + } + + /** + * Get a store + * + * @param string $merchantId + * @param string $storeId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Store + * @throws AdyenException + */ + public function getStore(string $merchantId, string $storeId, array $requestOptions = null): \Adyen\Model\Management\Store + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{storeId}'], [$merchantId, $storeId], "/merchants/{merchantId}/stores/{storeId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Store::class); + } + + /** + * Get a list of stores + * + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'reference'=> string, 'merchantId'=> string]] + * @return \Adyen\Model\Management\ListStoresResponse + * @throws AdyenException + */ + public function listStores(array $requestOptions = null): \Adyen\Model\Management\ListStoresResponse + { + $endpoint = $this->baseURL . "/stores"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListStoresResponse::class); + } + + /** + * Get a store + * + * @param string $storeId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Store + * @throws AdyenException + */ + public function getStoreById(string $storeId, array $requestOptions = null): \Adyen\Model\Management\Store + { + $endpoint = $this->baseURL . str_replace(['{storeId}'], [$storeId], "/stores/{storeId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Store::class); + } + + /** + * Update a store + * + * @param string $merchantId + * @param string $storeId + * @param \Adyen\Model\Management\UpdateStoreRequest $updateStoreRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Store + * @throws AdyenException + */ + public function updateStore(string $merchantId, string $storeId, \Adyen\Model\Management\UpdateStoreRequest $updateStoreRequest, array $requestOptions = null): \Adyen\Model\Management\Store + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{storeId}'], [$merchantId, $storeId], "/merchants/{merchantId}/stores/{storeId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateStoreRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Store::class); + } + + /** + * Update a store + * + * @param string $storeId + * @param \Adyen\Model\Management\UpdateStoreRequest $updateStoreRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Store + * @throws AdyenException + */ + public function updateStoreById(string $storeId, \Adyen\Model\Management\UpdateStoreRequest $updateStoreRequest, array $requestOptions = null): \Adyen\Model\Management\Store + { + $endpoint = $this->baseURL . str_replace(['{storeId}'], [$storeId], "/stores/{storeId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateStoreRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Store::class); + } + + /** + * Create a store + * + * @param string $merchantId + * @param \Adyen\Model\Management\StoreCreationRequest $storeCreationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Store + * @throws AdyenException + */ + public function createStoreByMerchantId(string $merchantId, \Adyen\Model\Management\StoreCreationRequest $storeCreationRequest, array $requestOptions = null): \Adyen\Model\Management\Store + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/stores"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $storeCreationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Store::class); + } + + /** + * Create a store + * + * @param \Adyen\Model\Management\StoreCreationWithMerchantCodeRequest $storeCreationWithMerchantCodeRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Store + * @throws AdyenException + */ + public function createStore(\Adyen\Model\Management\StoreCreationWithMerchantCodeRequest $storeCreationWithMerchantCodeRequest, array $requestOptions = null): \Adyen\Model\Management\Store + { + $endpoint = $this->baseURL . "/stores"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $storeCreationWithMerchantCodeRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Store::class); + } +} diff --git a/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php new file mode 100644 index 000000000..fe998bb97 --- /dev/null +++ b/src/Adyen/Service/Management/AllowedOriginsCompanyLevelApi.php @@ -0,0 +1,108 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Delete an allowed origin + * + * @param string $companyId + * @param string $apiCredentialId + * @param string $originId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteAllowedOrigin(string $companyId, string $apiCredentialId, string $originId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}', '{originId}'], [$companyId, $apiCredentialId, $originId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get a list of allowed origins + * + * @param string $companyId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOriginsResponse + * @throws AdyenException + */ + public function listAllowedOrigins(string $companyId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\AllowedOriginsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}'], [$companyId, $apiCredentialId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOriginsResponse::class); + } + + /** + * Get an allowed origin + * + * @param string $companyId + * @param string $apiCredentialId + * @param string $originId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOrigin + * @throws AdyenException + */ + public function getAllowedOrigin(string $companyId, string $apiCredentialId, string $originId, array $requestOptions = null): \Adyen\Model\Management\AllowedOrigin + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}', '{originId}'], [$companyId, $apiCredentialId, $originId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOrigin::class); + } + + /** + * Create an allowed origin + * + * @param string $companyId + * @param string $apiCredentialId + * @param \Adyen\Model\Management\AllowedOrigin $allowedOrigin + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOriginsResponse + * @throws AdyenException + */ + public function createAllowedOrigin(string $companyId, string $apiCredentialId, \Adyen\Model\Management\AllowedOrigin $allowedOrigin, array $requestOptions = null): \Adyen\Model\Management\AllowedOriginsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}'], [$companyId, $apiCredentialId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $allowedOrigin->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOriginsResponse::class); + } +} diff --git a/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php new file mode 100644 index 000000000..2ecac5d93 --- /dev/null +++ b/src/Adyen/Service/Management/AllowedOriginsMerchantLevelApi.php @@ -0,0 +1,108 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Delete an allowed origin + * + * @param string $merchantId + * @param string $apiCredentialId + * @param string $originId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteAllowedOrigin(string $merchantId, string $apiCredentialId, string $originId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}', '{originId}'], [$merchantId, $apiCredentialId, $originId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get a list of allowed origins + * + * @param string $merchantId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOriginsResponse + * @throws AdyenException + */ + public function listAllowedOrigins(string $merchantId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\AllowedOriginsResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}'], [$merchantId, $apiCredentialId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOriginsResponse::class); + } + + /** + * Get an allowed origin + * + * @param string $merchantId + * @param string $apiCredentialId + * @param string $originId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOrigin + * @throws AdyenException + */ + public function getAllowedOrigin(string $merchantId, string $apiCredentialId, string $originId, array $requestOptions = null): \Adyen\Model\Management\AllowedOrigin + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}', '{originId}'], [$merchantId, $apiCredentialId, $originId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOrigin::class); + } + + /** + * Create an allowed origin + * + * @param string $merchantId + * @param string $apiCredentialId + * @param \Adyen\Model\Management\AllowedOrigin $allowedOrigin + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOriginsResponse + * @throws AdyenException + */ + public function createAllowedOrigin(string $merchantId, string $apiCredentialId, \Adyen\Model\Management\AllowedOrigin $allowedOrigin, array $requestOptions = null): \Adyen\Model\Management\AllowedOriginsResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}'], [$merchantId, $apiCredentialId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $allowedOrigin->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOriginsResponse::class); + } +} diff --git a/src/Adyen/Service/Management/ClientKeyCompanyLevelApi.php b/src/Adyen/Service/Management/ClientKeyCompanyLevelApi.php new file mode 100644 index 000000000..3a6d3dcbc --- /dev/null +++ b/src/Adyen/Service/Management/ClientKeyCompanyLevelApi.php @@ -0,0 +1,58 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Generate new client key + * + * @param string $companyId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\GenerateClientKeyResponse + * @throws AdyenException + */ + public function generateNewClientKey(string $companyId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\GenerateClientKeyResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{apiCredentialId}'], [$companyId, $apiCredentialId], "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\GenerateClientKeyResponse::class); + } +} diff --git a/src/Adyen/Service/Management/ClientKeyMerchantLevelApi.php b/src/Adyen/Service/Management/ClientKeyMerchantLevelApi.php new file mode 100644 index 000000000..f392a27dd --- /dev/null +++ b/src/Adyen/Service/Management/ClientKeyMerchantLevelApi.php @@ -0,0 +1,58 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Generate new client key + * + * @param string $merchantId + * @param string $apiCredentialId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\GenerateClientKeyResponse + * @throws AdyenException + */ + public function generateNewClientKey(string $merchantId, string $apiCredentialId, array $requestOptions = null): \Adyen\Model\Management\GenerateClientKeyResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{apiCredentialId}'], [$merchantId, $apiCredentialId], "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\GenerateClientKeyResponse::class); + } +} diff --git a/src/Adyen/Service/Management/MyAPICredentialApi.php b/src/Adyen/Service/Management/MyAPICredentialApi.php new file mode 100644 index 000000000..23c5df128 --- /dev/null +++ b/src/Adyen/Service/Management/MyAPICredentialApi.php @@ -0,0 +1,114 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Remove allowed origin + * + * @param string $originId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function removeAllowedOrigin(string $originId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{originId}'], [$originId], "/me/allowedOrigins/{originId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get API credential details + * + * @param array|null $requestOptions + * @return \Adyen\Model\Management\MeApiCredential + * @throws AdyenException + */ + public function getApiCredentialDetails(array $requestOptions = null): \Adyen\Model\Management\MeApiCredential + { + $endpoint = $this->baseURL . "/me"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\MeApiCredential::class); + } + + /** + * Get allowed origins + * + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOriginsResponse + * @throws AdyenException + */ + public function getAllowedOrigins(array $requestOptions = null): \Adyen\Model\Management\AllowedOriginsResponse + { + $endpoint = $this->baseURL . "/me/allowedOrigins"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOriginsResponse::class); + } + + /** + * Get allowed origin details + * + * @param string $originId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOrigin + * @throws AdyenException + */ + public function getAllowedOriginDetails(string $originId, array $requestOptions = null): \Adyen\Model\Management\AllowedOrigin + { + $endpoint = $this->baseURL . str_replace(['{originId}'], [$originId], "/me/allowedOrigins/{originId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOrigin::class); + } + + /** + * Add allowed origin + * + * @param \Adyen\Model\Management\CreateAllowedOriginRequest $createAllowedOriginRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AllowedOrigin + * @throws AdyenException + */ + public function addAllowedOrigin(\Adyen\Model\Management\CreateAllowedOriginRequest $createAllowedOriginRequest, array $requestOptions = null): \Adyen\Model\Management\AllowedOrigin + { + $endpoint = $this->baseURL . "/me/allowedOrigins"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createAllowedOriginRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AllowedOrigin::class); + } +} diff --git a/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php new file mode 100644 index 000000000..dbaca889b --- /dev/null +++ b/src/Adyen/Service/Management/PaymentMethodsMerchantLevelApi.php @@ -0,0 +1,138 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get all payment methods + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['storeId'=> string, 'businessLineId'=> string, 'pageSize'=> int, 'pageNumber'=> int]] + * @return \Adyen\Model\Management\PaymentMethodResponse + * @throws AdyenException + */ + public function getAllPaymentMethods(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\PaymentMethodResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/paymentMethodSettings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PaymentMethodResponse::class); + } + + /** + * Get payment method details + * + * @param string $merchantId + * @param string $paymentMethodId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\PaymentMethod + * @throws AdyenException + */ + public function getPaymentMethodDetails(string $merchantId, string $paymentMethodId, array $requestOptions = null): \Adyen\Model\Management\PaymentMethod + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PaymentMethod::class); + } + + /** + * Get Apple Pay domains + * + * @param string $merchantId + * @param string $paymentMethodId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ApplePayInfo + * @throws AdyenException + */ + public function getApplePayDomains(string $merchantId, string $paymentMethodId, array $requestOptions = null): \Adyen\Model\Management\ApplePayInfo + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ApplePayInfo::class); + } + + /** + * Update a payment method + * + * @param string $merchantId + * @param string $paymentMethodId + * @param \Adyen\Model\Management\UpdatePaymentMethodInfo $updatePaymentMethodInfo + * @param array|null $requestOptions + * @return \Adyen\Model\Management\PaymentMethod + * @throws AdyenException + */ + public function updatePaymentMethod(string $merchantId, string $paymentMethodId, \Adyen\Model\Management\UpdatePaymentMethodInfo $updatePaymentMethodInfo, array $requestOptions = null): \Adyen\Model\Management\PaymentMethod + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updatePaymentMethodInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PaymentMethod::class); + } + + /** + * Request a payment method + * + * @param string $merchantId + * @param \Adyen\Model\Management\PaymentMethodSetupInfo $paymentMethodSetupInfo + * @param array|null $requestOptions + * @return \Adyen\Model\Management\PaymentMethod + * @throws AdyenException + */ + public function requestPaymentMethod(string $merchantId, \Adyen\Model\Management\PaymentMethodSetupInfo $paymentMethodSetupInfo, array $requestOptions = null): \Adyen\Model\Management\PaymentMethod + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/paymentMethodSettings"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $paymentMethodSetupInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PaymentMethod::class); + } + + /** + * Add an Apple Pay domain + * + * @param string $merchantId + * @param string $paymentMethodId + * @param \Adyen\Model\Management\ApplePayInfo $applePayInfo + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function addApplePayDomain(string $merchantId, string $paymentMethodId, \Adyen\Model\Management\ApplePayInfo $applePayInfo, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains"); + $this->requestHttp($endpoint, strtolower('POST'), (array) $applePayInfo->jsonSerialize(), $requestOptions); + } +} diff --git a/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php new file mode 100644 index 000000000..eb7aa7d57 --- /dev/null +++ b/src/Adyen/Service/Management/PayoutSettingsMerchantLevelApi.php @@ -0,0 +1,121 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Delete a payout setting + * + * @param string $merchantId + * @param string $payoutSettingsId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deletePayoutSetting(string $merchantId, string $payoutSettingsId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{payoutSettingsId}'], [$merchantId, $payoutSettingsId], "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get a list of payout settings + * + * @param string $merchantId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\PayoutSettingsResponse + * @throws AdyenException + */ + public function listPayoutSettings(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\PayoutSettingsResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/payoutSettings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PayoutSettingsResponse::class); + } + + /** + * Get a payout setting + * + * @param string $merchantId + * @param string $payoutSettingsId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\PayoutSettings + * @throws AdyenException + */ + public function getPayoutSetting(string $merchantId, string $payoutSettingsId, array $requestOptions = null): \Adyen\Model\Management\PayoutSettings + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{payoutSettingsId}'], [$merchantId, $payoutSettingsId], "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PayoutSettings::class); + } + + /** + * Update a payout setting + * + * @param string $merchantId + * @param string $payoutSettingsId + * @param \Adyen\Model\Management\UpdatePayoutSettingsRequest $updatePayoutSettingsRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\PayoutSettings + * @throws AdyenException + */ + public function updatePayoutSetting(string $merchantId, string $payoutSettingsId, \Adyen\Model\Management\UpdatePayoutSettingsRequest $updatePayoutSettingsRequest, array $requestOptions = null): \Adyen\Model\Management\PayoutSettings + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{payoutSettingsId}'], [$merchantId, $payoutSettingsId], "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updatePayoutSettingsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PayoutSettings::class); + } + + /** + * Add a payout setting + * + * @param string $merchantId + * @param \Adyen\Model\Management\PayoutSettingsRequest $payoutSettingsRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\PayoutSettings + * @throws AdyenException + */ + public function addPayoutSetting(string $merchantId, \Adyen\Model\Management\PayoutSettingsRequest $payoutSettingsRequest, array $requestOptions = null): \Adyen\Model\Management\PayoutSettings + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/payoutSettings"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $payoutSettingsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\PayoutSettings::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php b/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php new file mode 100644 index 000000000..547b2c4f8 --- /dev/null +++ b/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php @@ -0,0 +1,103 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of Android apps + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\AndroidAppsResponse + * @throws AdyenException + */ + public function listAndroidApps(string $companyId, array $requestOptions = null): \Adyen\Model\Management\AndroidAppsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/androidApps"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidAppsResponse::class); + } + + /** + * Get a list of Android certificates + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\AndroidCertificatesResponse + * @throws AdyenException + */ + public function listAndroidCertificates(string $companyId, array $requestOptions = null): \Adyen\Model\Management\AndroidCertificatesResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/androidCertificates"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidCertificatesResponse::class); + } + + /** + * Get a list of terminal actions + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'status'=> string, 'type'=> string]] + * @return \Adyen\Model\Management\ListExternalTerminalActionsResponse + * @throws AdyenException + */ + public function listTerminalActions(string $companyId, array $requestOptions = null): \Adyen\Model\Management\ListExternalTerminalActionsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalActions"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListExternalTerminalActionsResponse::class); + } + + /** + * Get terminal action + * + * @param string $companyId + * @param string $actionId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ExternalTerminalAction + * @throws AdyenException + */ + public function getTerminalAction(string $companyId, string $actionId, array $requestOptions = null): \Adyen\Model\Management\ExternalTerminalAction + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{actionId}'], [$companyId, $actionId], "/companies/{companyId}/terminalActions/{actionId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ExternalTerminalAction::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalActionsTerminalLevelApi.php b/src/Adyen/Service/Management/TerminalActionsTerminalLevelApi.php new file mode 100644 index 000000000..6d86f09e4 --- /dev/null +++ b/src/Adyen/Service/Management/TerminalActionsTerminalLevelApi.php @@ -0,0 +1,57 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Create a terminal action + * + * @param \Adyen\Model\Management\ScheduleTerminalActionsRequest $scheduleTerminalActionsRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ScheduleTerminalActionsResponse + * @throws AdyenException + */ + public function createTerminalAction(\Adyen\Model\Management\ScheduleTerminalActionsRequest $scheduleTerminalActionsRequest, array $requestOptions = null): \Adyen\Model\Management\ScheduleTerminalActionsResponse + { + $endpoint = $this->baseURL . "/terminals/scheduleActions"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $scheduleTerminalActionsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ScheduleTerminalActionsResponse::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalOrdersCompanyLevelApi.php b/src/Adyen/Service/Management/TerminalOrdersCompanyLevelApi.php new file mode 100644 index 000000000..ff531172f --- /dev/null +++ b/src/Adyen/Service/Management/TerminalOrdersCompanyLevelApi.php @@ -0,0 +1,198 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of billing entities + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['name'=> string]] + * @return \Adyen\Model\Management\BillingEntitiesResponse + * @throws AdyenException + */ + public function listBillingEntities(string $companyId, array $requestOptions = null): \Adyen\Model\Management\BillingEntitiesResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/billingEntities"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\BillingEntitiesResponse::class); + } + + /** + * Get a list of shipping locations + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['name'=> string, 'offset'=> int, 'limit'=> int]] + * @return \Adyen\Model\Management\ShippingLocationsResponse + * @throws AdyenException + */ + public function listShippingLocations(string $companyId, array $requestOptions = null): \Adyen\Model\Management\ShippingLocationsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/shippingLocations"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ShippingLocationsResponse::class); + } + + /** + * Get a list of terminal models + * + * @param string $companyId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalModelsResponse + * @throws AdyenException + */ + public function listTerminalModels(string $companyId, array $requestOptions = null): \Adyen\Model\Management\TerminalModelsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalModels"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalModelsResponse::class); + } + + /** + * Get a list of orders + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['customerOrderReference'=> string, 'status'=> string, 'offset'=> int, 'limit'=> int]] + * @return \Adyen\Model\Management\TerminalOrdersResponse + * @throws AdyenException + */ + public function listOrders(string $companyId, array $requestOptions = null): \Adyen\Model\Management\TerminalOrdersResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalOrders"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrdersResponse::class); + } + + /** + * Get an order + * + * @param string $companyId + * @param string $orderId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function getOrder(string $companyId, string $orderId, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{orderId}'], [$companyId, $orderId], "/companies/{companyId}/terminalOrders/{orderId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } + + /** + * Get a list of terminal products + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['country'=> string, 'terminalModelId'=> string, 'offset'=> int, 'limit'=> int]] + * @return \Adyen\Model\Management\TerminalProductsResponse + * @throws AdyenException + */ + public function listTerminalProducts(string $companyId, array $requestOptions = null): \Adyen\Model\Management\TerminalProductsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalProducts"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalProductsResponse::class); + } + + /** + * Update an order + * + * @param string $companyId + * @param string $orderId + * @param \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function updateOrder(string $companyId, string $orderId, \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{orderId}'], [$companyId, $orderId], "/companies/{companyId}/terminalOrders/{orderId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $terminalOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } + + /** + * Create a shipping location + * + * @param string $companyId + * @param \Adyen\Model\Management\ShippingLocation $shippingLocation + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ShippingLocation + * @throws AdyenException + */ + public function createShippingLocation(string $companyId, \Adyen\Model\Management\ShippingLocation $shippingLocation, array $requestOptions = null): \Adyen\Model\Management\ShippingLocation + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/shippingLocations"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $shippingLocation->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ShippingLocation::class); + } + + /** + * Create an order + * + * @param string $companyId + * @param \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function createOrder(string $companyId, \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalOrders"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $terminalOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } + + /** + * Cancel an order + * + * @param string $companyId + * @param string $orderId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function cancelOrder(string $companyId, string $orderId, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{orderId}'], [$companyId, $orderId], "/companies/{companyId}/terminalOrders/{orderId}/cancel"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalOrdersMerchantLevelApi.php b/src/Adyen/Service/Management/TerminalOrdersMerchantLevelApi.php new file mode 100644 index 000000000..5f3fd557b --- /dev/null +++ b/src/Adyen/Service/Management/TerminalOrdersMerchantLevelApi.php @@ -0,0 +1,198 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of billing entities + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['name'=> string]] + * @return \Adyen\Model\Management\BillingEntitiesResponse + * @throws AdyenException + */ + public function listBillingEntities(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\BillingEntitiesResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/billingEntities"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\BillingEntitiesResponse::class); + } + + /** + * Get a list of shipping locations + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['name'=> string, 'offset'=> int, 'limit'=> int]] + * @return \Adyen\Model\Management\ShippingLocationsResponse + * @throws AdyenException + */ + public function listShippingLocations(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\ShippingLocationsResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/shippingLocations"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ShippingLocationsResponse::class); + } + + /** + * Get a list of terminal models + * + * @param string $merchantId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalModelsResponse + * @throws AdyenException + */ + public function listTerminalModels(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\TerminalModelsResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalModels"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalModelsResponse::class); + } + + /** + * Get a list of orders + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['customerOrderReference'=> string, 'status'=> string, 'offset'=> int, 'limit'=> int]] + * @return \Adyen\Model\Management\TerminalOrdersResponse + * @throws AdyenException + */ + public function listOrders(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\TerminalOrdersResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalOrders"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrdersResponse::class); + } + + /** + * Get an order + * + * @param string $merchantId + * @param string $orderId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function getOrder(string $merchantId, string $orderId, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{orderId}'], [$merchantId, $orderId], "/merchants/{merchantId}/terminalOrders/{orderId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } + + /** + * Get a list of terminal products + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['country'=> string, 'terminalModelId'=> string, 'offset'=> int, 'limit'=> int]] + * @return \Adyen\Model\Management\TerminalProductsResponse + * @throws AdyenException + */ + public function listTerminalProducts(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\TerminalProductsResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalProducts"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalProductsResponse::class); + } + + /** + * Update an order + * + * @param string $merchantId + * @param string $orderId + * @param \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function updateOrder(string $merchantId, string $orderId, \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{orderId}'], [$merchantId, $orderId], "/merchants/{merchantId}/terminalOrders/{orderId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $terminalOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } + + /** + * Create a shipping location + * + * @param string $merchantId + * @param \Adyen\Model\Management\ShippingLocation $shippingLocation + * @param array|null $requestOptions + * @return \Adyen\Model\Management\ShippingLocation + * @throws AdyenException + */ + public function createShippingLocation(string $merchantId, \Adyen\Model\Management\ShippingLocation $shippingLocation, array $requestOptions = null): \Adyen\Model\Management\ShippingLocation + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/shippingLocations"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $shippingLocation->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ShippingLocation::class); + } + + /** + * Create an order + * + * @param string $merchantId + * @param \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function createOrder(string $merchantId, \Adyen\Model\Management\TerminalOrderRequest $terminalOrderRequest, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalOrders"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $terminalOrderRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } + + /** + * Cancel an order + * + * @param string $merchantId + * @param string $orderId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalOrder + * @throws AdyenException + */ + public function cancelOrder(string $merchantId, string $orderId, array $requestOptions = null): \Adyen\Model\Management\TerminalOrder + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{orderId}'], [$merchantId, $orderId], "/merchants/{merchantId}/terminalOrders/{orderId}/cancel"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalOrder::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalSettingsCompanyLevelApi.php b/src/Adyen/Service/Management/TerminalSettingsCompanyLevelApi.php new file mode 100644 index 000000000..1f5f29a74 --- /dev/null +++ b/src/Adyen/Service/Management/TerminalSettingsCompanyLevelApi.php @@ -0,0 +1,104 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function getTerminalLogo(string $companyId, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Get terminal settings + * + * @param string $companyId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function getTerminalSettings(string $companyId, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } + + /** + * Update the terminal logo + * + * @param string $companyId + * @param \Adyen\Model\Management\Logo $logo + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function updateTerminalLogo(string $companyId, \Adyen\Model\Management\Logo $logo, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $logo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Update terminal settings + * + * @param string $companyId + * @param \Adyen\Model\Management\TerminalSettings $terminalSettings + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function updateTerminalSettings(string $companyId, \Adyen\Model\Management\TerminalSettings $terminalSettings, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $terminalSettings->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalSettingsMerchantLevelApi.php b/src/Adyen/Service/Management/TerminalSettingsMerchantLevelApi.php new file mode 100644 index 000000000..098772c29 --- /dev/null +++ b/src/Adyen/Service/Management/TerminalSettingsMerchantLevelApi.php @@ -0,0 +1,104 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function getTerminalLogo(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Get terminal settings + * + * @param string $merchantId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function getTerminalSettings(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } + + /** + * Update the terminal logo + * + * @param string $merchantId + * @param \Adyen\Model\Management\Logo $logo + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function updateTerminalLogo(string $merchantId, \Adyen\Model\Management\Logo $logo, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $logo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Update terminal settings + * + * @param string $merchantId + * @param \Adyen\Model\Management\TerminalSettings $terminalSettings + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function updateTerminalSettings(string $merchantId, \Adyen\Model\Management\TerminalSettings $terminalSettings, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $terminalSettings->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalSettingsStoreLevelApi.php b/src/Adyen/Service/Management/TerminalSettingsStoreLevelApi.php new file mode 100644 index 000000000..f9f89a1de --- /dev/null +++ b/src/Adyen/Service/Management/TerminalSettingsStoreLevelApi.php @@ -0,0 +1,170 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param string $merchantId + * @param string $reference + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function getTerminalLogo(string $merchantId, string $reference, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{reference}'], [$merchantId, $reference], "/merchants/{merchantId}/stores/{reference}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Get terminal settings + * + * @param string $merchantId + * @param string $reference + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function getTerminalSettings(string $merchantId, string $reference, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{reference}'], [$merchantId, $reference], "/merchants/{merchantId}/stores/{reference}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } + + /** + * Get the terminal logo + * + * @param string $storeId + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function getTerminalLogoByStoreId(string $storeId, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{storeId}'], [$storeId], "/stores/{storeId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Get terminal settings + * + * @param string $storeId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function getTerminalSettingsByStoreId(string $storeId, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{storeId}'], [$storeId], "/stores/{storeId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } + + /** + * Update the terminal logo + * + * @param string $merchantId + * @param string $reference + * @param \Adyen\Model\Management\Logo $logo + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function updateTerminalLogo(string $merchantId, string $reference, \Adyen\Model\Management\Logo $logo, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{reference}'], [$merchantId, $reference], "/merchants/{merchantId}/stores/{reference}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $logo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Update terminal settings + * + * @param string $merchantId + * @param string $reference + * @param \Adyen\Model\Management\TerminalSettings $terminalSettings + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function updateTerminalSettings(string $merchantId, string $reference, \Adyen\Model\Management\TerminalSettings $terminalSettings, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{reference}'], [$merchantId, $reference], "/merchants/{merchantId}/stores/{reference}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $terminalSettings->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } + + /** + * Update the terminal logo + * + * @param string $storeId + * @param \Adyen\Model\Management\Logo $logo + * @param array|null $requestOptions ['queryParams' => ['model'=> string]] + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function updateTerminalLogoByStoreId(string $storeId, \Adyen\Model\Management\Logo $logo, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{storeId}'], [$storeId], "/stores/{storeId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $logo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Update terminal settings + * + * @param string $storeId + * @param \Adyen\Model\Management\TerminalSettings $terminalSettings + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function updateTerminalSettingsByStoreId(string $storeId, \Adyen\Model\Management\TerminalSettings $terminalSettings, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{storeId}'], [$storeId], "/stores/{storeId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $terminalSettings->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalSettingsTerminalLevelApi.php b/src/Adyen/Service/Management/TerminalSettingsTerminalLevelApi.php new file mode 100644 index 000000000..eb87ed400 --- /dev/null +++ b/src/Adyen/Service/Management/TerminalSettingsTerminalLevelApi.php @@ -0,0 +1,104 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param string $terminalId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function getTerminalLogo(string $terminalId, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Get terminal settings + * + * @param string $terminalId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function getTerminalSettings(string $terminalId, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } + + /** + * Update the logo + * + * @param string $terminalId + * @param \Adyen\Model\Management\Logo $logo + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Logo + * @throws AdyenException + */ + public function updateLogo(string $terminalId, \Adyen\Model\Management\Logo $logo, array $requestOptions = null): \Adyen\Model\Management\Logo + { + $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/terminalLogos"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $logo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Logo::class); + } + + /** + * Update terminal settings + * + * @param string $terminalId + * @param \Adyen\Model\Management\TerminalSettings $terminalSettings + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TerminalSettings + * @throws AdyenException + */ + public function updateTerminalSettings(string $terminalId, \Adyen\Model\Management\TerminalSettings $terminalSettings, array $requestOptions = null): \Adyen\Model\Management\TerminalSettings + { + $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/terminalSettings"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $terminalSettings->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TerminalSettings::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php new file mode 100644 index 000000000..3378e877b --- /dev/null +++ b/src/Adyen/Service/Management/TerminalsTerminalLevelApi.php @@ -0,0 +1,56 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of terminals + * + * @param array|null $requestOptions ['queryParams' => ['searchQuery'=> string, 'countries'=> string, 'merchantIds'=> string, 'storeIds'=> string, 'brandModels'=> string, 'pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListTerminalsResponse + * @throws AdyenException + */ + public function listTerminals(array $requestOptions = null): \Adyen\Model\Management\ListTerminalsResponse + { + $endpoint = $this->baseURL . "/terminals"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListTerminalsResponse::class); + } +} diff --git a/src/Adyen/Service/Management/UsersCompanyLevelApi.php b/src/Adyen/Service/Management/UsersCompanyLevelApi.php new file mode 100644 index 000000000..d32277d4a --- /dev/null +++ b/src/Adyen/Service/Management/UsersCompanyLevelApi.php @@ -0,0 +1,106 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of users + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'username'=> string]] + * @return \Adyen\Model\Management\ListCompanyUsersResponse + * @throws AdyenException + */ + public function listUsers(string $companyId, array $requestOptions = null): \Adyen\Model\Management\ListCompanyUsersResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/users"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListCompanyUsersResponse::class); + } + + /** + * Get user details + * + * @param string $companyId + * @param string $userId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CompanyUser + * @throws AdyenException + */ + public function getUserDetails(string $companyId, string $userId, array $requestOptions = null): \Adyen\Model\Management\CompanyUser + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{userId}'], [$companyId, $userId], "/companies/{companyId}/users/{userId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CompanyUser::class); + } + + /** + * Update user details + * + * @param string $companyId + * @param string $userId + * @param \Adyen\Model\Management\UpdateCompanyUserRequest $updateCompanyUserRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CompanyUser + * @throws AdyenException + */ + public function updateUserDetails(string $companyId, string $userId, \Adyen\Model\Management\UpdateCompanyUserRequest $updateCompanyUserRequest, array $requestOptions = null): \Adyen\Model\Management\CompanyUser + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{userId}'], [$companyId, $userId], "/companies/{companyId}/users/{userId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateCompanyUserRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CompanyUser::class); + } + + /** + * Create a new user + * + * @param string $companyId + * @param \Adyen\Model\Management\CreateCompanyUserRequest $createCompanyUserRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CreateCompanyUserResponse + * @throws AdyenException + */ + public function createNewUser(string $companyId, \Adyen\Model\Management\CreateCompanyUserRequest $createCompanyUserRequest, array $requestOptions = null): \Adyen\Model\Management\CreateCompanyUserResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/users"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createCompanyUserRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CreateCompanyUserResponse::class); + } +} diff --git a/src/Adyen/Service/Management/UsersMerchantLevelApi.php b/src/Adyen/Service/Management/UsersMerchantLevelApi.php new file mode 100644 index 000000000..11325b850 --- /dev/null +++ b/src/Adyen/Service/Management/UsersMerchantLevelApi.php @@ -0,0 +1,106 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of users + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'username'=> string]] + * @return \Adyen\Model\Management\ListMerchantUsersResponse + * @throws AdyenException + */ + public function listUsers(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\ListMerchantUsersResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/users"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListMerchantUsersResponse::class); + } + + /** + * Get user details + * + * @param string $merchantId + * @param string $userId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\User + * @throws AdyenException + */ + public function getUserDetails(string $merchantId, string $userId, array $requestOptions = null): \Adyen\Model\Management\User + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{userId}'], [$merchantId, $userId], "/merchants/{merchantId}/users/{userId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\User::class); + } + + /** + * Update a user + * + * @param string $merchantId + * @param string $userId + * @param \Adyen\Model\Management\UpdateMerchantUserRequest $updateMerchantUserRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\User + * @throws AdyenException + */ + public function updateUser(string $merchantId, string $userId, \Adyen\Model\Management\UpdateMerchantUserRequest $updateMerchantUserRequest, array $requestOptions = null): \Adyen\Model\Management\User + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{userId}'], [$merchantId, $userId], "/merchants/{merchantId}/users/{userId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateMerchantUserRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\User::class); + } + + /** + * Create a new user + * + * @param string $merchantId + * @param \Adyen\Model\Management\CreateMerchantUserRequest $createMerchantUserRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\CreateUserResponse + * @throws AdyenException + */ + public function createNewUser(string $merchantId, \Adyen\Model\Management\CreateMerchantUserRequest $createMerchantUserRequest, array $requestOptions = null): \Adyen\Model\Management\CreateUserResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/users"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createMerchantUserRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\CreateUserResponse::class); + } +} diff --git a/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php new file mode 100644 index 000000000..98c88c52b --- /dev/null +++ b/src/Adyen/Service/Management/WebhooksCompanyLevelApi.php @@ -0,0 +1,154 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Remove a webhook + * + * @param string $companyId + * @param string $webhookId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function removeWebhook(string $companyId, string $webhookId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * List all webhooks + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListWebhooksResponse + * @throws AdyenException + */ + public function listAllWebhooks(string $companyId, array $requestOptions = null): \Adyen\Model\Management\ListWebhooksResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/webhooks"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListWebhooksResponse::class); + } + + /** + * Get a webhook + * + * @param string $companyId + * @param string $webhookId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Webhook + * @throws AdyenException + */ + public function getWebhook(string $companyId, string $webhookId, array $requestOptions = null): \Adyen\Model\Management\Webhook + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Webhook::class); + } + + /** + * Update a webhook + * + * @param string $companyId + * @param string $webhookId + * @param \Adyen\Model\Management\UpdateCompanyWebhookRequest $updateCompanyWebhookRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Webhook + * @throws AdyenException + */ + public function updateWebhook(string $companyId, string $webhookId, \Adyen\Model\Management\UpdateCompanyWebhookRequest $updateCompanyWebhookRequest, array $requestOptions = null): \Adyen\Model\Management\Webhook + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateCompanyWebhookRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Webhook::class); + } + + /** + * Set up a webhook + * + * @param string $companyId + * @param \Adyen\Model\Management\CreateCompanyWebhookRequest $createCompanyWebhookRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Webhook + * @throws AdyenException + */ + public function setUpWebhook(string $companyId, \Adyen\Model\Management\CreateCompanyWebhookRequest $createCompanyWebhookRequest, array $requestOptions = null): \Adyen\Model\Management\Webhook + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/webhooks"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createCompanyWebhookRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Webhook::class); + } + + /** + * Generate an HMAC key + * + * @param string $companyId + * @param string $webhookId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\GenerateHmacKeyResponse + * @throws AdyenException + */ + public function generateHmacKey(string $companyId, string $webhookId, array $requestOptions = null): \Adyen\Model\Management\GenerateHmacKeyResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}/generateHmac"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\GenerateHmacKeyResponse::class); + } + + /** + * Test a webhook + * + * @param string $companyId + * @param string $webhookId + * @param \Adyen\Model\Management\TestCompanyWebhookRequest $testCompanyWebhookRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TestWebhookResponse + * @throws AdyenException + */ + public function testWebhook(string $companyId, string $webhookId, \Adyen\Model\Management\TestCompanyWebhookRequest $testCompanyWebhookRequest, array $requestOptions = null): \Adyen\Model\Management\TestWebhookResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}/test"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $testCompanyWebhookRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TestWebhookResponse::class); + } +} diff --git a/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php new file mode 100644 index 000000000..872f5b3cc --- /dev/null +++ b/src/Adyen/Service/Management/WebhooksMerchantLevelApi.php @@ -0,0 +1,154 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Remove a webhook + * + * @param string $merchantId + * @param string $webhookId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function removeWebhook(string $merchantId, string $webhookId, array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * List all webhooks + * + * @param string $merchantId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int]] + * @return \Adyen\Model\Management\ListWebhooksResponse + * @throws AdyenException + */ + public function listAllWebhooks(string $merchantId, array $requestOptions = null): \Adyen\Model\Management\ListWebhooksResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/webhooks"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\ListWebhooksResponse::class); + } + + /** + * Get a webhook + * + * @param string $merchantId + * @param string $webhookId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Webhook + * @throws AdyenException + */ + public function getWebhook(string $merchantId, string $webhookId, array $requestOptions = null): \Adyen\Model\Management\Webhook + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Webhook::class); + } + + /** + * Update a webhook + * + * @param string $merchantId + * @param string $webhookId + * @param \Adyen\Model\Management\UpdateMerchantWebhookRequest $updateMerchantWebhookRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Webhook + * @throws AdyenException + */ + public function updateWebhook(string $merchantId, string $webhookId, \Adyen\Model\Management\UpdateMerchantWebhookRequest $updateMerchantWebhookRequest, array $requestOptions = null): \Adyen\Model\Management\Webhook + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateMerchantWebhookRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Webhook::class); + } + + /** + * Set up a webhook + * + * @param string $merchantId + * @param \Adyen\Model\Management\CreateMerchantWebhookRequest $createMerchantWebhookRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\Webhook + * @throws AdyenException + */ + public function setUpWebhook(string $merchantId, \Adyen\Model\Management\CreateMerchantWebhookRequest $createMerchantWebhookRequest, array $requestOptions = null): \Adyen\Model\Management\Webhook + { + $endpoint = $this->baseURL . str_replace(['{merchantId}'], [$merchantId], "/merchants/{merchantId}/webhooks"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createMerchantWebhookRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\Webhook::class); + } + + /** + * Generate an HMAC key + * + * @param string $merchantId + * @param string $webhookId + * @param array|null $requestOptions + * @return \Adyen\Model\Management\GenerateHmacKeyResponse + * @throws AdyenException + */ + public function generateHmacKey(string $merchantId, string $webhookId, array $requestOptions = null): \Adyen\Model\Management\GenerateHmacKeyResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}/generateHmac"); + $response = $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\GenerateHmacKeyResponse::class); + } + + /** + * Test a webhook + * + * @param string $merchantId + * @param string $webhookId + * @param \Adyen\Model\Management\TestWebhookRequest $testWebhookRequest + * @param array|null $requestOptions + * @return \Adyen\Model\Management\TestWebhookResponse + * @throws AdyenException + */ + public function testWebhook(string $merchantId, string $webhookId, \Adyen\Model\Management\TestWebhookRequest $testWebhookRequest, array $requestOptions = null): \Adyen\Model\Management\TestWebhookResponse + { + $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}/test"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $testWebhookRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\TestWebhookResponse::class); + } +} diff --git a/tests/Resources/ModelBasedManagement/get-merchants-success.json b/tests/Resources/ModelBasedManagement/get-merchants-success.json new file mode 100644 index 000000000..6b68201c8 --- /dev/null +++ b/tests/Resources/ModelBasedManagement/get-merchants-success.json @@ -0,0 +1,81 @@ +{ + "_links": { + "first": { + "href": "https://management-test.adyen.com/v1/merchants?pageNumber=1&pageSize=10" + }, + "last": { + "href": "https://management-test.adyen.com/v1/merchants?pageNumber=1&pageSize=10" + }, + "self": { + "href": "https://management-test.adyen.com/v1/merchants?pageNumber=1&pageSize=10" + } + }, + "itemsTotal": 2, + "pagesTotal": 1, + "data": [ + { + "id": "TestMerchantAccount1", + "name": "TestMerchantAccount1", + "companyId": "Demo", + "captureDelay": "manual", + "defaultShopperInteraction": "Ecommerce", + "status": "Active", + "shopWebAddress": "https://TestMerchantAccount1.store/Sites-Site", + "merchantCity": "Amsterdam", + "primarySettlementCurrency": "EUR", + "dataCenters": [ + { + "name": "default", + "livePrefix": "" + } + ], + "_links": { + "self": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount1" + }, + "apiCredentials": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount1/apiCredentials" + }, + "users": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount1/users" + }, + "webhooks": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount1/webhooks" + } + }, + "description": "TestMerchantAccount1" + }, + { + "id": "TestMerchantAccount2", + "name": "TestMerchantAccount2", + "companyId": "Demo", + "captureDelay": "immediate", + "defaultShopperInteraction": "Ecommerce", + "status": "Active", + "shopWebAddress": "https://TestMerchantAccount1.store/Sites-Site", + "merchantCity": "Amsterdam", + "primarySettlementCurrency": "EUR", + "dataCenters": [ + { + "name": "default", + "livePrefix": "" + } + ], + "_links": { + "self": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount2" + }, + "apiCredentials": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount2/apiCredentials" + }, + "users": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount2/users" + }, + "webhooks": { + "href": "https://management-test.adyen.com/v1/merchants/TestMerchantAccount2/webhooks" + } + }, + "description": "TestMerchantAccount2" + } + ] +} diff --git a/tests/Resources/ModelBasedManagement/post-merchants-webhooks-generateHmac-success.json b/tests/Resources/ModelBasedManagement/post-merchants-webhooks-generateHmac-success.json new file mode 100644 index 000000000..cc88738a3 --- /dev/null +++ b/tests/Resources/ModelBasedManagement/post-merchants-webhooks-generateHmac-success.json @@ -0,0 +1,3 @@ +{ + "hmacKey" : "AG4345BV33J78K17F4F963516FA42AC8813EWS3J8F41E902" +} diff --git a/tests/Resources/ModelBasedManagement/terminal-logo.json b/tests/Resources/ModelBasedManagement/terminal-logo.json new file mode 100644 index 000000000..4cf2db40c --- /dev/null +++ b/tests/Resources/ModelBasedManagement/terminal-logo.json @@ -0,0 +1,3 @@ +{ + "data": "LOGO_INHERITED_FROM_HIGHER_LEVEL_BASE-64_ENCODED_STRING" +} \ No newline at end of file diff --git a/tests/Unit/ModelBasedManagementTest.php b/tests/Unit/ModelBasedManagementTest.php new file mode 100644 index 000000000..3a698b026 --- /dev/null +++ b/tests/Unit/ModelBasedManagementTest.php @@ -0,0 +1,129 @@ +createMockClient($jsonFile, $httpStatus); + // initialize service + $service = new Management\AccountMerchantLevelApi($client); + $response = $service->listMerchantAccounts(); + + $this->assertNotEmpty($response); + $this->assertNotEmpty($response->getLinks()); + $this->assertNotEmpty($response->getData()); + $this->assertNotEmpty($response->getItemsTotal()); + } + + /** + * Get /merchants with query parameters + * @throws \Adyen\AdyenException + * @dataProvider successMerchantAccountProviders + */ + public function testGetMerchantsWithQueryParameters($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClientUrl($jsonFile); + + // initialize service + $service = new Management\AccountMerchantLevelApi($client); + $response = $service->listMerchantAccounts(array('queryParams' => array("pageSize"=> 2))); + + $this->assertNotEmpty($response); + $this->assertNotEmpty($response->getLinks()); + $this->assertNotEmpty($response->getData()); + $this->assertNotEmpty($response->getItemsTotal()); + self::assertEquals('https://management-test.adyen.com/v1/merchants?pageSize=2', $this->requestUrl); + } + + /** + * @return array + */ + public static function successMerchantAccountProviders(): array + { + return array( + array('tests/Resources/ModelBasedManagement/get-merchants-success.json', 200), + ); + } + + /** + * Post /merchants/{merchantId}/webhooks/{webhookId}/generateHmac + * + * @throws \Adyen\AdyenException + * @dataProvider successGenerateHmacProviders + */ + public function testGenerateHmac($jsonFile) + { + // create Checkout client + $client = $this->createMockClientUrl($jsonFile, Environment::LIVE); + // initialize service + $service = new Management\WebhooksMerchantLevelApi($client); + $response = $service->generateHmacKey( + 'merchantAccount', + 'webhookId' + ); + $this->assertNotEmpty(json_encode($response->jsonSerialize())); + $this->assertEquals("AG4345BV33J78K17F4F963516FA42AC8813EWS3J8F41E902", $response->getHmacKey()); + $this->assertEquals( + 'https://management-live.adyen.com/v1/merchants/merchantAccount/webhooks/webhookId/generateHmac', + $this->requestUrl + ); + } + + /** + * @return array + */ + public static function successGenerateHmacProviders() : array + { + return array( + array('tests/Resources/ModelBasedManagement/post-merchants-webhooks-generateHmac-success.json'), + ); + } + + /** + * Patch /terminals/{terminalId}/terminalLogos + * + * @throws \Adyen\AdyenException + * @dataProvider successUpdateTerminalLogosProviders + */ + public function testUpdateTerminalLogos($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + // initialize service + $service = new Management\TerminalSettingsTerminalLevelApi($client); + $response = $service->updateLogo( + 'terminalId', + new Logo() + ); + $this->assertNotEmpty(json_encode($response->jsonSerialize())); + $this->assertEquals("LOGO_INHERITED_FROM_HIGHER_LEVEL_BASE-64_ENCODED_STRING", $response->getData()); + } + + /** + * @return array + */ + public static function successUpdateTerminalLogosProviders() : array + { + return array( + array('tests/Resources/ModelBasedManagement/terminal-logo.json', 200), + ); + } +} From f64823dc6653aa3a0c26c649b0bd2b261da8ae3d Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 7 Apr 2023 11:12:37 +0200 Subject: [PATCH 14/33] [ITT-411] POSTerminalManagement endpoints (#477) * add POSTerminal endpoints * fix --- sonar-project.properties | 2 +- .../Model/POSTerminalManagement/Address.php | 555 ++++++++ .../AssignTerminalsRequest.php | 527 +++++++ .../AssignTerminalsResponse.php | 388 +++++ .../FindTerminalRequest.php | 388 +++++ .../FindTerminalResponse.php | 527 +++++++ .../GetStoresUnderAccountRequest.php | 422 ++++++ .../GetStoresUnderAccountResponse.php | 385 +++++ .../GetTerminalDetailsRequest.php | 388 +++++ .../GetTerminalDetailsResponse.php | 1260 +++++++++++++++++ .../GetTerminalsUnderAccountRequest.php | 456 ++++++ .../GetTerminalsUnderAccountResponse.php | 456 ++++++ .../POSTerminalManagement/MerchantAccount.php | 490 +++++++ .../POSTerminalManagement/ModelInterface.php | 93 ++ .../ObjectSerializer.php | 318 +++++ .../POSTerminalManagement/ServiceError.php | 519 +++++++ .../Model/POSTerminalManagement/Store.php | 558 ++++++++ .../Service/POSTerminalManagementApi.php | 116 ++ .../POSManagement/assign-terminals.json | 5 + .../terminals-under-account.json | 19 + tests/Unit/POSTerminalTest.php | 30 + 21 files changed, 7901 insertions(+), 1 deletion(-) create mode 100644 src/Adyen/Model/POSTerminalManagement/Address.php create mode 100644 src/Adyen/Model/POSTerminalManagement/AssignTerminalsRequest.php create mode 100644 src/Adyen/Model/POSTerminalManagement/AssignTerminalsResponse.php create mode 100644 src/Adyen/Model/POSTerminalManagement/FindTerminalRequest.php create mode 100644 src/Adyen/Model/POSTerminalManagement/FindTerminalResponse.php create mode 100644 src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountRequest.php create mode 100644 src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountResponse.php create mode 100644 src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsRequest.php create mode 100644 src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsResponse.php create mode 100644 src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountRequest.php create mode 100644 src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountResponse.php create mode 100644 src/Adyen/Model/POSTerminalManagement/MerchantAccount.php create mode 100644 src/Adyen/Model/POSTerminalManagement/ModelInterface.php create mode 100644 src/Adyen/Model/POSTerminalManagement/ObjectSerializer.php create mode 100644 src/Adyen/Model/POSTerminalManagement/ServiceError.php create mode 100644 src/Adyen/Model/POSTerminalManagement/Store.php create mode 100644 src/Adyen/Service/POSTerminalManagementApi.php create mode 100644 tests/Resources/POSManagement/assign-terminals.json create mode 100644 tests/Resources/POSManagement/terminals-under-account.json create mode 100644 tests/Unit/POSTerminalTest.php diff --git a/sonar-project.properties b/sonar-project.properties index fbabdb501..4f6fc1d8f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,4 +3,4 @@ sonar.projectKey=Adyen_adyen-php-api-library sonar.sources=. sonar.php.coverage.reportPaths=build/clover.xml sonar.php.tests.reportPath=build/tests-log.xml -sonar.exclusions=src/Adyen/Model/**, src/Adyen/Service/Checkout/**, src/Adyen/Service/Payments/**, src/Adyen/Service/Management/**, src/Adyen/Service/BalancePlatform/** \ No newline at end of file +sonar.exclusions=src/Adyen/Model/**, src/Adyen/Service/Checkout/**, src/Adyen/Service/Payments/**, src/Adyen/Service/Management/**, src/Adyen/Service/BalancePlatform/**, src/Adyen/Service/POSTerminalManagementApi.php \ No newline at end of file diff --git a/src/Adyen/Model/POSTerminalManagement/Address.php b/src/Adyen/Model/POSTerminalManagement/Address.php new file mode 100644 index 000000000..cc2201054 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/Address.php @@ -0,0 +1,555 @@ + + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'city' => 'string', + 'country_code' => 'string', + 'postal_code' => 'string', + 'state_or_province' => 'string', + 'street_address' => 'string', + 'street_address2' => '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_code' => null, + 'postal_code' => null, + 'state_or_province' => null, + 'street_address' => null, + 'street_address2' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'city' => false, + 'country_code' => false, + 'postal_code' => false, + 'state_or_province' => false, + 'street_address' => false, + 'street_address2' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'city' => 'city', + 'country_code' => 'countryCode', + 'postal_code' => 'postalCode', + 'state_or_province' => 'stateOrProvince', + 'street_address' => 'streetAddress', + 'street_address2' => 'streetAddress2' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'city' => 'setCity', + 'country_code' => 'setCountryCode', + 'postal_code' => 'setPostalCode', + 'state_or_province' => 'setStateOrProvince', + 'street_address' => 'setStreetAddress', + 'street_address2' => 'setStreetAddress2' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'city' => 'getCity', + 'country_code' => 'getCountryCode', + 'postal_code' => 'getPostalCode', + 'state_or_province' => 'getStateOrProvince', + 'street_address' => 'getStreetAddress', + 'street_address2' => 'getStreetAddress2' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('state_or_province', $data ?? [], null); + $this->setIfExists('street_address', $data ?? [], null); + $this->setIfExists('street_address2', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code country_code + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code postal_code + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state_or_province + * + * @return string|null + */ + public function getStateOrProvince() + { + return $this->container['state_or_province']; + } + + /** + * Sets state_or_province + * + * @param string|null $state_or_province state_or_province + * + * @return self + */ + public function setStateOrProvince($state_or_province) + { + if (is_null($state_or_province)) { + throw new \InvalidArgumentException('non-nullable state_or_province cannot be null'); + } + $this->container['state_or_province'] = $state_or_province; + + return $this; + } + + /** + * Gets street_address + * + * @return string|null + */ + public function getStreetAddress() + { + return $this->container['street_address']; + } + + /** + * Sets street_address + * + * @param string|null $street_address street_address + * + * @return self + */ + public function setStreetAddress($street_address) + { + if (is_null($street_address)) { + throw new \InvalidArgumentException('non-nullable street_address cannot be null'); + } + $this->container['street_address'] = $street_address; + + return $this; + } + + /** + * Gets street_address2 + * + * @return string|null + */ + public function getStreetAddress2() + { + return $this->container['street_address2']; + } + + /** + * Sets street_address2 + * + * @param string|null $street_address2 street_address2 + * + * @return self + */ + public function setStreetAddress2($street_address2) + { + if (is_null($street_address2)) { + throw new \InvalidArgumentException('non-nullable street_address2 cannot be null'); + } + $this->container['street_address2'] = $street_address2; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/AssignTerminalsRequest.php b/src/Adyen/Model/POSTerminalManagement/AssignTerminalsRequest.php new file mode 100644 index 000000000..00d557e2a --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/AssignTerminalsRequest.php @@ -0,0 +1,527 @@ + + */ +class AssignTerminalsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AssignTerminalsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company_account' => 'string', + 'merchant_account' => 'string', + 'merchant_inventory' => 'bool', + 'store' => 'string', + 'terminals' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_account' => null, + 'merchant_account' => null, + 'merchant_inventory' => null, + 'store' => null, + 'terminals' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'company_account' => false, + 'merchant_account' => false, + 'merchant_inventory' => false, + 'store' => false, + 'terminals' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_account' => 'companyAccount', + 'merchant_account' => 'merchantAccount', + 'merchant_inventory' => 'merchantInventory', + 'store' => 'store', + 'terminals' => 'terminals' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_account' => 'setCompanyAccount', + 'merchant_account' => 'setMerchantAccount', + 'merchant_inventory' => 'setMerchantInventory', + 'store' => 'setStore', + 'terminals' => 'setTerminals' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_account' => 'getCompanyAccount', + 'merchant_account' => 'getMerchantAccount', + 'merchant_inventory' => 'getMerchantInventory', + 'store' => 'getStore', + 'terminals' => 'getTerminals' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('company_account', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_inventory', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('terminals', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['company_account'] === null) { + $invalidProperties[] = "'company_account' can't be null"; + } + if ($this->container['terminals'] === null) { + $invalidProperties[] = "'terminals' 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 company_account + * + * @return string + */ + public function getCompanyAccount() + { + return $this->container['company_account']; + } + + /** + * Sets company_account + * + * @param string $company_account Your company account. To return terminals to the company inventory, specify only this parameter and the `terminals`. + * + * @return self + */ + public function setCompanyAccount($company_account) + { + if (is_null($company_account)) { + throw new \InvalidArgumentException('non-nullable company_account cannot be null'); + } + $this->container['company_account'] = $company_account; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account Name of the merchant account. Specify this parameter to assign terminals to this merchant account or to a store under this merchant account. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_inventory + * + * @return bool|null + */ + public function getMerchantInventory() + { + return $this->container['merchant_inventory']; + } + + /** + * Sets merchant_inventory + * + * @param bool|null $merchant_inventory Boolean that indicates if you are assigning the terminals to the merchant inventory. Do not use when assigning terminals to a store. Required when assigning the terminal to a merchant account. - Set this to **true** to assign the terminals to the merchant inventory. This also means that the terminals cannot be boarded. - Set this to **false** to assign the terminals to the merchant account as in-store terminals. This makes the terminals ready to be boarded and to process payments through the specified merchant account. + * + * @return self + */ + public function setMerchantInventory($merchant_inventory) + { + if (is_null($merchant_inventory)) { + throw new \InvalidArgumentException('non-nullable merchant_inventory cannot be null'); + } + $this->container['merchant_inventory'] = $merchant_inventory; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The store code of the store that you want to assign the terminals to. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets terminals + * + * @return string[] + */ + public function getTerminals() + { + return $this->container['terminals']; + } + + /** + * Sets terminals + * + * @param string[] $terminals Array containing a list of terminal IDs that you want to assign or reassign to the merchant account or store, or that you want to return to the company inventory. For example, `[\"V400m-324689776\",\"P400Plus-329127412\"]`. + * + * @return self + */ + public function setTerminals($terminals) + { + if (is_null($terminals)) { + throw new \InvalidArgumentException('non-nullable terminals cannot be null'); + } + $this->container['terminals'] = $terminals; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/AssignTerminalsResponse.php b/src/Adyen/Model/POSTerminalManagement/AssignTerminalsResponse.php new file mode 100644 index 000000000..07c4e18d4 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/AssignTerminalsResponse.php @@ -0,0 +1,388 @@ + + */ +class AssignTerminalsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AssignTerminalsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' 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 results + * + * @return array + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param array $results Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/FindTerminalRequest.php b/src/Adyen/Model/POSTerminalManagement/FindTerminalRequest.php new file mode 100644 index 000000000..b98416456 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/FindTerminalRequest.php @@ -0,0 +1,388 @@ + + */ +class FindTerminalRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FindTerminalRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'terminal' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'terminal' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'terminal' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'terminal' => 'terminal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'terminal' => 'setTerminal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'terminal' => 'getTerminal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('terminal', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['terminal'] === null) { + $invalidProperties[] = "'terminal' 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 terminal + * + * @return string + */ + public function getTerminal() + { + return $this->container['terminal']; + } + + /** + * Sets terminal + * + * @param string $terminal The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**. + * + * @return self + */ + public function setTerminal($terminal) + { + if (is_null($terminal)) { + throw new \InvalidArgumentException('non-nullable terminal cannot be null'); + } + $this->container['terminal'] = $terminal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/FindTerminalResponse.php b/src/Adyen/Model/POSTerminalManagement/FindTerminalResponse.php new file mode 100644 index 000000000..f43006aad --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/FindTerminalResponse.php @@ -0,0 +1,527 @@ + + */ +class FindTerminalResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FindTerminalResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company_account' => 'string', + 'merchant_account' => 'string', + 'merchant_inventory' => 'bool', + 'store' => 'string', + 'terminal' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_account' => null, + 'merchant_account' => null, + 'merchant_inventory' => null, + 'store' => null, + 'terminal' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'company_account' => false, + 'merchant_account' => false, + 'merchant_inventory' => false, + 'store' => false, + 'terminal' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_account' => 'companyAccount', + 'merchant_account' => 'merchantAccount', + 'merchant_inventory' => 'merchantInventory', + 'store' => 'store', + 'terminal' => 'terminal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_account' => 'setCompanyAccount', + 'merchant_account' => 'setMerchantAccount', + 'merchant_inventory' => 'setMerchantInventory', + 'store' => 'setStore', + 'terminal' => 'setTerminal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_account' => 'getCompanyAccount', + 'merchant_account' => 'getMerchantAccount', + 'merchant_inventory' => 'getMerchantInventory', + 'store' => 'getStore', + 'terminal' => 'getTerminal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('company_account', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_inventory', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('terminal', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['company_account'] === null) { + $invalidProperties[] = "'company_account' can't be null"; + } + if ($this->container['terminal'] === null) { + $invalidProperties[] = "'terminal' 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 company_account + * + * @return string + */ + public function getCompanyAccount() + { + return $this->container['company_account']; + } + + /** + * Sets company_account + * + * @param string $company_account The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. + * + * @return self + */ + public function setCompanyAccount($company_account) + { + if (is_null($company_account)) { + throw new \InvalidArgumentException('non-nullable company_account cannot be null'); + } + $this->container['company_account'] = $company_account; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_inventory + * + * @return bool|null + */ + public function getMerchantInventory() + { + return $this->container['merchant_inventory']; + } + + /** + * Sets merchant_inventory + * + * @param bool|null $merchant_inventory Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded. + * + * @return self + */ + public function setMerchantInventory($merchant_inventory) + { + if (is_null($merchant_inventory)) { + throw new \InvalidArgumentException('non-nullable merchant_inventory cannot be null'); + } + $this->container['merchant_inventory'] = $merchant_inventory; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The store code of the store that the terminal is assigned to. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets terminal + * + * @return string + */ + public function getTerminal() + { + return $this->container['terminal']; + } + + /** + * Sets terminal + * + * @param string $terminal The unique terminal ID. + * + * @return self + */ + public function setTerminal($terminal) + { + if (is_null($terminal)) { + throw new \InvalidArgumentException('non-nullable terminal cannot be null'); + } + $this->container['terminal'] = $terminal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountRequest.php b/src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountRequest.php new file mode 100644 index 000000000..752e6a7a0 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountRequest.php @@ -0,0 +1,422 @@ + + */ +class GetStoresUnderAccountRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetStoresUnderAccountRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company_account' => 'string', + 'merchant_account' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_account' => null, + 'merchant_account' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'company_account' => false, + 'merchant_account' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_account' => 'companyAccount', + 'merchant_account' => 'merchantAccount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_account' => 'setCompanyAccount', + 'merchant_account' => 'setMerchantAccount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_account' => 'getCompanyAccount', + 'merchant_account' => 'getMerchantAccount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('company_account', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['company_account'] === null) { + $invalidProperties[] = "'company_account' 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 company_account + * + * @return string + */ + public function getCompanyAccount() + { + return $this->container['company_account']; + } + + /** + * Sets company_account + * + * @param string $company_account The company account. If you only specify this parameter, the response includes the stores of all merchant accounts that are associated with the company account. + * + * @return self + */ + public function setCompanyAccount($company_account) + { + if (is_null($company_account)) { + throw new \InvalidArgumentException('non-nullable company_account cannot be null'); + } + $this->container['company_account'] = $company_account; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account The merchant account. With this parameter, the response only includes the stores of the specified merchant account. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountResponse.php b/src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountResponse.php new file mode 100644 index 000000000..2f8ce6b69 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/GetStoresUnderAccountResponse.php @@ -0,0 +1,385 @@ + + */ +class GetStoresUnderAccountResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetStoresUnderAccountResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'stores' => '\Adyen\Model\POSTerminalManagement\Store[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'stores' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'stores' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'stores' => 'stores' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'stores' => 'setStores' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'stores' => 'getStores' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('stores', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 stores + * + * @return \Adyen\Model\POSTerminalManagement\Store[]|null + */ + public function getStores() + { + return $this->container['stores']; + } + + /** + * Sets stores + * + * @param \Adyen\Model\POSTerminalManagement\Store[]|null $stores Array that returns a list of all stores for the specified merchant account, or for all merchant accounts under the company account. + * + * @return self + */ + public function setStores($stores) + { + if (is_null($stores)) { + throw new \InvalidArgumentException('non-nullable stores cannot be null'); + } + $this->container['stores'] = $stores; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsRequest.php b/src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsRequest.php new file mode 100644 index 000000000..94155309a --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsRequest.php @@ -0,0 +1,388 @@ + + */ +class GetTerminalDetailsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTerminalDetailsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'terminal' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'terminal' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'terminal' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'terminal' => 'terminal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'terminal' => 'setTerminal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'terminal' => 'getTerminal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('terminal', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['terminal'] === null) { + $invalidProperties[] = "'terminal' 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 terminal + * + * @return string + */ + public function getTerminal() + { + return $this->container['terminal']; + } + + /** + * Sets terminal + * + * @param string $terminal The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**. + * + * @return self + */ + public function setTerminal($terminal) + { + if (is_null($terminal)) { + throw new \InvalidArgumentException('non-nullable terminal cannot be null'); + } + $this->container['terminal'] = $terminal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsResponse.php b/src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsResponse.php new file mode 100644 index 000000000..c77c4b135 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/GetTerminalDetailsResponse.php @@ -0,0 +1,1260 @@ + + */ +class GetTerminalDetailsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTerminalDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bluetooth_ip' => 'string', + 'bluetooth_mac' => 'string', + 'company_account' => 'string', + 'country' => 'string', + 'device_model' => 'string', + 'dhcp_enabled' => 'bool', + 'display_label' => 'string', + 'ethernet_ip' => 'string', + 'ethernet_mac' => 'string', + 'firmware_version' => 'string', + 'iccid' => 'string', + 'last_activity_date_time' => '\DateTime', + 'last_transaction_date_time' => '\DateTime', + 'link_negotiation' => 'string', + 'merchant_account' => 'string', + 'merchant_inventory' => 'bool', + 'permanent_terminal_id' => 'string', + 'serial_number' => 'string', + 'sim_status' => 'string', + 'store' => 'string', + 'store_details' => '\Adyen\Model\POSTerminalManagement\Store', + 'terminal' => 'string', + 'terminal_status' => 'string', + 'wifi_ip' => 'string', + 'wifi_mac' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bluetooth_ip' => null, + 'bluetooth_mac' => null, + 'company_account' => null, + 'country' => null, + 'device_model' => null, + 'dhcp_enabled' => null, + 'display_label' => null, + 'ethernet_ip' => null, + 'ethernet_mac' => null, + 'firmware_version' => null, + 'iccid' => null, + 'last_activity_date_time' => 'date-time', + 'last_transaction_date_time' => 'date-time', + 'link_negotiation' => null, + 'merchant_account' => null, + 'merchant_inventory' => null, + 'permanent_terminal_id' => null, + 'serial_number' => null, + 'sim_status' => null, + 'store' => null, + 'store_details' => null, + 'terminal' => null, + 'terminal_status' => null, + 'wifi_ip' => null, + 'wifi_mac' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bluetooth_ip' => false, + 'bluetooth_mac' => false, + 'company_account' => false, + 'country' => false, + 'device_model' => false, + 'dhcp_enabled' => false, + 'display_label' => false, + 'ethernet_ip' => false, + 'ethernet_mac' => false, + 'firmware_version' => false, + 'iccid' => false, + 'last_activity_date_time' => false, + 'last_transaction_date_time' => false, + 'link_negotiation' => false, + 'merchant_account' => false, + 'merchant_inventory' => false, + 'permanent_terminal_id' => false, + 'serial_number' => false, + 'sim_status' => false, + 'store' => false, + 'store_details' => false, + 'terminal' => false, + 'terminal_status' => false, + 'wifi_ip' => false, + 'wifi_mac' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bluetooth_ip' => 'bluetoothIp', + 'bluetooth_mac' => 'bluetoothMac', + 'company_account' => 'companyAccount', + 'country' => 'country', + 'device_model' => 'deviceModel', + 'dhcp_enabled' => 'dhcpEnabled', + 'display_label' => 'displayLabel', + 'ethernet_ip' => 'ethernetIp', + 'ethernet_mac' => 'ethernetMac', + 'firmware_version' => 'firmwareVersion', + 'iccid' => 'iccid', + 'last_activity_date_time' => 'lastActivityDateTime', + 'last_transaction_date_time' => 'lastTransactionDateTime', + 'link_negotiation' => 'linkNegotiation', + 'merchant_account' => 'merchantAccount', + 'merchant_inventory' => 'merchantInventory', + 'permanent_terminal_id' => 'permanentTerminalId', + 'serial_number' => 'serialNumber', + 'sim_status' => 'simStatus', + 'store' => 'store', + 'store_details' => 'storeDetails', + 'terminal' => 'terminal', + 'terminal_status' => 'terminalStatus', + 'wifi_ip' => 'wifiIp', + 'wifi_mac' => 'wifiMac' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bluetooth_ip' => 'setBluetoothIp', + 'bluetooth_mac' => 'setBluetoothMac', + 'company_account' => 'setCompanyAccount', + 'country' => 'setCountry', + 'device_model' => 'setDeviceModel', + 'dhcp_enabled' => 'setDhcpEnabled', + 'display_label' => 'setDisplayLabel', + 'ethernet_ip' => 'setEthernetIp', + 'ethernet_mac' => 'setEthernetMac', + 'firmware_version' => 'setFirmwareVersion', + 'iccid' => 'setIccid', + 'last_activity_date_time' => 'setLastActivityDateTime', + 'last_transaction_date_time' => 'setLastTransactionDateTime', + 'link_negotiation' => 'setLinkNegotiation', + 'merchant_account' => 'setMerchantAccount', + 'merchant_inventory' => 'setMerchantInventory', + 'permanent_terminal_id' => 'setPermanentTerminalId', + 'serial_number' => 'setSerialNumber', + 'sim_status' => 'setSimStatus', + 'store' => 'setStore', + 'store_details' => 'setStoreDetails', + 'terminal' => 'setTerminal', + 'terminal_status' => 'setTerminalStatus', + 'wifi_ip' => 'setWifiIp', + 'wifi_mac' => 'setWifiMac' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bluetooth_ip' => 'getBluetoothIp', + 'bluetooth_mac' => 'getBluetoothMac', + 'company_account' => 'getCompanyAccount', + 'country' => 'getCountry', + 'device_model' => 'getDeviceModel', + 'dhcp_enabled' => 'getDhcpEnabled', + 'display_label' => 'getDisplayLabel', + 'ethernet_ip' => 'getEthernetIp', + 'ethernet_mac' => 'getEthernetMac', + 'firmware_version' => 'getFirmwareVersion', + 'iccid' => 'getIccid', + 'last_activity_date_time' => 'getLastActivityDateTime', + 'last_transaction_date_time' => 'getLastTransactionDateTime', + 'link_negotiation' => 'getLinkNegotiation', + 'merchant_account' => 'getMerchantAccount', + 'merchant_inventory' => 'getMerchantInventory', + 'permanent_terminal_id' => 'getPermanentTerminalId', + 'serial_number' => 'getSerialNumber', + 'sim_status' => 'getSimStatus', + 'store' => 'getStore', + 'store_details' => 'getStoreDetails', + 'terminal' => 'getTerminal', + 'terminal_status' => 'getTerminalStatus', + 'wifi_ip' => 'getWifiIp', + 'wifi_mac' => 'getWifiMac' + ]; + + /** + * 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 TERMINAL_STATUS_ONLINE_LAST1_DAY = 'OnlineLast1Day'; + public const TERMINAL_STATUS_ONLINE_LAST2_DAYS = 'OnlineLast2Days'; + public const TERMINAL_STATUS_ONLINE_LAST3_DAYS = 'OnlineLast3Days'; + public const TERMINAL_STATUS_ONLINE_LAST4_DAYS = 'OnlineLast4Days'; + public const TERMINAL_STATUS_ONLINE_LAST5_DAYS = 'OnlineLast5Days'; + public const TERMINAL_STATUS_ONLINE_LAST6_DAYS = 'OnlineLast6Days'; + public const TERMINAL_STATUS_ONLINE_LAST7_DAYS = 'OnlineLast7Days'; + public const TERMINAL_STATUS_ONLINE_TODAY = 'OnlineToday'; + public const TERMINAL_STATUS_RE_ASSIGN_TO_INVENTORY_PENDING = 'ReAssignToInventoryPending'; + public const TERMINAL_STATUS_RE_ASSIGN_TO_MERCHANT_INVENTORY_PENDING = 'ReAssignToMerchantInventoryPending'; + public const TERMINAL_STATUS_RE_ASSIGN_TO_STORE_PENDING = 'ReAssignToStorePending'; + public const TERMINAL_STATUS_SWITCHED_OFF = 'SwitchedOff'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTerminalStatusAllowableValues() + { + return [ + self::TERMINAL_STATUS_ONLINE_LAST1_DAY, + self::TERMINAL_STATUS_ONLINE_LAST2_DAYS, + self::TERMINAL_STATUS_ONLINE_LAST3_DAYS, + self::TERMINAL_STATUS_ONLINE_LAST4_DAYS, + self::TERMINAL_STATUS_ONLINE_LAST5_DAYS, + self::TERMINAL_STATUS_ONLINE_LAST6_DAYS, + self::TERMINAL_STATUS_ONLINE_LAST7_DAYS, + self::TERMINAL_STATUS_ONLINE_TODAY, + self::TERMINAL_STATUS_RE_ASSIGN_TO_INVENTORY_PENDING, + self::TERMINAL_STATUS_RE_ASSIGN_TO_MERCHANT_INVENTORY_PENDING, + self::TERMINAL_STATUS_RE_ASSIGN_TO_STORE_PENDING, + self::TERMINAL_STATUS_SWITCHED_OFF, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bluetooth_ip', $data ?? [], null); + $this->setIfExists('bluetooth_mac', $data ?? [], null); + $this->setIfExists('company_account', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('device_model', $data ?? [], null); + $this->setIfExists('dhcp_enabled', $data ?? [], null); + $this->setIfExists('display_label', $data ?? [], null); + $this->setIfExists('ethernet_ip', $data ?? [], null); + $this->setIfExists('ethernet_mac', $data ?? [], null); + $this->setIfExists('firmware_version', $data ?? [], null); + $this->setIfExists('iccid', $data ?? [], null); + $this->setIfExists('last_activity_date_time', $data ?? [], null); + $this->setIfExists('last_transaction_date_time', $data ?? [], null); + $this->setIfExists('link_negotiation', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('merchant_inventory', $data ?? [], null); + $this->setIfExists('permanent_terminal_id', $data ?? [], null); + $this->setIfExists('serial_number', $data ?? [], null); + $this->setIfExists('sim_status', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + $this->setIfExists('store_details', $data ?? [], null); + $this->setIfExists('terminal', $data ?? [], null); + $this->setIfExists('terminal_status', $data ?? [], null); + $this->setIfExists('wifi_ip', $data ?? [], null); + $this->setIfExists('wifi_mac', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['company_account'] === null) { + $invalidProperties[] = "'company_account' can't be null"; + } + if ($this->container['terminal'] === null) { + $invalidProperties[] = "'terminal' can't be null"; + } + $allowedValues = $this->getTerminalStatusAllowableValues(); + if (!is_null($this->container['terminal_status']) && !in_array($this->container['terminal_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'terminal_status', must be one of '%s'", + $this->container['terminal_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bluetooth_ip + * + * @return string|null + */ + public function getBluetoothIp() + { + return $this->container['bluetooth_ip']; + } + + /** + * Sets bluetooth_ip + * + * @param string|null $bluetooth_ip The Bluetooth IP address of the terminal. + * + * @return self + */ + public function setBluetoothIp($bluetooth_ip) + { + if (is_null($bluetooth_ip)) { + throw new \InvalidArgumentException('non-nullable bluetooth_ip cannot be null'); + } + $this->container['bluetooth_ip'] = $bluetooth_ip; + + return $this; + } + + /** + * Gets bluetooth_mac + * + * @return string|null + */ + public function getBluetoothMac() + { + return $this->container['bluetooth_mac']; + } + + /** + * Sets bluetooth_mac + * + * @param string|null $bluetooth_mac The Bluetooth MAC address of the terminal. + * + * @return self + */ + public function setBluetoothMac($bluetooth_mac) + { + if (is_null($bluetooth_mac)) { + throw new \InvalidArgumentException('non-nullable bluetooth_mac cannot be null'); + } + $this->container['bluetooth_mac'] = $bluetooth_mac; + + return $this; + } + + /** + * Gets company_account + * + * @return string + */ + public function getCompanyAccount() + { + return $this->container['company_account']; + } + + /** + * Sets company_account + * + * @param string $company_account The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. + * + * @return self + */ + public function setCompanyAccount($company_account) + { + if (is_null($company_account)) { + throw new \InvalidArgumentException('non-nullable company_account cannot be null'); + } + $this->container['company_account'] = $company_account; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The country where the terminal is used. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets device_model + * + * @return string|null + */ + public function getDeviceModel() + { + return $this->container['device_model']; + } + + /** + * Sets device_model + * + * @param string|null $device_model The model name of the terminal. + * + * @return self + */ + public function setDeviceModel($device_model) + { + if (is_null($device_model)) { + throw new \InvalidArgumentException('non-nullable device_model cannot be null'); + } + $this->container['device_model'] = $device_model; + + return $this; + } + + /** + * Gets dhcp_enabled + * + * @return bool|null + */ + public function getDhcpEnabled() + { + return $this->container['dhcp_enabled']; + } + + /** + * Sets dhcp_enabled + * + * @param bool|null $dhcp_enabled Indicates whether assigning IP addresses through a DHCP server is enabled on the terminal. + * + * @return self + */ + public function setDhcpEnabled($dhcp_enabled) + { + if (is_null($dhcp_enabled)) { + throw new \InvalidArgumentException('non-nullable dhcp_enabled cannot be null'); + } + $this->container['dhcp_enabled'] = $dhcp_enabled; + + return $this; + } + + /** + * Gets display_label + * + * @return string|null + */ + public function getDisplayLabel() + { + return $this->container['display_label']; + } + + /** + * Sets display_label + * + * @param string|null $display_label The label shown on the status bar of the display. This label (if any) is specified in your Customer Area. + * + * @return self + */ + public function setDisplayLabel($display_label) + { + if (is_null($display_label)) { + throw new \InvalidArgumentException('non-nullable display_label cannot be null'); + } + $this->container['display_label'] = $display_label; + + return $this; + } + + /** + * Gets ethernet_ip + * + * @return string|null + */ + public function getEthernetIp() + { + return $this->container['ethernet_ip']; + } + + /** + * Sets ethernet_ip + * + * @param string|null $ethernet_ip The terminal's IP address in your Ethernet network. + * + * @return self + */ + public function setEthernetIp($ethernet_ip) + { + if (is_null($ethernet_ip)) { + throw new \InvalidArgumentException('non-nullable ethernet_ip cannot be null'); + } + $this->container['ethernet_ip'] = $ethernet_ip; + + return $this; + } + + /** + * Gets ethernet_mac + * + * @return string|null + */ + public function getEthernetMac() + { + return $this->container['ethernet_mac']; + } + + /** + * Sets ethernet_mac + * + * @param string|null $ethernet_mac The terminal's MAC address in your Ethernet network. + * + * @return self + */ + public function setEthernetMac($ethernet_mac) + { + if (is_null($ethernet_mac)) { + throw new \InvalidArgumentException('non-nullable ethernet_mac cannot be null'); + } + $this->container['ethernet_mac'] = $ethernet_mac; + + return $this; + } + + /** + * Gets firmware_version + * + * @return string|null + */ + public function getFirmwareVersion() + { + return $this->container['firmware_version']; + } + + /** + * Sets firmware_version + * + * @param string|null $firmware_version The software release currently in use on the terminal. + * + * @return self + */ + public function setFirmwareVersion($firmware_version) + { + if (is_null($firmware_version)) { + throw new \InvalidArgumentException('non-nullable firmware_version cannot be null'); + } + $this->container['firmware_version'] = $firmware_version; + + return $this; + } + + /** + * Gets iccid + * + * @return string|null + */ + public function getIccid() + { + return $this->container['iccid']; + } + + /** + * Sets iccid + * + * @param string|null $iccid The integrated circuit card identifier (ICCID) of the SIM card in the terminal. + * + * @return self + */ + public function setIccid($iccid) + { + if (is_null($iccid)) { + throw new \InvalidArgumentException('non-nullable iccid cannot be null'); + } + $this->container['iccid'] = $iccid; + + return $this; + } + + /** + * Gets last_activity_date_time + * + * @return \DateTime|null + */ + public function getLastActivityDateTime() + { + return $this->container['last_activity_date_time']; + } + + /** + * Sets last_activity_date_time + * + * @param \DateTime|null $last_activity_date_time Date and time of the last activity on the terminal. Not included when the last activity was more than 14 days ago. + * + * @return self + */ + public function setLastActivityDateTime($last_activity_date_time) + { + if (is_null($last_activity_date_time)) { + throw new \InvalidArgumentException('non-nullable last_activity_date_time cannot be null'); + } + $this->container['last_activity_date_time'] = $last_activity_date_time; + + return $this; + } + + /** + * Gets last_transaction_date_time + * + * @return \DateTime|null + */ + public function getLastTransactionDateTime() + { + return $this->container['last_transaction_date_time']; + } + + /** + * Sets last_transaction_date_time + * + * @param \DateTime|null $last_transaction_date_time Date and time of the last transaction on the terminal. Not included when the last transaction was more than 14 days ago. + * + * @return self + */ + public function setLastTransactionDateTime($last_transaction_date_time) + { + if (is_null($last_transaction_date_time)) { + throw new \InvalidArgumentException('non-nullable last_transaction_date_time cannot be null'); + } + $this->container['last_transaction_date_time'] = $last_transaction_date_time; + + return $this; + } + + /** + * Gets link_negotiation + * + * @return string|null + */ + public function getLinkNegotiation() + { + return $this->container['link_negotiation']; + } + + /** + * Sets link_negotiation + * + * @param string|null $link_negotiation The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex + * + * @return self + */ + public function setLinkNegotiation($link_negotiation) + { + if (is_null($link_negotiation)) { + throw new \InvalidArgumentException('non-nullable link_negotiation cannot be null'); + } + $this->container['link_negotiation'] = $link_negotiation; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets merchant_inventory + * + * @return bool|null + */ + public function getMerchantInventory() + { + return $this->container['merchant_inventory']; + } + + /** + * Sets merchant_inventory + * + * @param bool|null $merchant_inventory Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded. + * + * @return self + */ + public function setMerchantInventory($merchant_inventory) + { + if (is_null($merchant_inventory)) { + throw new \InvalidArgumentException('non-nullable merchant_inventory cannot be null'); + } + $this->container['merchant_inventory'] = $merchant_inventory; + + return $this; + } + + /** + * Gets permanent_terminal_id + * + * @return string|null + */ + public function getPermanentTerminalId() + { + return $this->container['permanent_terminal_id']; + } + + /** + * Sets permanent_terminal_id + * + * @param string|null $permanent_terminal_id The permanent terminal ID. + * + * @return self + */ + public function setPermanentTerminalId($permanent_terminal_id) + { + if (is_null($permanent_terminal_id)) { + throw new \InvalidArgumentException('non-nullable permanent_terminal_id cannot be null'); + } + $this->container['permanent_terminal_id'] = $permanent_terminal_id; + + return $this; + } + + /** + * Gets serial_number + * + * @return string|null + */ + public function getSerialNumber() + { + return $this->container['serial_number']; + } + + /** + * Sets serial_number + * + * @param string|null $serial_number The serial number of the terminal. + * + * @return self + */ + public function setSerialNumber($serial_number) + { + if (is_null($serial_number)) { + throw new \InvalidArgumentException('non-nullable serial_number cannot be null'); + } + $this->container['serial_number'] = $serial_number; + + return $this; + } + + /** + * Gets sim_status + * + * @return string|null + */ + public function getSimStatus() + { + return $this->container['sim_status']; + } + + /** + * Sets sim_status + * + * @param string|null $sim_status On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. + * + * @return self + */ + public function setSimStatus($sim_status) + { + if (is_null($sim_status)) { + throw new \InvalidArgumentException('non-nullable sim_status cannot be null'); + } + $this->container['sim_status'] = $sim_status; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The store code of the store that the terminal is assigned to. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + + /** + * Gets store_details + * + * @return \Adyen\Model\POSTerminalManagement\Store|null + */ + public function getStoreDetails() + { + return $this->container['store_details']; + } + + /** + * Sets store_details + * + * @param \Adyen\Model\POSTerminalManagement\Store|null $store_details store_details + * + * @return self + */ + public function setStoreDetails($store_details) + { + if (is_null($store_details)) { + throw new \InvalidArgumentException('non-nullable store_details cannot be null'); + } + $this->container['store_details'] = $store_details; + + return $this; + } + + /** + * Gets terminal + * + * @return string + */ + public function getTerminal() + { + return $this->container['terminal']; + } + + /** + * Sets terminal + * + * @param string $terminal The unique terminal ID. + * + * @return self + */ + public function setTerminal($terminal) + { + if (is_null($terminal)) { + throw new \InvalidArgumentException('non-nullable terminal cannot be null'); + } + $this->container['terminal'] = $terminal; + + return $this; + } + + /** + * Gets terminal_status + * + * @return string|null + */ + public function getTerminalStatus() + { + return $this->container['terminal_status']; + } + + /** + * Sets terminal_status + * + * @param string|null $terminal_status The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned. + * + * @return self + */ + public function setTerminalStatus($terminal_status) + { + if (is_null($terminal_status)) { + throw new \InvalidArgumentException('non-nullable terminal_status cannot be null'); + } + $allowedValues = $this->getTerminalStatusAllowableValues(); + if (!in_array($terminal_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'terminal_status', must be one of '%s'", + $terminal_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['terminal_status'] = $terminal_status; + + return $this; + } + + /** + * Gets wifi_ip + * + * @return string|null + */ + public function getWifiIp() + { + return $this->container['wifi_ip']; + } + + /** + * Sets wifi_ip + * + * @param string|null $wifi_ip The terminal's IP address in your Wi-Fi network. + * + * @return self + */ + public function setWifiIp($wifi_ip) + { + if (is_null($wifi_ip)) { + throw new \InvalidArgumentException('non-nullable wifi_ip cannot be null'); + } + $this->container['wifi_ip'] = $wifi_ip; + + return $this; + } + + /** + * Gets wifi_mac + * + * @return string|null + */ + public function getWifiMac() + { + return $this->container['wifi_mac']; + } + + /** + * Sets wifi_mac + * + * @param string|null $wifi_mac The terminal's MAC address in your Wi-Fi network. + * + * @return self + */ + public function setWifiMac($wifi_mac) + { + if (is_null($wifi_mac)) { + throw new \InvalidArgumentException('non-nullable wifi_mac cannot be null'); + } + $this->container['wifi_mac'] = $wifi_mac; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountRequest.php b/src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountRequest.php new file mode 100644 index 000000000..386c7d01e --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountRequest.php @@ -0,0 +1,456 @@ + + */ +class GetTerminalsUnderAccountRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTerminalsUnderAccountRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company_account' => 'string', + 'merchant_account' => 'string', + 'store' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_account' => null, + 'merchant_account' => null, + 'store' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'company_account' => false, + 'merchant_account' => false, + 'store' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_account' => 'companyAccount', + 'merchant_account' => 'merchantAccount', + 'store' => 'store' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_account' => 'setCompanyAccount', + 'merchant_account' => 'setMerchantAccount', + 'store' => 'setStore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_account' => 'getCompanyAccount', + 'merchant_account' => 'getMerchantAccount', + 'store' => 'getStore' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('company_account', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['company_account'] === null) { + $invalidProperties[] = "'company_account' 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 company_account + * + * @return string + */ + public function getCompanyAccount() + { + return $this->container['company_account']; + } + + /** + * Sets company_account + * + * @param string $company_account Your company account. If you only specify this parameter, the response includes all terminals at all account levels. + * + * @return self + */ + public function setCompanyAccount($company_account) + { + if (is_null($company_account)) { + throw new \InvalidArgumentException('non-nullable company_account cannot be null'); + } + $this->container['company_account'] = $company_account; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string|null + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string|null $merchant_account The merchant account. This is required if you are retrieving the terminals assigned to a store.If you don't specify a `store` the response includes the terminals assigned to the specified merchant account and the terminals assigned to the stores under this merchant account. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets store + * + * @return string|null + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string|null $store The store code of the store. With this parameter, the response only includes the terminals assigned to the specified store. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountResponse.php b/src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountResponse.php new file mode 100644 index 000000000..a40a67072 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/GetTerminalsUnderAccountResponse.php @@ -0,0 +1,456 @@ + + */ +class GetTerminalsUnderAccountResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetTerminalsUnderAccountResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'company_account' => 'string', + 'inventory_terminals' => 'string[]', + 'merchant_accounts' => '\Adyen\Model\POSTerminalManagement\MerchantAccount[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_account' => null, + 'inventory_terminals' => null, + 'merchant_accounts' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'company_account' => false, + 'inventory_terminals' => false, + 'merchant_accounts' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_account' => 'companyAccount', + 'inventory_terminals' => 'inventoryTerminals', + 'merchant_accounts' => 'merchantAccounts' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_account' => 'setCompanyAccount', + 'inventory_terminals' => 'setInventoryTerminals', + 'merchant_accounts' => 'setMerchantAccounts' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_account' => 'getCompanyAccount', + 'inventory_terminals' => 'getInventoryTerminals', + 'merchant_accounts' => 'getMerchantAccounts' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('company_account', $data ?? [], null); + $this->setIfExists('inventory_terminals', $data ?? [], null); + $this->setIfExists('merchant_accounts', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['company_account'] === null) { + $invalidProperties[] = "'company_account' 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 company_account + * + * @return string + */ + public function getCompanyAccount() + { + return $this->container['company_account']; + } + + /** + * Sets company_account + * + * @param string $company_account Your company account. + * + * @return self + */ + public function setCompanyAccount($company_account) + { + if (is_null($company_account)) { + throw new \InvalidArgumentException('non-nullable company_account cannot be null'); + } + $this->container['company_account'] = $company_account; + + return $this; + } + + /** + * Gets inventory_terminals + * + * @return string[]|null + */ + public function getInventoryTerminals() + { + return $this->container['inventory_terminals']; + } + + /** + * Sets inventory_terminals + * + * @param string[]|null $inventory_terminals Array that returns a list of all terminals that are in the inventory of the company account. + * + * @return self + */ + public function setInventoryTerminals($inventory_terminals) + { + if (is_null($inventory_terminals)) { + throw new \InvalidArgumentException('non-nullable inventory_terminals cannot be null'); + } + $this->container['inventory_terminals'] = $inventory_terminals; + + return $this; + } + + /** + * Gets merchant_accounts + * + * @return \Adyen\Model\POSTerminalManagement\MerchantAccount[]|null + */ + public function getMerchantAccounts() + { + return $this->container['merchant_accounts']; + } + + /** + * Sets merchant_accounts + * + * @param \Adyen\Model\POSTerminalManagement\MerchantAccount[]|null $merchant_accounts Array that returns a list of all merchant accounts belonging to the company account. + * + * @return self + */ + public function setMerchantAccounts($merchant_accounts) + { + if (is_null($merchant_accounts)) { + throw new \InvalidArgumentException('non-nullable merchant_accounts cannot be null'); + } + $this->container['merchant_accounts'] = $merchant_accounts; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/MerchantAccount.php b/src/Adyen/Model/POSTerminalManagement/MerchantAccount.php new file mode 100644 index 000000000..f9f6fd743 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/MerchantAccount.php @@ -0,0 +1,490 @@ + + */ +class MerchantAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'in_store_terminals' => 'string[]', + 'inventory_terminals' => 'string[]', + 'merchant_account' => 'string', + 'stores' => '\Adyen\Model\POSTerminalManagement\Store[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'in_store_terminals' => null, + 'inventory_terminals' => null, + 'merchant_account' => null, + 'stores' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'in_store_terminals' => false, + 'inventory_terminals' => false, + 'merchant_account' => false, + 'stores' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'in_store_terminals' => 'inStoreTerminals', + 'inventory_terminals' => 'inventoryTerminals', + 'merchant_account' => 'merchantAccount', + 'stores' => 'stores' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'in_store_terminals' => 'setInStoreTerminals', + 'inventory_terminals' => 'setInventoryTerminals', + 'merchant_account' => 'setMerchantAccount', + 'stores' => 'setStores' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'in_store_terminals' => 'getInStoreTerminals', + 'inventory_terminals' => 'getInventoryTerminals', + 'merchant_account' => 'getMerchantAccount', + 'stores' => 'getStores' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('in_store_terminals', $data ?? [], null); + $this->setIfExists('inventory_terminals', $data ?? [], null); + $this->setIfExists('merchant_account', $data ?? [], null); + $this->setIfExists('stores', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['merchant_account'] === null) { + $invalidProperties[] = "'merchant_account' 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 in_store_terminals + * + * @return string[]|null + */ + public function getInStoreTerminals() + { + return $this->container['in_store_terminals']; + } + + /** + * Sets in_store_terminals + * + * @param string[]|null $in_store_terminals List of terminals assigned to this merchant account as in-store terminals. This means that the terminal is ready to be boarded, or is already boarded. + * + * @return self + */ + public function setInStoreTerminals($in_store_terminals) + { + if (is_null($in_store_terminals)) { + throw new \InvalidArgumentException('non-nullable in_store_terminals cannot be null'); + } + $this->container['in_store_terminals'] = $in_store_terminals; + + return $this; + } + + /** + * Gets inventory_terminals + * + * @return string[]|null + */ + public function getInventoryTerminals() + { + return $this->container['inventory_terminals']; + } + + /** + * Sets inventory_terminals + * + * @param string[]|null $inventory_terminals List of terminals assigned to the inventory of this merchant account. + * + * @return self + */ + public function setInventoryTerminals($inventory_terminals) + { + if (is_null($inventory_terminals)) { + throw new \InvalidArgumentException('non-nullable inventory_terminals cannot be null'); + } + $this->container['inventory_terminals'] = $inventory_terminals; + + return $this; + } + + /** + * Gets merchant_account + * + * @return string + */ + public function getMerchantAccount() + { + return $this->container['merchant_account']; + } + + /** + * Sets merchant_account + * + * @param string $merchant_account The merchant account. + * + * @return self + */ + public function setMerchantAccount($merchant_account) + { + if (is_null($merchant_account)) { + throw new \InvalidArgumentException('non-nullable merchant_account cannot be null'); + } + $this->container['merchant_account'] = $merchant_account; + + return $this; + } + + /** + * Gets stores + * + * @return \Adyen\Model\POSTerminalManagement\Store[]|null + */ + public function getStores() + { + return $this->container['stores']; + } + + /** + * Sets stores + * + * @param \Adyen\Model\POSTerminalManagement\Store[]|null $stores Array of stores under this merchant account. + * + * @return self + */ + public function setStores($stores) + { + if (is_null($stores)) { + throw new \InvalidArgumentException('non-nullable stores cannot be null'); + } + $this->container['stores'] = $stores; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/ModelInterface.php b/src/Adyen/Model/POSTerminalManagement/ModelInterface.php new file mode 100644 index 000000000..52c10196f --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/ModelInterface.php @@ -0,0 +1,93 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach ($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) { + return $timestamp; + } + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/ServiceError.php b/src/Adyen/Model/POSTerminalManagement/ServiceError.php new file mode 100644 index 000000000..9f386d1fe --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/ServiceError.php @@ -0,0 +1,519 @@ + + */ +class ServiceError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ServiceError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error_code' => 'string', + 'error_type' => 'string', + 'message' => 'string', + 'psp_reference' => 'string', + 'status' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error_code' => null, + 'error_type' => null, + 'message' => null, + 'psp_reference' => null, + 'status' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'error_code' => false, + 'error_type' => false, + 'message' => false, + 'psp_reference' => false, + 'status' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error_code' => 'errorCode', + 'error_type' => 'errorType', + 'message' => 'message', + 'psp_reference' => 'pspReference', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error_code' => 'setErrorCode', + 'error_type' => 'setErrorType', + 'message' => 'setMessage', + 'psp_reference' => 'setPspReference', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error_code' => 'getErrorCode', + 'error_type' => 'getErrorType', + 'message' => 'getMessage', + 'psp_reference' => 'getPspReference', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('error_type', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('psp_reference', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 error_code + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['error_code']; + } + + /** + * Sets error_code + * + * @param string|null $error_code The error code mapped to the error message. + * + * @return self + */ + public function setErrorCode($error_code) + { + if (is_null($error_code)) { + throw new \InvalidArgumentException('non-nullable error_code cannot be null'); + } + $this->container['error_code'] = $error_code; + + return $this; + } + + /** + * Gets error_type + * + * @return string|null + */ + public function getErrorType() + { + return $this->container['error_type']; + } + + /** + * Sets error_type + * + * @param string|null $error_type The category of the error. + * + * @return self + */ + public function setErrorType($error_type) + { + if (is_null($error_type)) { + throw new \InvalidArgumentException('non-nullable error_type cannot be null'); + } + $this->container['error_type'] = $error_type; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A short explanation of the issue. + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets psp_reference + * + * @return string|null + */ + public function getPspReference() + { + return $this->container['psp_reference']; + } + + /** + * Sets psp_reference + * + * @param string|null $psp_reference The PSP reference of the payment. + * + * @return self + */ + public function setPspReference($psp_reference) + { + if (is_null($psp_reference)) { + throw new \InvalidArgumentException('non-nullable psp_reference cannot be null'); + } + $this->container['psp_reference'] = $psp_reference; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP response status. + * + * @return self + */ + public function setStatus($status) + { + // Do nothing for nullable integers + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/POSTerminalManagement/Store.php b/src/Adyen/Model/POSTerminalManagement/Store.php new file mode 100644 index 000000000..a4e3dcad6 --- /dev/null +++ b/src/Adyen/Model/POSTerminalManagement/Store.php @@ -0,0 +1,558 @@ + + */ +class Store implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Store'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\Adyen\Model\POSTerminalManagement\Address', + 'description' => 'string', + 'in_store_terminals' => 'string[]', + 'merchant_account_code' => 'string', + 'status' => 'string', + 'store' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'description' => null, + 'in_store_terminals' => null, + 'merchant_account_code' => null, + 'status' => null, + 'store' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'address' => false, + 'description' => false, + 'in_store_terminals' => false, + 'merchant_account_code' => false, + 'status' => false, + 'store' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'description' => 'description', + 'in_store_terminals' => 'inStoreTerminals', + 'merchant_account_code' => 'merchantAccountCode', + 'status' => 'status', + 'store' => 'store' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'description' => 'setDescription', + 'in_store_terminals' => 'setInStoreTerminals', + 'merchant_account_code' => 'setMerchantAccountCode', + 'status' => 'setStatus', + 'store' => 'setStore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'description' => 'getDescription', + 'in_store_terminals' => 'getInStoreTerminals', + 'merchant_account_code' => 'getMerchantAccountCode', + 'status' => 'getStatus', + 'store' => 'getStore' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('in_store_terminals', $data ?? [], null); + $this->setIfExists('merchant_account_code', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('store', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['store'] === null) { + $invalidProperties[] = "'store' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \Adyen\Model\POSTerminalManagement\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Adyen\Model\POSTerminalManagement\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the store. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets in_store_terminals + * + * @return string[]|null + */ + public function getInStoreTerminals() + { + return $this->container['in_store_terminals']; + } + + /** + * Sets in_store_terminals + * + * @param string[]|null $in_store_terminals The list of terminals assigned to the store. + * + * @return self + */ + public function setInStoreTerminals($in_store_terminals) + { + if (is_null($in_store_terminals)) { + throw new \InvalidArgumentException('non-nullable in_store_terminals cannot be null'); + } + $this->container['in_store_terminals'] = $in_store_terminals; + + return $this; + } + + /** + * Gets merchant_account_code + * + * @return string|null + */ + public function getMerchantAccountCode() + { + return $this->container['merchant_account_code']; + } + + /** + * Sets merchant_account_code + * + * @param string|null $merchant_account_code The code of the merchant account. + * + * @return self + */ + public function setMerchantAccountCode($merchant_account_code) + { + if (is_null($merchant_account_code)) { + throw new \InvalidArgumentException('non-nullable merchant_account_code cannot be null'); + } + $this->container['merchant_account_code'] = $merchant_account_code; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the store: - `PreActive`: the store has been created, but not yet activated. - `Active`: the store has been activated. This means you can process payments for this store. - `Inactive`: the store is currently not active. - `InactiveWithModifications`: the store is currently not active, but payment modifications such as refunds are possible. - `Closed`: the store has been closed. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets store + * + * @return string + */ + public function getStore() + { + return $this->container['store']; + } + + /** + * Sets store + * + * @param string $store The code of the store. + * + * @return self + */ + public function setStore($store) + { + if (is_null($store)) { + throw new \InvalidArgumentException('non-nullable store cannot be null'); + } + $this->container['store'] = $store; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Service/POSTerminalManagementApi.php b/src/Adyen/Service/POSTerminalManagementApi.php new file mode 100644 index 000000000..7fa9064d8 --- /dev/null +++ b/src/Adyen/Service/POSTerminalManagementApi.php @@ -0,0 +1,116 @@ +baseURL = $this->createBaseUrl("https://postfmapi-test.adyen.com/postfmapi/terminal/v1"); + } + + /** + * Assign terminals + * + * @param \Adyen\Model\POSTerminalManagement\AssignTerminalsRequest $assignTerminalsRequest + * @param array|null $requestOptions + * @return \Adyen\Model\POSTerminalManagement\AssignTerminalsResponse + * @throws AdyenException + */ + public function assignTerminals(\Adyen\Model\POSTerminalManagement\AssignTerminalsRequest $assignTerminalsRequest, array $requestOptions = null): \Adyen\Model\POSTerminalManagement\AssignTerminalsResponse + { + $endpoint = $this->baseURL . "/assignTerminals"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $assignTerminalsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\POSTerminalManagement\AssignTerminalsResponse::class); + } + + /** + * Get the account or store of a terminal + * + * @param \Adyen\Model\POSTerminalManagement\FindTerminalRequest $findTerminalRequest + * @param array|null $requestOptions + * @return \Adyen\Model\POSTerminalManagement\FindTerminalResponse + * @throws AdyenException + */ + public function findTerminal(\Adyen\Model\POSTerminalManagement\FindTerminalRequest $findTerminalRequest, array $requestOptions = null): \Adyen\Model\POSTerminalManagement\FindTerminalResponse + { + $endpoint = $this->baseURL . "/findTerminal"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $findTerminalRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\POSTerminalManagement\FindTerminalResponse::class); + } + + /** + * Get the stores of an account + * + * @param \Adyen\Model\POSTerminalManagement\GetStoresUnderAccountRequest $getStoresUnderAccountRequest + * @param array|null $requestOptions + * @return \Adyen\Model\POSTerminalManagement\GetStoresUnderAccountResponse + * @throws AdyenException + */ + public function getStoresUnderAccount(\Adyen\Model\POSTerminalManagement\GetStoresUnderAccountRequest $getStoresUnderAccountRequest, array $requestOptions = null): \Adyen\Model\POSTerminalManagement\GetStoresUnderAccountResponse + { + $endpoint = $this->baseURL . "/getStoresUnderAccount"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $getStoresUnderAccountRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\POSTerminalManagement\GetStoresUnderAccountResponse::class); + } + + /** + * Get the details of a terminal + * + * @param \Adyen\Model\POSTerminalManagement\GetTerminalDetailsRequest $getTerminalDetailsRequest + * @param array|null $requestOptions + * @return \Adyen\Model\POSTerminalManagement\GetTerminalDetailsResponse + * @throws AdyenException + */ + public function getTerminalDetails(\Adyen\Model\POSTerminalManagement\GetTerminalDetailsRequest $getTerminalDetailsRequest, array $requestOptions = null): \Adyen\Model\POSTerminalManagement\GetTerminalDetailsResponse + { + $endpoint = $this->baseURL . "/getTerminalDetails"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $getTerminalDetailsRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\POSTerminalManagement\GetTerminalDetailsResponse::class); + } + + /** + * Get the list of terminals + * + * @param \Adyen\Model\POSTerminalManagement\GetTerminalsUnderAccountRequest $getTerminalsUnderAccountRequest + * @param array|null $requestOptions + * @return \Adyen\Model\POSTerminalManagement\GetTerminalsUnderAccountResponse + * @throws AdyenException + */ + public function getTerminalsUnderAccount(\Adyen\Model\POSTerminalManagement\GetTerminalsUnderAccountRequest $getTerminalsUnderAccountRequest, array $requestOptions = null): \Adyen\Model\POSTerminalManagement\GetTerminalsUnderAccountResponse + { + $endpoint = $this->baseURL . "/getTerminalsUnderAccount"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $getTerminalsUnderAccountRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\POSTerminalManagement\GetTerminalsUnderAccountResponse::class); + } +} diff --git a/tests/Resources/POSManagement/assign-terminals.json b/tests/Resources/POSManagement/assign-terminals.json new file mode 100644 index 000000000..e53c28181 --- /dev/null +++ b/tests/Resources/POSManagement/assign-terminals.json @@ -0,0 +1,5 @@ +{ + "results": { + "P400Plus-275479597": "RemoveConfigScheduled" + } +} \ No newline at end of file diff --git a/tests/Resources/POSManagement/terminals-under-account.json b/tests/Resources/POSManagement/terminals-under-account.json new file mode 100644 index 000000000..0728da5d3 --- /dev/null +++ b/tests/Resources/POSManagement/terminals-under-account.json @@ -0,0 +1,19 @@ +{ + "companyAccount": "YOUR_COMPANY_ACCOUNT", + "merchantAccounts": [ + { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT", + "inStoreTerminals": [ + "P400Plus-275479597" + ], + "stores": [ + { + "store": "YOUR_STORE", + "inStoreTerminals": [ + "M400-401972715" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/Unit/POSTerminalTest.php b/tests/Unit/POSTerminalTest.php new file mode 100644 index 000000000..569b20b0a --- /dev/null +++ b/tests/Unit/POSTerminalTest.php @@ -0,0 +1,30 @@ +createMockClientUrl('tests/Resources/POSManagement/assign-terminals.json'); + $service = new POSTerminalManagementApi($client); + + $response = $service->assignTerminals(new AssignTerminalsRequest()); + assertEquals('RemoveConfigScheduled', $response->getResults()['P400Plus-275479597']); + } + + public function testGetTerminalsUnderAccount() + { + $client = $this->createMockClientUrl('tests/Resources/POSManagement/terminals-under-account.json'); + $service = new POSTerminalManagementApi($client); + + $response = $service->getTerminalsUnderAccount(new GetTerminalsUnderAccountRequest()); + assertEquals('YOUR_COMPANY_ACCOUNT', $response->getCompanyAccount()); + } +} From dd4aa2f18cb901c169c10b8c674bade0a6d255cd Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Fri, 7 Apr 2023 13:21:26 +0200 Subject: [PATCH 15/33] ITT-413: Data Protection API (#480) * ITT-413: Data Protection API * ITT-413: Remove contact info * ITT-413: Update readme * ITT-413: Auto format generated files * ITT-413: Sonar --- Makefile | 12 +- README.md | 1 + phpcs.xml | 12 - sonar-project.properties | 2 +- .../Model/DataProtection/ModelInterface.php | 92 ++++ .../Model/DataProtection/ObjectSerializer.php | 317 +++++++++++ .../Model/DataProtection/ServiceError.php | 518 ++++++++++++++++++ .../SubjectErasureByPspReferenceRequest.php | 452 +++++++++++++++ .../DataProtection/SubjectErasureResponse.php | 421 ++++++++++++++ src/Adyen/Service/DataProtectionApi.php | 55 ++ templates/partial_header.mustache | 3 - .../DataProtection/authorization-error.json | 6 + .../post-request-subject-erasure-success.json | 3 + tests/Unit/DataProtectionTest.php | 102 ++++ tests/Unit/TestCaseMock.php | 32 +- 15 files changed, 1986 insertions(+), 42 deletions(-) create mode 100644 src/Adyen/Model/DataProtection/ModelInterface.php create mode 100644 src/Adyen/Model/DataProtection/ObjectSerializer.php create mode 100644 src/Adyen/Model/DataProtection/ServiceError.php create mode 100644 src/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.php create mode 100644 src/Adyen/Model/DataProtection/SubjectErasureResponse.php create mode 100644 src/Adyen/Service/DataProtectionApi.php create mode 100644 tests/Resources/DataProtection/authorization-error.json create mode 100644 tests/Resources/DataProtection/post-request-subject-erasure-success.json create mode 100644 tests/Unit/DataProtectionTest.php diff --git a/Makefile b/Makefile index 7271dca00..3e09459b0 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ openapi-generator-jar:=target/openapi-generator-cli.jar openapi-generator-cli:=java -jar $(openapi-generator-jar) generator:=php -modelGen:=BalancePlatform Checkout StoredValue Payments Payout Management LegalEntityManagement Transfers BalanceControl BinLookup DataProtection StoredValue POSTerminalManagement Recurring +modelGen:=BalancePlatform Checkout StoredValue Payments Payout Management LegalEntityManagement Transfers BalanceControl BinLookup StoredValue POSTerminalManagement Recurring models:=src/Adyen/Model output:=target/out @@ -43,7 +43,6 @@ $(modelGen): target/spec $(openapi-generator-jar) --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ - --ignore-file-override ./.openapi-generator-ignore \ --skip-validate-spec \ --additional-properties invokerPackage=Adyen \ --additional-properties packageName=Adyen @@ -56,7 +55,7 @@ $(modelGen): target/spec $(openapi-generator-jar) Services:=BalancePlatform Checkout StoredValue Payments Payout Management LegalEntityManagement Transfers SingleFileServices:=BalanceControl BinLookup DataProtection StoredValue POSTerminalManagement Recurring -all: $(Services) $(SingleFileServices)) +all: $(Services) $(SingleFileServices) $(Services): target/spec $(openapi-generator-jar) rm -rf $(models)/$@ $(output) @@ -69,13 +68,12 @@ $(Services): target/spec $(openapi-generator-jar) --model-package Model\\$@ \ --api-package Service\\$@ \ --reserved-words-mappings configuration=configuration \ - --ignore-file-override ./.openapi-generator-ignore \ --skip-validate-spec \ --additional-properties invokerPackage=Adyen \ --additional-properties packageName=Adyen rm -rf src/Adyen/Service/$@ src/Adyen/Model/$@ mv $(output)/lib/Model/$@ $(models)/$@ - mv $(output)/lib//ObjectSerializer.php $(models)/$@ + mv $(output)/lib/ObjectSerializer.php $(models)/$@ mkdir src/Adyen/Service/$@ mv $(output)/lib/Service/* src/Adyen/Service @@ -90,15 +88,15 @@ $(SingleFileServices): target/spec $(openapi-generator-jar) --api-package Service\\$@ \ --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ --reserved-words-mappings configuration=configuration \ - --ignore-file-override ./.openapi-generator-ignore \ --skip-validate-spec \ --additional-properties customApi=$@ \ --additional-properties invokerPackage=Adyen \ --additional-properties packageName=Adyen rm -rf src/Adyen/Service/$@Api src/Adyen/Model/$@ mv $(output)/lib/Model/$@ $(models)/$@ - mv $(output)/lib//ObjectSerializer.php $(models)/$@ + mv $(output)/lib/ObjectSerializer.php $(models)/$@ mv $(output)/lib/Service/$@/GeneralApiSingle.php src/Adyen/Service/$@Api.php + vendor/bin/phpcbf $(models)/$@ src/Adyen/Service/$@Api.php || true # Checkout spec (and patch version) target/spec: diff --git a/README.md b/README.md index 67cf0ed58..840c13674 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ The library supports all APIs under the following services: * [Referrals API](https://docs.adyen.com/risk-management/automate-submitting-referrals/referrals-api-reference): Endpoints to [automate submitting referrals](https://docs.adyen.com/risk-management/automate-submitting-referrals) for Adyen risk rules. * [Refunds API](https://docs.adyen.com/api-explorer/#/CheckoutService/v68/post/payments/{paymentPspReference}/refunds): Refunds a payment that has been captured, and returns a unique reference for this request. Current supported version: **v68** * [Reversals API](https://docs.adyen.com/api-explorer/#/CheckoutService/v68/post/payments/{paymentPspReference}/reversals): Refunds a payment if it has already been captured, and cancels a payment if it has not yet been captured. Current supported version: **v68** +* [Data Protection API](https://docs.adyen.com/development-resources/data-protection-api): Use our API to comply with GDPR's right to erasure mandate. Current supported version: **v1** For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). diff --git a/phpcs.xml b/phpcs.xml index 1b84e8013..56b2f8f72 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,17 +1,5 @@